Package io.ebeaninternal.api
Interface SpiEbeanServer
-
- All Superinterfaces:
BeanCollectionLoader
,Database
,EbeanServer
,ExtendedServer
- All Known Implementing Classes:
DefaultServer
public interface SpiEbeanServer extends ExtendedServer, EbeanServer, BeanCollectionLoader
Service Provider extension to EbeanServer.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addBatch(SpiSqlUpdate defaultSqlUpdate, SpiTransaction transaction)
Add to JDBC batch for later execution.SpiTransaction
beginServerTransaction()
Begin a managed transaction (Uses scope manager / ThreadLocal).void
clearQueryStatistics()
Clear the query execution statistics.void
clearServerTransaction()
Clear an implicit transaction from the scope.<T> CQuery<T>
compileQuery(Query<T> query, Transaction t)
Compile a query.CallOrigin
createCallOrigin()
Create an object to represent the current CallStack.DdlHandler
createDdlHandler()
Create DDL handler given the platform and configuration of the server.SpiQueryBindCapture
createQueryBindCapture(SpiQueryPlan queryPlan)
Create a query bind capture for the given query plan.SpiTransaction
createReadOnlyTransaction(Object tenantId)
Create a ServerTransaction for query purposes.SpiTransaction
currentServerTransaction()
Return the current transaction or null if there is no current transaction.Object
currentTenantId()
Return the current Tenant Id.int[]
executeBatch(SpiSqlUpdate defaultSqlUpdate, SpiTransaction transaction)
Execute the batched statement.int
executeNow(SpiSqlUpdate sqlUpdate)
Execute the sql update regardless of transaction batch mode.boolean
exists(Class<?> beanType, Object beanId, Transaction transaction)
Return true if a row for the bean type and id exists.void
externalModification(TransactionEventTable event)
Process committed changes from another framework.<T> int
findCountWithCopy(Query<T> query, Transaction t)
Execute the findCount query but without copying the query.<D> DtoQuery<D>
findDto(Class<D> dtoType, SpiQuery<?> ormQuery)
Return / wrap the ORM query as a DTO query.<T> void
findDtoEach(SpiDtoQuery<T> query, Consumer<T> consumer)
DTO findEach query.<T> void
findDtoEachWhile(SpiDtoQuery<T> query, Predicate<T> consumer)
DTO findEachWhile query.<T> List<T>
findDtoList(SpiDtoQuery<T> query)
DTO findList query.<T> T
findDtoOne(SpiDtoQuery<T> query)
DTO findOne query.void
findEachRow(SpiSqlQuery query, RowConsumer consumer)
SqlQuery find each with consumer.<A,T>
List<A>findIdsWithCopy(Query<T> query, Transaction t)
Execute the findId's query but without copying the query.<T> List<T>
findListMapper(SpiSqlQuery query, RowMapper<T> mapper)
SqlQuery find list with mapper.<T> T
findOneMapper(SpiSqlQuery query, RowMapper<T> mapper)
SqlQuery find one with mapper.SpiResultSet
findResultSet(SpiQuery<?> ormQuery, SpiTransaction transaction)
Execute the underlying ORM query returning as a JDBC ResultSet to map to DTO beans.<T> T
findSingleAttribute(SpiSqlQuery query, Class<T> cls)
SqlQuery find single attribute.<T> List<T>
findSingleAttributeList(SpiSqlQuery query, Class<T> cls)
SqlQuery find single attribute list.<T> BeanDescriptor<T>
getBeanDescriptor(Class<T> type)
Return the BeanDescriptor for a given type of bean.BeanDescriptor<?>
getBeanDescriptorById(String className)
Return BeanDescriptor using it's unique id.BeanDescriptor<?>
getBeanDescriptorByQueueId(String queueId)
Return BeanDescriptor using it's unique doc store queueId.List<BeanDescriptor<?>>
getBeanDescriptors()
Return all the descriptors.List<BeanDescriptor<?>>
getBeanDescriptors(String tableName)
Return BeanDescriptors mapped to this table.DatabasePlatform
getDatabasePlatform()
Return the DatabasePlatform for this server.DataTimeZone
getDataTimeZone()
Return the DataTimeZone to use when reading/writing timestamps via JDBC.int
getLazyLoadBatchSize()
Return the default batch size for lazy loading.PersistenceContextScope
getPersistenceContextScope(SpiQuery<?> query)
Return the PersistenceContextScope to use defined at query or server level.ReadAuditLogger
getReadAuditLogger()
Return the ReadAuditLogger to use for logging all read audit events.ReadAuditPrepare
getReadAuditPrepare()
Return the ReadAuditPrepare used to populate the read audit events with user context information (user id, user ip address etc).ServerConfig
getServerConfig()
Return the server configuration.SpiTransactionManager
getTransactionManager()
Return the transaction manager.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.boolean
isUpdateAllPropertiesInBatch()
Return true if updates in JDBC batch should include all columns if unspecified on the transaction.SpiJsonContext
jsonExtended()
Return the server extended Json context.void
loadBean(LoadBeanRequest loadRequest)
Load a batch of Associated One Beans.void
loadMany(LoadManyRequest loadRequest)
Lazy load a batch of Many's.SpiLogManager
log()
Return the log manager.void
remoteTransactionEvent(RemoteTransactionEvent event)
An event from another server in the cluster used to notify local BeanListeners of remote inserts updates and deletes.void
scopedTransactionEnter(TxScope txScope)
Start an enhanced transactional method.void
scopedTransactionExit(Object returnOrThrowable, int opCode)
Handle the end of an enhanced Transactional method.void
shutdownManaged()
For internal use, shutdown of the server invoked by JVM Shutdown.void
slowQueryCheck(long executionTimeMicros, int rowCount, SpiQuery<?> query)
Check for slow query event.void
visitMetrics(MetricVisitor visitor)
Visit all the metrics (typically reporting them).-
Methods inherited from interface io.ebean.bean.BeanCollectionLoader
getName, loadMany
-
Methods inherited from interface io.ebean.Database
beginTransaction, beginTransaction, beginTransaction, checkUniqueness, checkUniqueness, commitTransaction, createCallableSql, createCsvReader, createEntityBean, createNamedDtoQuery, createNamedQuery, createQuery, createQuery, createSqlQuery, createSqlUpdate, createTransaction, createTransaction, createUpdate, currentTransaction, delete, delete, delete, delete, deleteAll, deleteAll, deleteAll, deleteAll, deleteAllPermanent, deleteAllPermanent, deleteAllPermanent, deleteAllPermanent, deletePermanent, deletePermanent, deletePermanent, deletePermanent, diff, docStore, draftRestore, draftRestore, draftRestore, draftRestore, endTransaction, execute, execute, execute, execute, execute, execute, execute, execute, executeCall, executeCall, extended, externalModification, filter, find, find, find, findDto, findNative, flush, getAutoTune, getBackgroundExecutor, getBeanId, getBeanState, getExpressionFactory, getMetaInfoManager, getName, getPluginApi, getReference, getServerCacheManager, insert, insert, insertAll, insertAll, json, markAsDirty, merge, merge, merge, nextId, publish, publish, publish, publish, refresh, refreshMany, register, rollbackTransaction, save, save, saveAll, saveAll, saveAll, script, setBeanId, shutdown, sort, sqlQuery, sqlUpdate, truncate, truncate, update, update, update, updateAll, updateAll, validateQuery
-
Methods inherited from interface io.ebean.ExtendedServer
clockNow, delete, exists, findCount, findEach, findEach, findEachWhile, findEachWhile, findFutureCount, findFutureIds, findFutureList, findIds, findIterate, findLargeStream, findList, findList, findMap, findOne, findOne, findOneOrEmpty, findPagedList, findSet, findSingleAttributeList, findStream, findVersions, setClock, update
-
-
-
-
Method Detail
-
log
SpiLogManager log()
Return the log manager.
-
jsonExtended
SpiJsonContext jsonExtended()
Return the server extended Json context.
-
shutdownManaged
void shutdownManaged()
For internal use, shutdown of the server invoked by JVM Shutdown.
-
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.
-
getServerConfig
ServerConfig getServerConfig()
Return the server configuration.
-
getDatabasePlatform
DatabasePlatform getDatabasePlatform()
Return the DatabasePlatform for this server.
-
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.
-
getPersistenceContextScope
PersistenceContextScope getPersistenceContextScope(SpiQuery<?> query)
Return the PersistenceContextScope to use defined at query or server level.
-
clearQueryStatistics
void clearQueryStatistics()
Clear the query execution statistics.
-
getTransactionManager
SpiTransactionManager getTransactionManager()
Return the transaction manager.
-
getBeanDescriptors
List<BeanDescriptor<?>> getBeanDescriptors()
Return all the descriptors.
-
getBeanDescriptor
<T> BeanDescriptor<T> getBeanDescriptor(Class<T> type)
Return the BeanDescriptor for a given type of bean.
-
getBeanDescriptorById
BeanDescriptor<?> getBeanDescriptorById(String className)
Return BeanDescriptor using it's unique id.
-
getBeanDescriptorByQueueId
BeanDescriptor<?> getBeanDescriptorByQueueId(String queueId)
Return BeanDescriptor using it's unique doc store queueId.
-
getBeanDescriptors
List<BeanDescriptor<?>> getBeanDescriptors(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)
Create a ServerTransaction for query purposes.- Parameters:
tenantId
- For multi-tenant lazy loading provide the tenantId to use.
-
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(Query<T> query, Transaction t)
Compile a query.
-
findIdsWithCopy
<A,T> List<A> findIdsWithCopy(Query<T> query, Transaction t)
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(Query<T> query, Transaction t)
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.
-
getLazyLoadBatchSize
int getLazyLoadBatchSize()
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.
-
getReadAuditLogger
ReadAuditLogger getReadAuditLogger()
Return the ReadAuditLogger to use for logging all read audit events.
-
getReadAuditPrepare
ReadAuditPrepare getReadAuditPrepare()
Return the ReadAuditPrepare used to populate the read audit events with user context information (user id, user ip address etc).
-
getDataTimeZone
DataTimeZone getDataTimeZone()
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.
-
createDdlHandler
DdlHandler createDdlHandler()
Create DDL handler given the platform and configuration of the server.
-
scopedTransactionEnter
void scopedTransactionEnter(TxScope txScope)
Start an enhanced transactional method.
-
scopedTransactionExit
void scopedTransactionExit(Object returnOrThrowable, int opCode)
Handle the end of an enhanced Transactional method.
-
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.
-
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.
-
findDtoList
<T> List<T> findDtoList(SpiDtoQuery<T> query)
DTO findList query.
-
findDtoOne
<T> T findDtoOne(SpiDtoQuery<T> query)
DTO findOne query.
-
findDtoEach
<T> void findDtoEach(SpiDtoQuery<T> query, Consumer<T> consumer)
DTO findEach 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, SpiTransaction transaction)
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.
-
-