- All Superinterfaces:
BeanCollectionLoader,Database,SpiServer
- All Known Implementing Classes:
DefaultServer
Service Provider extension to EbeanServer.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddBatch(SpiSqlUpdate defaultSqlUpdate, SpiTransaction transaction) Add to JDBC batch for later execution.Begin a managed transaction (Uses scope manager / ThreadLocal).voidClear the query execution statistics.voidClear an implicit transaction from the scope.longclockNow()Return the NOW time from the Clock.<T> CQuery<T> compileQuery(SpiQuery.Type type, SpiQuery<T> query, Transaction transaction) Compile a query.Create an object to represent the current CallStack.<T> STreePropertycreateFormulaProperty(SpiBeanType desc, String formula, String path) <T> SpiQuery<T> createQuery(Class<T> beanType) Override in order to return SpiQuerycreateQueryBindCapture(SpiQueryPlan queryPlan) Create a query bind capture for the given query plan.createReadOnlyTransaction(Object tenantId, boolean useMaster) Create a ServerTransaction for query purposes.Return the current transaction or null if there is no current transaction.Return the current Tenant Id.Return the DataTimeZone to use when reading/writing timestamps via JDBC.<T> int<T> BeanDescriptor<T> descriptor(Class<T> type) Return the BeanDescriptor for a given type of bean.descriptorById(String className) Return BeanDescriptor using it's unique id.List<BeanDescriptor<?>> Return all the descriptors.List<BeanDescriptor<?>> descriptors(String tableName) Return BeanDescriptors mapped to this table.voidEnd the current transaction if it is active.int[]executeBatch(SpiSqlUpdate defaultSqlUpdate, SpiTransaction transaction) Execute the batched statement.intexecuteNow(SpiSqlUpdate sqlUpdate) Execute the sql update regardless of transaction batch mode.<T> booleanbooleanexists(Class<?> beanType, Object beanId, Transaction transaction) Return true if a row for the bean type and id exists.voidProcess committed changes from another framework.<T> int<T> intfindCountWithCopy(SpiQuery<T> query) Execute the findCount query but without copying the query.<D> DtoQuery<D> Return / wrap the ORM query as a DTO query.<T> voidfindDtoEach(SpiDtoQuery<T> query, int batch, Consumer<List<T>> consumer) DTO findEach batch query.<T> voidfindDtoEach(SpiDtoQuery<T> query, Consumer<T> consumer) DTO findEach query.<T> voidfindDtoEachWhile(SpiDtoQuery<T> query, Predicate<T> consumer) DTO findEachWhile query.<T> QueryIterator<T> findDtoIterate(SpiDtoQuery<T> query) DTO findIterate query.<T> List<T> findDtoList(SpiDtoQuery<T> query) DTO findList query.<T> @Nullable TfindDtoOne(SpiDtoQuery<T> query) DTO findOne query.<T> Stream<T> findDtoStream(SpiDtoQuery<T> query) DTO findStream query.<T> void<T> voidvoidfindEach(SpiSqlQuery query, Consumer<SqlRow> consumer) voidfindEachRow(SpiSqlQuery query, RowConsumer consumer) SqlQuery find each with consumer.<T> voidfindEachWhile(SpiQuery<T> query, Predicate<T> consumer) voidfindEachWhile(SpiSqlQuery query, Predicate<SqlRow> consumer) <T> FutureRowCount<T> findFutureCount(SpiQuery<T> query) <T> FutureIds<T> findFutureIds(SpiQuery<T> query) <T> FutureList<T> findFutureList(SpiQuery<T> query) <K,T> FutureMap <K, T> findFutureMap(SpiQuery<T> query) <A,T> List <A> <A,T> List <A> findIdsWithCopy(SpiQuery<T> query) Execute the findId's query but without copying the query.<T> QueryIterator<T> findIterate(SpiQuery<T> query) <T> List<T> findList(SpiSqlQuery query) <T> List<T> findListMapper(SpiSqlQuery query, RowMapper<T> mapper) SqlQuery find list with mapper.<K,T> Map <K, T> <T> @Nullable T@Nullable SqlRowfindOne(SpiSqlQuery query) <T> TfindOneMapper(SpiSqlQuery query, RowMapper<T> mapper) SqlQuery find one with mapper.<T> Optional<T> findOneOrEmpty(SpiQuery<T> query) <T> PagedList<T> findPagedList(SpiQuery<T> query) findResultSet(SpiQuery<?> ormQuery) Execute the underlying ORM query returning as a JDBC ResultSet to map to DTO beans.<T> Set<T> <T> TfindSingleAttribute(SpiSqlQuery query, Class<T> cls) SqlQuery find single attribute.<T> voidfindSingleAttributeEach(SpiSqlQuery query, Class<T> cls, Consumer<T> consumer) SqlQuery find single attribute streaming the result to a consumer.<A,T> List <A> findSingleAttributeList(SpiQuery<T> query) <T> List<T> findSingleAttributeList(SpiSqlQuery query, Class<T> cls) SqlQuery find single attribute list.<A,T> Set <A> findSingleAttributeSet(SpiQuery<T> query) <T> Stream<T> findStream(SpiQuery<T> query) findVersions(SpiQuery<T> query) booleanReturn true if the L2 cache has been disabled.booleanisSupportedType(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.booleanReturn true if updates in JDBC batch should include all columns if unspecified on the transaction.Return the server extended Json context.intReturn the default batch size for lazy loading.voidloadBean(LoadBeanRequest loadRequest) Load a batch of Associated One Beans.voidloadMany(LoadManyRequest loadRequest) Lazy load a batch of Many's.log()Return the log manager.persistenceContextScope(SpiQuery<?> query) Return the PersistenceContextScope to use defined at query or server level.voidAn event from another server in the cluster used to notify local BeanListeners of remote inserts updates and deletes.voidslowQueryCheck(long executionTimeMicros, int rowCount, SpiQuery<?> query) Check for slow query event.Return the transaction manager.<T> intvoidvisitMetrics(MetricVisitor visitor) Visit all the metrics (typically reporting them).Methods inherited from interface io.ebean.bean.BeanCollectionLoader
loadMany, nameMethods inherited from interface io.ebean.Database
autoTune, backgroundExecutor, beanId, beanId, beanState, beginTransaction, beginTransaction, beginTransaction, cacheManager, checkUniqueness, checkUniqueness, createCallableSql, createEntityBean, createTransaction, createTransaction, createUpdate, currentTransaction, dataSource, delete, delete, delete, delete, deleteAll, deleteAll, deleteAll, deleteAll, deleteAllPermanent, deleteAllPermanent, deleteAllPermanent, deleteAllPermanent, deletePermanent, deletePermanent, deletePermanent, deletePermanent, diff, execute, execute, execute, execute, execute, execute, execute, execute, executeCall, executeCall, expressionFactory, externalModification, filter, find, find, find, findDto, findNative, flush, insert, insert, insert, insert, insertAll, insertAll, insertAll, insertAll, json, lock, markAsDirty, merge, merge, merge, metaInfo, name, nextId, platform, pluginApi, readOnlyDataSource, reference, refresh, refreshMany, register, save, save, saveAll, saveAll, saveAll, script, shutdown, shutdown, sort, sqlQuery, sqlUpdate, truncate, truncate, update, update, update, updateAll, updateAll, validateQueryMethods inherited from interface io.ebean.plugin.SpiServer
beanLoader, beanType, beanTypes, beanTypes, config, databasePlatform, loadBean, loadBeanL2, loadBeanRef, scopedTransactionEnter, scopedTransactionExit
-
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
SpiLogManager 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
Override in order to return SpiQuery- Specified by:
createQueryin interfaceDatabase
-
persistenceContextScope
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
Return the BeanDescriptor for a given type of bean. -
descriptorById
Return BeanDescriptor using it's unique id. -
descriptors
Return BeanDescriptors mapped to this table. -
externalModification
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
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
An event from another server in the cluster used to notify local BeanListeners of remote inserts updates and deletes. -
compileQuery
Compile a query. -
findIdsWithCopy
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
Execute the findCount query but without copying the query. -
loadBean
Load a batch of Associated One Beans. -
loadMany
Lazy load a batch of Many's. -
lazyLoadBatchSize
int lazyLoadBatchSize()Return the default batch size for lazy loading. -
isSupportedType
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
Check for slow query event. -
findSingleAttribute
SqlQuery find single attribute. -
findSingleAttributeList
SqlQuery find single attribute list. -
findSingleAttributeEach
SqlQuery find single attribute streaming the result to a consumer. -
findOneMapper
SqlQuery find one with mapper. -
findListMapper
SqlQuery find list with mapper. -
findEachRow
SqlQuery find each with consumer. -
findDtoIterate
DTO findIterate query. -
findDtoStream
DTO findStream query. -
findDtoList
DTO findList query. -
findDtoOne
DTO findOne query. -
findDtoEach
DTO findEach query. -
findDtoEach
DTO findEach batch query. -
findDtoEachWhile
DTO findEachWhile query. -
findDto
Return / wrap the ORM query as a DTO query. -
findResultSet
Execute the underlying ORM query returning as a JDBC ResultSet to map to DTO beans. -
visitMetrics
Visit all the metrics (typically reporting them). -
exists
Return true if a row for the bean type and id exists. -
addBatch
Add to JDBC batch for later execution. -
executeBatch
Execute the batched statement. -
executeNow
Execute the sql update regardless of transaction batch mode. -
createQueryBindCapture
Create a query bind capture for the given query plan. -
exists
-
findCount
-
findIds
-
findIterate
-
findStream
-
findEach
-
findEach
-
findEachWhile
-
findVersions
-
findList
-
findFutureCount
-
findFutureIds
-
findFutureList
-
findFutureMap
-
findPagedList
-
findSet
-
findMap
-
findSingleAttributeList
-
findSingleAttributeSet
-
findOne
-
findOneOrEmpty
-
delete
-
update
-
findList
-
findEach
-
findEachWhile
-
findOne
-
createFormulaProperty
-