Interface SpiEbeanServer

All Superinterfaces:
BeanCollectionLoader, Database, SpiServer
All Known Implementing Classes:
DefaultServer

public interface SpiEbeanServer extends SpiServer, BeanCollectionLoader
Service Provider extension to EbeanServer.
  • Method Details

    • clockNow

      long clockNow()
      Return the NOW time from the Clock.
    • isDisableL2Cache

      boolean isDisableL2Cache()
      Return true if the L2 cache has been disabled.
    • log

      Return the log manager.
    • jsonExtended

      SpiJsonContext jsonExtended()
      Return the server extended Json context.
    • isUpdateAllPropertiesInBatch

      boolean isUpdateAllPropertiesInBatch()
      Return true if updates in JDBC batch should include all columns if unspecified on the transaction.
    • currentTenantId

      Object currentTenantId()
      Return the current Tenant Id.
    • createCallOrigin

      CallOrigin createCallOrigin()
      Create an object to represent the current CallStack.

      Typically used to identify the origin of queries for AutoTune and object graph costing.

    • createQuery

      <T> SpiQuery<T> createQuery(Class<T> beanType)
      Override in order to return SpiQuery
      Specified by:
      createQuery in interface Database
    • persistenceContextScope

      PersistenceContextScope persistenceContextScope(SpiQuery<?> query)
      Return the PersistenceContextScope to use defined at query or server level.
    • clearQueryStatistics

      void clearQueryStatistics()
      Clear the query execution statistics.
    • transactionManager

      SpiTransactionManager transactionManager()
      Return the transaction manager.
    • endTransaction

      void endTransaction()
      End the current transaction if it is active.
    • descriptors

      List<BeanDescriptor<?>> descriptors()
      Return all the descriptors.
    • descriptor

      <T> BeanDescriptor<T> descriptor(Class<T> type)
      Return the BeanDescriptor for a given type of bean.
    • descriptorById

      BeanDescriptor<?> descriptorById(String className)
      Return BeanDescriptor using it's unique id.
    • descriptors

      List<BeanDescriptor<?>> descriptors(String tableName)
      Return BeanDescriptors mapped to this table.
    • externalModification

      void externalModification(TransactionEventTable event)
      Process committed changes from another framework.

      This notifies this instance of the framework that beans have been committed externally to it. Either by another framework or clustered server. It uses this to maintain its cache and text indexes appropriately.

    • clearServerTransaction

      void clearServerTransaction()
      Clear an implicit transaction from the scope.
    • beginServerTransaction

      SpiTransaction beginServerTransaction()
      Begin a managed transaction (Uses scope manager / ThreadLocal).
    • currentServerTransaction

      SpiTransaction currentServerTransaction()
      Return the current transaction or null if there is no current transaction.
    • createReadOnlyTransaction

      SpiTransaction createReadOnlyTransaction(Object tenantId, boolean useMaster)
      Create a ServerTransaction for query purposes.
      Parameters:
      tenantId - For multi-tenant lazy loading provide the tenantId to use.
      useMaster - Set to true when the query should use the master data source.
    • remoteTransactionEvent

      void remoteTransactionEvent(RemoteTransactionEvent event)
      An event from another server in the cluster used to notify local BeanListeners of remote inserts updates and deletes.
    • compileQuery

      <T> CQuery<T> compileQuery(SpiQuery.Type type, SpiQuery<T> query, Transaction transaction)
      Compile a query.
    • findIdsWithCopy

      <A, T> List<A> findIdsWithCopy(SpiQuery<T> query)
      Execute the findId's query but without copying the query.

      Used so that the list of Id's can be made accessible to client code before the query has finished (if executing in a background thread).

    • findCountWithCopy

      <T> int findCountWithCopy(SpiQuery<T> query)
      Execute the findCount query but without copying the query.
    • loadBean

      void loadBean(LoadBeanRequest loadRequest)
      Load a batch of Associated One Beans.
    • loadMany

      void loadMany(LoadManyRequest loadRequest)
      Lazy load a batch of Many's.
    • lazyLoadBatchSize

      int lazyLoadBatchSize()
      Return the default batch size for lazy loading.
    • isSupportedType

      boolean isSupportedType(Type genericType)
      Return true if the type is known as an Entity or Xml type or a List Set or Map of known bean types.
    • dataTimeZone

      DataTimeZone dataTimeZone()
      Return the DataTimeZone to use when reading/writing timestamps via JDBC.
    • slowQueryCheck

      void slowQueryCheck(long executionTimeMicros, int rowCount, SpiQuery<?> query)
      Check for slow query event.
    • findSingleAttribute

      <T> T findSingleAttribute(SpiSqlQuery query, Class<T> cls)
      SqlQuery find single attribute.
    • findSingleAttributeList

      <T> List<T> findSingleAttributeList(SpiSqlQuery query, Class<T> cls)
      SqlQuery find single attribute list.
    • findSingleAttributeEach

      <T> void findSingleAttributeEach(SpiSqlQuery query, Class<T> cls, Consumer<T> consumer)
      SqlQuery find single attribute streaming the result to a consumer.
    • findOneMapper

      <T> T findOneMapper(SpiSqlQuery query, RowMapper<T> mapper)
      SqlQuery find one with mapper.
    • findListMapper

      <T> List<T> findListMapper(SpiSqlQuery query, RowMapper<T> mapper)
      SqlQuery find list with mapper.
    • findEachRow

      void findEachRow(SpiSqlQuery query, RowConsumer consumer)
      SqlQuery find each with consumer.
    • findDtoIterate

      <T> QueryIterator<T> findDtoIterate(SpiDtoQuery<T> query)
      DTO findIterate query.
    • findDtoStream

      <T> Stream<T> findDtoStream(SpiDtoQuery<T> query)
      DTO findStream query.
    • findDtoList

      <T> List<T> findDtoList(SpiDtoQuery<T> query)
      DTO findList query.
    • findDtoOne

      <T> @Nullable T findDtoOne(SpiDtoQuery<T> query)
      DTO findOne query.
    • findDtoEach

      <T> void findDtoEach(SpiDtoQuery<T> query, Consumer<T> consumer)
      DTO findEach query.
    • findDtoEach

      <T> void findDtoEach(SpiDtoQuery<T> query, int batch, Consumer<List<T>> consumer)
      DTO findEach batch query.
    • findDtoEachWhile

      <T> void findDtoEachWhile(SpiDtoQuery<T> query, Predicate<T> consumer)
      DTO findEachWhile query.
    • findDto

      <D> DtoQuery<D> findDto(Class<D> dtoType, SpiQuery<?> ormQuery)
      Return / wrap the ORM query as a DTO query.
    • findResultSet

      SpiResultSet findResultSet(SpiQuery<?> ormQuery)
      Execute the underlying ORM query returning as a JDBC ResultSet to map to DTO beans.
    • visitMetrics

      void visitMetrics(MetricVisitor visitor)
      Visit all the metrics (typically reporting them).
    • exists

      boolean exists(Class<?> beanType, Object beanId, Transaction transaction)
      Return true if a row for the bean type and id exists.
    • addBatch

      void addBatch(SpiSqlUpdate defaultSqlUpdate, SpiTransaction transaction)
      Add to JDBC batch for later execution.
    • executeBatch

      int[] executeBatch(SpiSqlUpdate defaultSqlUpdate, SpiTransaction transaction)
      Execute the batched statement.
    • executeNow

      int executeNow(SpiSqlUpdate sqlUpdate)
      Execute the sql update regardless of transaction batch mode.
    • createQueryBindCapture

      SpiQueryBindCapture createQueryBindCapture(SpiQueryPlan queryPlan)
      Create a query bind capture for the given query plan.
    • exists

      <T> boolean exists(SpiQuery<T> ormQuery)
    • findCount

      <T> int findCount(SpiQuery<T> query)
    • findIds

      <A, T> List<A> findIds(SpiQuery<T> query)
    • findIterate

      <T> QueryIterator<T> findIterate(SpiQuery<T> query)
    • findStream

      <T> Stream<T> findStream(SpiQuery<T> query)
    • findEach

      <T> void findEach(SpiQuery<T> query, Consumer<T> consumer)
    • findEach

      <T> void findEach(SpiQuery<T> query, int batch, Consumer<List<T>> consumer)
    • findEachWhile

      <T> void findEachWhile(SpiQuery<T> query, Predicate<T> consumer)
    • findVersions

      <T> List<Version<T>> findVersions(SpiQuery<T> query)
    • findList

      <T> List<T> findList(SpiQuery<T> query)
    • findFutureCount

      <T> FutureRowCount<T> findFutureCount(SpiQuery<T> query)
    • findFutureIds

      <T> FutureIds<T> findFutureIds(SpiQuery<T> query)
    • findFutureList

      <T> FutureList<T> findFutureList(SpiQuery<T> query)
    • findFutureMap

      <K, T> FutureMap<K,T> findFutureMap(SpiQuery<T> query)
    • findPagedList

      <T> PagedList<T> findPagedList(SpiQuery<T> query)
    • findSet

      <T> Set<T> findSet(SpiQuery<T> query)
    • findMap

      <K, T> Map<K,T> findMap(SpiQuery<T> query)
    • findSingleAttributeList

      <A, T> List<A> findSingleAttributeList(SpiQuery<T> query)
    • findSingleAttributeSet

      <A, T> Set<A> findSingleAttributeSet(SpiQuery<T> query)
    • findOne

      <T> @Nullable T findOne(SpiQuery<T> query)
    • findOneOrEmpty

      <T> Optional<T> findOneOrEmpty(SpiQuery<T> query)
    • delete

      <T> int delete(SpiQuery<T> query)
    • update

      <T> int update(SpiQuery<T> query)
    • findList

      List<SqlRow> findList(SpiSqlQuery query)
    • findEach

      void findEach(SpiSqlQuery query, Consumer<SqlRow> consumer)
    • findEachWhile

      void findEachWhile(SpiSqlQuery query, Predicate<SqlRow> consumer)
    • findOne

      @Nullable SqlRow findOne(SpiSqlQuery query)
    • createFormulaProperty

      <T> STreeProperty createFormulaProperty(SpiBeanType desc, String formula, String path)