public final class DefaultServer extends Object implements SpiEbeanServer
| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentHashMap<ObjectGraphNode,CObjectGraphNodeStatistics> |
objectGraphStats
Cache used to collect statistics based on ObjectGraphNode (used to highlight lazy loading origin points).
|
| Constructor and Description |
|---|
DefaultServer(InternalConfiguration config,
ServerCacheManager cache)
Create the DefaultServer.
|
| Modifier and Type | Method and Description |
|---|---|
Transaction |
beginTransaction()
Start a transaction.
|
Transaction |
beginTransaction(TxIsolation isolation)
Start a transaction with a specific Isolation Level.
|
void |
clearQueryStatistics()
Clear the query execution statistics.
|
void |
collectQueryStats(ObjectGraphNode node,
long loadedBeanCount,
long timeMicros)
Collect query statistics by ObjectGraphNode.
|
void |
commitTransaction()
Commit the current transaction.
|
<T> CQuery<T> |
compileQuery(Query<T> query,
Transaction t)
Compile a query.
|
CallableSql |
createCallableSql(String sql)
Create a CallableSql to execute a given stored procedure.
|
CallStack |
createCallStack()
Create a CallStack object.
|
<T> CsvReader<T> |
createCsvReader(Class<T> beanType)
Create a CsvReader for a given beanType.
|
<T> T |
createEntityBean(Class<T> type)
Create a new EntityBean bean.
|
JsonContext |
createJsonContext()
Create a JsonContext that will use the default configuration options.
|
<T> Query<T> |
createNamedQuery(Class<T> beanType,
String namedQuery)
Create a named query for an entity bean (refer
Ebean.createQuery(Class, String)) |
SqlQuery |
createNamedSqlQuery(String namedQuery)
Create a named sql query (refer
Ebean.createNamedSqlQuery(String)
). |
SqlUpdate |
createNamedSqlUpdate(String namedQuery)
Create a named sql update (refer
Ebean.createNamedSqlUpdate(String)
). |
<T> Update<T> |
createNamedUpdate(Class<T> beanType,
String namedUpdate)
Create a named update for an entity bean (refer
Ebean.createNamedUpdate(Class, String)). |
<T> Query<T> |
createQuery(Class<T> beanType)
Create a query for an entity bean (refer
Ebean.createQuery(Class)
). |
<T> Query<T> |
createQuery(Class<T> beanType,
String query)
Create a query using the query language.
|
<T> SpiOrmQueryRequest<T> |
createQueryRequest(BeanDescriptor<T> desc,
SpiQuery<T> query,
Transaction t)
Create a query request object.
|
SpiTransaction |
createQueryTransaction()
Create a ServerTransaction for query purposes.
|
ScopeTrans |
createScopeTrans(TxScope txScope)
Create a ScopeTrans for a method for the given scope definition.
|
SpiTransaction |
createServerTransaction(boolean isExplicit,
int isolationLevel)
Create a ServerTransaction.
|
SqlQuery |
createSqlQuery(String sql)
Create a sql query for executing native sql query statements (refer
Ebean.createSqlQuery(String)). |
SqlUpdate |
createSqlUpdate(String sql)
Create a sql update for executing native dml statements (refer
Ebean.createSqlUpdate(String)). |
Transaction |
createTransaction()
Creates a new Transaction that is NOT stored in TransactionThreadLocal.
|
Transaction |
createTransaction(TxIsolation isolation)
Create a transaction additionally specify the Isolation level.
|
<T> Update<T> |
createUpdate(Class<T> beanType,
String ormUpdate)
Create a update for an entity bean where you will manually specify the
insert update or delete statement.
|
Transaction |
currentTransaction()
Return the current transaction or null if there is not one currently in
scope.
|
void |
delete(Class<?> beanType,
Collection<?> ids)
Delete several beans given their type and id values.
|
void |
delete(Class<?> beanType,
Collection<?> ids,
Transaction t)
Delete several beans given their type and id values with an explicit
transaction.
|
int |
delete(Class<?> beanType,
Object id)
Delete the bean given its type and id.
|
int |
delete(Class<?> beanType,
Object id,
Transaction t)
Delete the bean given its type and id with an explicit transaction.
|
int |
delete(Collection<?> c)
Delete all the beans in the collection.
|
int |
delete(Iterator<?> it)
Delete all the beans in the iterator.
|
int |
delete(Iterator<?> it,
Transaction t)
Delete all the beans in the iterator with an explicit transaction.
|
void |
delete(Object bean)
Delete the bean.
|
void |
delete(Object bean,
Transaction t)
Delete the bean with the explicit transaction.
|
int |
deleteManyToManyAssociations(Object ownerBean,
String propertyName)
Delete the associations (from the intersection table) of a ManyToMany given
the owner bean and the propertyName of the ManyToMany collection.
|
int |
deleteManyToManyAssociations(Object ownerBean,
String propertyName,
Transaction t)
Delete the associations (from the intersection table) of a ManyToMany given
the owner bean and the propertyName of the ManyToMany collection.
|
void |
deregister(BeanPersistController c) |
Map<String,ValuePair> |
diff(Object a,
Object b)
Return a map of the differences between two objects of the same type.
|
void |
endTransaction()
If the current transaction has already been committed do nothing otherwise
rollback the transaction.
|
int |
execute(CallableSql callSql)
Execute the CallableSql.
|
int |
execute(CallableSql callSql,
Transaction t)
Execute the CallableSql with an explicit transaction.
|
int |
execute(SqlUpdate updSql)
Execute the updateSql.
|
int |
execute(SqlUpdate updSql,
Transaction t)
Execute the updateSql with an explicit transaction.
|
<T> T |
execute(TxCallable<T> c)
Execute a TxCallable in a Transaction with the default scope.
|
void |
execute(TxRunnable r)
Execute a TxRunnable in a Transaction with the default scope.
|
<T> T |
execute(TxScope scope,
TxCallable<T> c)
Execute a TxCallable in a Transaction with an explicit scope.
|
void |
execute(TxScope scope,
TxRunnable r)
Execute a TxRunnable in a Transaction with an explicit scope.
|
int |
execute(Update<?> update)
Execute the orm update.
|
int |
execute(Update<?> update,
Transaction t)
Execute the updateSql with an explicit transaction.
|
void |
executePlugins(boolean online) |
void |
externalModification(String tableName,
boolean inserts,
boolean updates,
boolean deletes)
Developer informing eBean that tables where modified outside of eBean.
|
void |
externalModification(TransactionEventTable tableEvent)
Process committed beans from another framework or server in another
cluster.
|
<T> Filter<T> |
filter(Class<T> beanType)
Create a filter for filtering lists of entity beans.
|
<T> Query<T> |
find(Class<T> beanType)
Create a query for a type of entity bean (the same as
EbeanServer.createQuery(Class)). |
<T> T |
find(Class<T> beanType,
Object uid)
Find a bean using its unique id.
|
<T> T |
find(Class<T> beanType,
Object id,
Transaction t)
Find a bean using its unique id.
|
<T> FutureIds<T> |
findFutureIds(Query<T> query,
Transaction t)
Execute find Id's query in a background thread.
|
<T> FutureList<T> |
findFutureList(Query<T> query,
Transaction t)
Execute find list query in a background thread.
|
SqlFutureList |
findFutureList(SqlQuery query,
Transaction t)
Execute find list SQL query in a background thread.
|
<T> FutureRowCount<T> |
findFutureRowCount(Query<T> q,
Transaction t)
Execute find row count query in a background thread.
|
<T> List<Object> |
findIds(Query<T> query,
Transaction t)
Return the Id values of the query as a List.
|
<T> List<Object> |
findIdsWithCopy(Query<T> query,
Transaction t)
Execute the findId's query but without copying the query.
|
<T> QueryIterator<T> |
findIterate(Query<T> query,
Transaction t)
Return a QueryIterator for the query.
|
<T> List<T> |
findList(Query<T> query,
Transaction t)
Execute a query returning a list of beans.
|
List<SqlRow> |
findList(SqlQuery query,
Transaction t)
Execute the sql query returning a list of MapBean.
|
<T> Map<?,T> |
findMap(Query<T> query,
Transaction t)
Execute the query returning the entity beans in a Map.
|
Map<?,SqlRow> |
findMap(SqlQuery query,
Transaction t)
Execute the sql query returning a map of MapBean.
|
<T> PagingList<T> |
findPagingList(Query<T> query,
Transaction t,
int pageSize)
Find using a PagingList with explicit transaction and pageSize.
|
<T> int |
findRowCount(Query<T> query,
Transaction t)
Return the number of 'top level' or 'root' entities this query should
return.
|
<T> int |
findRowCountWithCopy(Query<T> query,
Transaction t)
Execute the findRowCount query but without copying the query.
|
<T> Set<T> |
findSet(Query<T> query,
Transaction t)
Execute the query returning a set of entity beans.
|
Set<SqlRow> |
findSet(SqlQuery query,
Transaction t)
Execute the sql query returning a set of MapBean.
|
<T> T |
findUnique(Query<T> query,
Transaction t)
Execute the query returning at most one entity bean.
|
SqlRow |
findUnique(SqlQuery query,
Transaction t)
Execute the sql query returning a single MapBean or null.
|
<T> void |
findVisit(Query<T> query,
QueryResultVisitor<T> visitor,
Transaction t)
Execute the query visiting the results.
|
AdminAutofetch |
getAdminAutofetch()
Return the AdminAutofetch which is used to control and configure the
Autofetch service at runtime.
|
AutoFetchManager |
getAutoFetchManager()
Return the AutoFetchListener.
|
BackgroundExecutor |
getBackgroundExecutor()
Return the BackgroundExecutor service for asynchronous processing of
queries.
|
<T> BeanDescriptor<T> |
getBeanDescriptor(Class<T> beanClass)
Return the BeanDescriptor for a given type of bean.
|
BeanDescriptor<?> |
getBeanDescriptorById(String descriptorId)
Return the BeanDescriptor using its unique id.
|
List<BeanDescriptor<?>> |
getBeanDescriptors()
Return all the BeanDescriptors.
|
List<BeanDescriptor<?>> |
getBeanDescriptors(String tableName)
Return the BeanDescriptor's for a given table name.
|
Object |
getBeanId(Object bean)
Return the value of the Id property for a given bean.
|
<T> BeanManager<T> |
getBeanManager(Class<T> beanClass) |
BeanState |
getBeanState(Object bean)
Return the BeanState for a given entity bean.
|
SpiTransaction |
getCurrentServerTransaction()
Returns the current transaction (or null) from the scope.
|
DatabasePlatform |
getDatabasePlatform()
Return the DatabasePlatform for this server.
|
DdlGenerator |
getDdlGenerator()
Return the DDL generator.
|
ExpressionFactory |
getExpressionFactory()
Return the ExpressionFactory for this server.
|
int |
getLazyLoadBatchSize()
Return the default batch size for lazy loading.
|
List<MetaBeanInfo> |
getMetaBeanInfoList() |
MetaInfoManager |
getMetaInfoManager()
Return the MetaInfoManager which is used to get meta data from the EbeanServer
such as query execution statistics.
|
String |
getName()
Return the server name.
|
AutoFetchManager |
getProfileListener()
Return the Profile Listener.
|
PstmtBatch |
getPstmtBatch()
Return a JDBC driver specific handler for batching.
|
CQueryEngine |
getQueryEngine()
Return the queryEngine for this server.
|
<T> T |
getReference(Class<T> type,
Object id)
Return a Reference bean.
|
RelationalQueryEngine |
getRelationalQueryEngine()
Return the Relational query engine.
|
ServerCacheManager |
getServerCacheManager()
Return the manager of the server cache ("L2" cache).
|
List<SpiEbeanPlugin> |
getSpiEbeanPlugins() |
void |
initialise()
Run any initialisation required before registering with the ClusterManager.
|
void |
insert(Object bean)
Force the bean to be saved with an explicit insert.
|
void |
insert(Object bean,
Transaction t)
Force the bean to be saved with an explicit insert.
|
boolean |
isCollectQueryOrigins() |
boolean |
isDefaultDeleteMissingChildren()
Return true if DeleteMissingChildren defaults to true for stateless
updates.
|
boolean |
isDefaultUpdateNullProperties()
Return true if UpdateNullProperties defaults to true for stateless updates.
|
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.
|
protected void |
loadAndInitializePlugins(InternalConfiguration config) |
void |
loadBean(EntityBeanIntercept ebi)
Invoke the lazy loading for this bean.
|
void |
loadBean(LoadBeanRequest loadRequest)
Load a batch of Associated One Beans.
|
void |
loadMany(BeanCollection<?> bc,
boolean onlyIds)
Invoke the lazy loading for this bean collection.
|
void |
loadMany(LoadManyRequest loadRequest)
Lazy load a batch of Many's.
|
Object |
nextId(Class<?> beanType)
return the next unique identity value.
|
void |
refresh(Object bean)
Refresh the values of a bean.
|
void |
refreshMany(Object parentBean,
String propertyName)
Refresh a many property of an entity bean.
|
void |
refreshMany(Object parentBean,
String propertyName,
Transaction t) |
void |
register(BeanPersistController c) |
void |
registerMBeans(MBeanServer mbeanServer,
int uniqueServerId) |
void |
remoteTransactionEvent(RemoteTransactionEvent event)
Another server in the cluster sent this event so that we can inform local
BeanListeners of inserts updates and deletes that occurred remotely (on
another server in the cluster).
|
void |
rollbackTransaction()
Rollback the current transaction.
|
void |
runCacheWarming()
Run the cache warming queries on all beans that have them defined.
|
void |
runCacheWarming(Class<?> beanType)
Run the cache warming query for a specific bean type.
|
int |
save(Collection<?> c)
Perform an update or insert on each bean in the collection.
|
int |
save(Iterator<?> it)
Perform an update or insert on each bean in the iterator.
|
int |
save(Iterator<?> it,
Transaction t)
Save all beans in the iterator with an explicit transaction.
|
void |
save(Object bean)
Persist the bean by either performing an insert or update.
|
void |
save(Object bean,
Transaction t)
Save the bean with an explicit transaction.
|
void |
saveAssociation(Object ownerBean,
String propertyName)
Save the associated collection or bean given the property name.
|
void |
saveAssociation(Object ownerBean,
String propertyName,
Transaction t)
Save the associated collection or bean given the property name with a
specific transaction.
|
void |
saveManyToManyAssociations(Object ownerBean,
String propertyName)
Save the associations of a ManyToMany given the owner bean and the
propertyName of the ManyToMany collection.
|
void |
saveManyToManyAssociations(Object ownerBean,
String propertyName,
Transaction t)
Save the associations of a ManyToMany given the owner bean and the
propertyName of the ManyToMany collection.
|
void |
shutdown(boolean shutdownDataSource,
boolean deregisterDriver)
Shutting down manually.
|
void |
shutdownManaged()
Shutting down via JVM Shutdown hook.
|
<T> void |
sort(List<T> list,
String sortByClause)
Sort the list using the sortByClause.
|
void |
start()
Start any services after registering with the ClusterManager.
|
void |
update(Object bean)
Force an update using the bean updating non-null properties.
|
void |
update(Object bean,
Set<String> updateProps)
Force an update using the bean explicitly stating which properties to
include in the update.
|
void |
update(Object bean,
Set<String> updateProps,
Transaction t)
Force an update using the bean explicitly stating which properties to
include in the update.
|
void |
update(Object bean,
Set<String> updateProps,
Transaction t,
boolean deleteMissingChildren,
boolean updateNullProperties)
Force an update using the bean explicitly stating which properties to
include in the update.
|
void |
update(Object bean,
Transaction t)
Force an update using the bean updating non-null properties.
|
protected final ConcurrentHashMap<ObjectGraphNode,CObjectGraphNodeStatistics> objectGraphStats
public DefaultServer(InternalConfiguration config, ServerCacheManager cache)
protected void loadAndInitializePlugins(InternalConfiguration config)
public List<SpiEbeanPlugin> getSpiEbeanPlugins()
public void executePlugins(boolean online)
public boolean isCollectQueryOrigins()
isCollectQueryOrigins in interface SpiEbeanServerpublic boolean isDefaultDeleteMissingChildren()
SpiEbeanServerisDefaultDeleteMissingChildren in interface SpiEbeanServerpublic boolean isDefaultUpdateNullProperties()
SpiEbeanServerisDefaultUpdateNullProperties in interface SpiEbeanServerpublic int getLazyLoadBatchSize()
SpiEbeanServergetLazyLoadBatchSize in interface SpiEbeanServerpublic PstmtBatch getPstmtBatch()
SpiEbeanServerRequired for Oracle specific batch handling.
getPstmtBatch in interface SpiEbeanServerpublic DatabasePlatform getDatabasePlatform()
SpiEbeanServergetDatabasePlatform in interface SpiEbeanServerpublic MetaInfoManager getMetaInfoManager()
EbeanServergetMetaInfoManager in interface EbeanServerpublic BackgroundExecutor getBackgroundExecutor()
EbeanServergetBackgroundExecutor in interface EbeanServerpublic ExpressionFactory getExpressionFactory()
EbeanServergetExpressionFactory in interface EbeanServerpublic DdlGenerator getDdlGenerator()
SpiEbeanServergetDdlGenerator in interface SpiEbeanServerpublic AdminAutofetch getAdminAutofetch()
EbeanServergetAdminAutofetch in interface EbeanServerpublic AutoFetchManager getAutoFetchManager()
SpiEbeanServergetAutoFetchManager in interface SpiEbeanServerpublic void initialise()
public void start()
public void registerMBeans(MBeanServer mbeanServer, int uniqueServerId)
public void shutdownManaged()
shutdownManaged in interface SpiEbeanServerpublic void shutdown(boolean shutdownDataSource,
boolean deregisterDriver)
shutdown in interface EbeanServershutdownDataSource - if true then shutdown the underlying DataSource if it is the EbeanORM
DataSource implementation.deregisterDriver - if true then deregister the JDBC driver if it is the EbeanORM
DataSource implementation.public String getName()
getName in interface BeanCollectionLoadergetName in interface BeanLoadergetName in interface EbeanServerpublic BeanState getBeanState(Object bean)
EbeanServerThis will return null if the bean is not an enhanced (or subclassed) entity bean.
getBeanState in interface EbeanServerpublic void runCacheWarming()
runCacheWarming in interface EbeanServerpublic void runCacheWarming(Class<?> beanType)
EbeanServer
A cache warming query can be defined via CacheStrategy.
runCacheWarming in interface EbeanServerpublic <T> CQuery<T> compileQuery(Query<T> query, Transaction t)
compileQuery in interface SpiEbeanServerpublic CQueryEngine getQueryEngine()
SpiEbeanServergetQueryEngine in interface SpiEbeanServerpublic ServerCacheManager getServerCacheManager()
EbeanServergetServerCacheManager in interface EbeanServerpublic AutoFetchManager getProfileListener()
public RelationalQueryEngine getRelationalQueryEngine()
public void refreshMany(Object parentBean, String propertyName, Transaction t)
public void refreshMany(Object parentBean, String propertyName)
EbeanServerrefreshMany in interface EbeanServerparentBean - the entity bean containing the 'many' propertypropertyName - the 'many' property to be refreshedEbean.refreshMany(Object, String)public void loadMany(LoadManyRequest loadRequest)
SpiEbeanServerloadMany in interface SpiEbeanServerpublic void loadMany(BeanCollection<?> bc, boolean onlyIds)
BeanCollectionLoaderloadMany in interface BeanCollectionLoaderpublic void refresh(Object bean)
EbeanServerNote that this does not refresh any OneToMany or ManyToMany properties.
refresh in interface EbeanServerEbean.refresh(Object)public void loadBean(LoadBeanRequest loadRequest)
SpiEbeanServerloadBean in interface SpiEbeanServerpublic void loadBean(EntityBeanIntercept ebi)
BeanLoaderloadBean in interface BeanLoaderpublic Map<String,ValuePair> diff(Object a, Object b)
EbeanServerWhen null is passed in for b, then the 'OldValues' of a is used for the difference comparison.
diff in interface EbeanServerpublic void externalModification(TransactionEventTable tableEvent)
This notifies this instance of the framework that beans have been committed externally to it. Either by another framework or clustered server. It needs to maintain its cache and text indexes appropriately.
externalModification in interface SpiEbeanServerpublic void externalModification(String tableName, boolean inserts, boolean updates, boolean deletes)
externalModification in interface EbeanServerEbean.externalModification(String, boolean, boolean, boolean)public void clearQueryStatistics()
clearQueryStatistics in interface SpiEbeanServerpublic <T> T createEntityBean(Class<T> type)
This will generally return a subclass of the parameter 'type' which additionally implements the EntityBean interface. That is, the returned bean is typically an instance of a dynamically generated class.
createEntityBean in interface EbeanServerpublic <T> T getReference(Class<T> type, Object id)
If a current transaction is active then this will check the Context of that transaction to see if the bean is already loaded. If it is already loaded then it will returned that object.
getReference in interface EbeanServerEbean.getReference(Class, Object)public Transaction createTransaction()
createTransaction in interface EbeanServerpublic Transaction createTransaction(TxIsolation isolation)
Note that this transaction is not stored in a thread local.
createTransaction in interface EbeanServerpublic <T> T execute(TxCallable<T> c)
EbeanServerThe default scope runs with REQUIRED and by default will rollback on any exception (checked or runtime).
execute in interface EbeanServerpublic <T> T execute(TxScope scope, TxCallable<T> c)
EbeanServerThe scope can control the transaction type, isolation and rollback semantics.
execute in interface EbeanServerpublic void execute(TxRunnable r)
EbeanServerThe default scope runs with REQUIRED and by default will rollback on any exception (checked or runtime).
execute in interface EbeanServerpublic void execute(TxScope scope, TxRunnable r)
EbeanServerThe scope can control the transaction type, isolation and rollback semantics.
execute in interface EbeanServerpublic ScopeTrans createScopeTrans(TxScope txScope)
SpiEbeanServercreateScopeTrans in interface SpiEbeanServerpublic SpiTransaction getCurrentServerTransaction()
getCurrentServerTransaction in interface SpiEbeanServerpublic Transaction beginTransaction()
Note that the transaction is stored in a ThreadLocal variable.
beginTransaction in interface EbeanServerEbean.beginTransaction()public Transaction beginTransaction(TxIsolation isolation)
Note that the transaction is stored in a ThreadLocal variable.
beginTransaction in interface EbeanServerpublic Transaction currentTransaction()
currentTransaction in interface EbeanServerpublic void commitTransaction()
commitTransaction in interface EbeanServerEbean.commitTransaction()public void rollbackTransaction()
rollbackTransaction in interface EbeanServerEbean.rollbackTransaction()public void endTransaction()
Useful to put in a finally block to ensure the transaction is ended, rather than a rollbackTransaction() in each catch block.
Code example:
<code>
Ebean.startTransaction();
try {
// do some fetching and or persisting
// commit at the end
Ebean.commitTransaction();
} finally {
// if commit didn't occur then rollback the transaction
Ebean.endTransaction();
}
</code>
endTransaction in interface EbeanServerEbean.endTransaction()public Object nextId(Class<?> beanType)
Uses the BeanDescriptor deployment information to determine the sequence to use.
nextId in interface EbeanServerpublic <T> void sort(List<T> list, String sortByClause)
EbeanServersort in interface EbeanServerlist - the list of entity beanssortByClause - the properties to sort the list byEbean.sort(List, String)public <T> Query<T> createQuery(Class<T> beanType) throws javax.persistence.PersistenceException
EbeanServerEbean.createQuery(Class)
).createQuery in interface EbeanServerjavax.persistence.PersistenceExceptionEbean.createQuery(Class)public <T> Query<T> createNamedQuery(Class<T> beanType, String namedQuery) throws javax.persistence.PersistenceException
EbeanServerEbean.createQuery(Class, String))
The query statement will be defined in a deployment orm xml file.
createNamedQuery in interface EbeanServerjavax.persistence.PersistenceExceptionEbean.createQuery(Class, String)public <T> Filter<T> filter(Class<T> beanType)
EbeanServerfilter in interface EbeanServerpublic <T> CsvReader<T> createCsvReader(Class<T> beanType)
EbeanServercreateCsvReader in interface EbeanServerpublic <T> Query<T> find(Class<T> beanType)
EbeanServerEbeanServer.createQuery(Class)).find in interface EbeanServerpublic <T> Query<T> createQuery(Class<T> beanType, String query)
EbeanServerNote that you are allowed to add additional clauses using where() as well as use fetch() and setOrderBy() after the query has been created.
Note that this method signature used to map to named queries and that has
moved to EbeanServer.createNamedQuery(Class, String).
EbeanServer ebeanServer = ... ;
String q = "find order fetch details where status = :st";
List<Order> newOrders
= ebeanServer.createQuery(Order.class, q)
.setParameter("st", Order.Status.NEW)
.findList();
createQuery in interface EbeanServerquery - the object querypublic <T> Update<T> createNamedUpdate(Class<T> beanType, String namedUpdate)
EbeanServerEbean.createNamedUpdate(Class, String)).createNamedUpdate in interface EbeanServerpublic <T> Update<T> createUpdate(Class<T> beanType, String ormUpdate)
EbeanServercreateUpdate in interface EbeanServerpublic SqlQuery createSqlQuery(String sql)
EbeanServerEbean.createSqlQuery(String)).createSqlQuery in interface EbeanServerEbean.createSqlQuery(String)public SqlQuery createNamedSqlQuery(String namedQuery)
EbeanServerEbean.createNamedSqlQuery(String)
).
The query statement will be defined in a deployment orm xml file.
createNamedSqlQuery in interface EbeanServerEbean.createNamedSqlQuery(String)public SqlUpdate createSqlUpdate(String sql)
EbeanServerEbean.createSqlUpdate(String)).createSqlUpdate in interface EbeanServerEbean.createSqlUpdate(String)public CallableSql createCallableSql(String sql)
EbeanServercreateCallableSql in interface EbeanServerpublic SqlUpdate createNamedSqlUpdate(String namedQuery)
EbeanServerEbean.createNamedSqlUpdate(String)
).
The statement (an Insert Update or Delete statement) will be defined in a deployment orm xml file.
createNamedSqlUpdate in interface EbeanServerEbean.createNamedSqlUpdate(String)public <T> T find(Class<T> beanType, Object uid)
EbeanServerfind in interface EbeanServerEbean.find(Class, Object)public <T> T find(Class<T> beanType, Object id, Transaction t)
find in interface EbeanServerT - the type of entity bean to findbeanType - the type of entity bean to findid - the bean id valuet - the transaction to use (can be null)public <T> SpiOrmQueryRequest<T> createQueryRequest(BeanDescriptor<T> desc, SpiQuery<T> query, Transaction t)
SpiEbeanServercreateQueryRequest in interface SpiEbeanServerpublic <T> T findUnique(Query<T> query, Transaction t)
EbeanServer
Generally you are able to use Query.findUnique() rather than
explicitly calling this method. You could use this method if you wish to
explicitly control the transaction used for the query.
findUnique in interface EbeanServerT - the type of entity bean to fetch.query - the query to execute.t - the transaction to use (can be null).Query.findUnique()public <T> Set<T> findSet(Query<T> query, Transaction t)
EbeanServer
Generally you are able to use Query.findSet() rather than
explicitly calling this method. You could use this method if you wish to
explicitly control the transaction used for the query.
findSet in interface EbeanServerT - the type of entity bean to fetch.query - the query to executet - the transaction to use (can be null).Query.findSet()public <T> Map<?,T> findMap(Query<T> query, Transaction t)
EbeanServer
Generally you are able to use Query.findMap() rather than
explicitly calling this method. You could use this method if you wish to
explicitly control the transaction used for the query.
findMap in interface EbeanServerT - the type of entity bean to fetch.query - the query to execute.t - the transaction to use (can be null).Query.findMap()public <T> int findRowCount(Query<T> query, Transaction t)
EbeanServerfindRowCount in interface EbeanServerpublic <T> int findRowCountWithCopy(Query<T> query, Transaction t)
SpiEbeanServerfindRowCountWithCopy in interface SpiEbeanServerpublic <T> List<Object> findIds(Query<T> query, Transaction t)
EbeanServerfindIds in interface EbeanServerpublic <T> List<Object> findIdsWithCopy(Query<T> query, Transaction t)
SpiEbeanServerUsed 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).
findIdsWithCopy in interface SpiEbeanServerpublic <T> FutureRowCount<T> findFutureRowCount(Query<T> q, Transaction t)
EbeanServerThis returns a Future object which can be used to cancel, check the execution status (isDone etc) and get the value (with or without a timeout).
findFutureRowCount in interface EbeanServerq - the query to execute the row count ont - the transaction (can be null).public <T> FutureIds<T> findFutureIds(Query<T> query, Transaction t)
EbeanServerThis returns a Future object which can be used to cancel, check the execution status (isDone etc) and get the value (with or without a timeout).
findFutureIds in interface EbeanServerquery - the query to execute the fetch Id's ont - the transaction (can be null).public <T> FutureList<T> findFutureList(Query<T> query, Transaction t)
EbeanServerThis returns a Future object which can be used to cancel, check the execution status (isDone etc) and get the value (with or without a timeout).
findFutureList in interface EbeanServerquery - the query to execute in the backgroundt - the transaction (can be null).public <T> PagingList<T> findPagingList(Query<T> query, Transaction t, int pageSize)
EbeanServerfindPagingList in interface EbeanServerpublic <T> void findVisit(Query<T> query, QueryResultVisitor<T> visitor, Transaction t)
EbeanServerfindVisit in interface EbeanServerpublic <T> QueryIterator<T> findIterate(Query<T> query, Transaction t)
EbeanServerfindIterate in interface EbeanServerpublic <T> List<T> findList(Query<T> query, Transaction t)
EbeanServer
Generally you are able to use Query.findList() rather than
explicitly calling this method. You could use this method if you wish to
explicitly control the transaction used for the query.
findList in interface EbeanServerT - the type of entity bean to fetch.query - the query to execute.t - the transaction to use (can be null).Query.findList()public SqlRow findUnique(SqlQuery query, Transaction t)
EbeanServerThis will throw a PersistenceException if the query found more than one result.
Generally you are able to use SqlQuery.findUnique() rather than
explicitly calling this method. You could use this method if you wish to
explicitly control the transaction used for the query.
findUnique in interface EbeanServerquery - the query to execute.t - the transaction to use (can be null).SqlQuery.findUnique()public SqlFutureList findFutureList(SqlQuery query, Transaction t)
EbeanServerThis returns a Future object which can be used to cancel, check the execution status (isDone etc) and get the value (with or without a timeout).
findFutureList in interface EbeanServerquery - the query to execute in the backgroundt - the transaction (can be null).public List<SqlRow> findList(SqlQuery query, Transaction t)
EbeanServer
Generally you are able to use SqlQuery.findList() rather than
explicitly calling this method. You could use this method if you wish to
explicitly control the transaction used for the query.
findList in interface EbeanServerquery - the query to execute.t - the transaction to use (can be null).SqlQuery.findList()public Set<SqlRow> findSet(SqlQuery query, Transaction t)
EbeanServer
Generally you are able to use SqlQuery.findSet() rather than
explicitly calling this method. You could use this method if you wish to
explicitly control the transaction used for the query.
findSet in interface EbeanServerquery - the query to execute.t - the transaction to use (can be null).SqlQuery.findSet()public Map<?,SqlRow> findMap(SqlQuery query, Transaction t)
EbeanServer
Generally you are able to use SqlQuery.findMap() rather than
explicitly calling this method. You could use this method if you wish to
explicitly control the transaction used for the query.
findMap in interface EbeanServerquery - the query to execute.t - the transaction to use (can be null).SqlQuery.findMap()public void save(Object bean)
save in interface EbeanServerEbean.save(Object)public void save(Object bean, Transaction t)
save in interface EbeanServerpublic void update(Object bean)
update in interface EbeanServerpublic void update(Object bean, Set<String> updateProps)
update in interface EbeanServerpublic void update(Object bean, Transaction t)
update in interface EbeanServerpublic void update(Object bean, Set<String> updateProps, Transaction t)
update in interface EbeanServerpublic void update(Object bean, Set<String> updateProps, Transaction t, boolean deleteMissingChildren, boolean updateNullProperties)
update in interface EbeanServerbean - the bean to updateupdateProps - optionally you can specify the properties to update (can be null).t - optionally you can specify the transaction to use (can be null).deleteMissingChildren - specify false if you do not want 'missing children' of a OneToMany
or ManyToMany to be automatically deleted.updateNullProperties - specify true if by default you want properties with null values to
be included in the update and false if those properties should be
treated as 'unloaded' and excluded from the update. This only
takes effect if the updateProps is null.public void insert(Object bean)
Typically you would use save() and let Ebean determine if the bean should be inserted or updated. This can be useful when you are transferring data between databases and want to explicitly insert a bean into a different database that it came from.
insert in interface EbeanServerpublic void insert(Object bean, Transaction t)
Typically you would use save() and let Ebean determine if the bean should be inserted or updated. This can be useful when you are transferring data between databases and want to explicitly insert a bean into a different database that it came from.
insert in interface EbeanServerpublic int deleteManyToManyAssociations(Object ownerBean, String propertyName)
This returns the number of associations deleted.
deleteManyToManyAssociations in interface EbeanServerpublic int deleteManyToManyAssociations(Object ownerBean, String propertyName, Transaction t)
This returns the number of associations deleted.
deleteManyToManyAssociations in interface EbeanServerpublic void saveManyToManyAssociations(Object ownerBean, String propertyName)
saveManyToManyAssociations in interface EbeanServerpublic void saveManyToManyAssociations(Object ownerBean, String propertyName, Transaction t)
saveManyToManyAssociations in interface EbeanServerpublic void saveAssociation(Object ownerBean, String propertyName)
EbeanServerThis is similar to performing a save cascade on a specific property manually.
Note that you can turn on/off cascading for a transaction via
Transaction.setPersistCascade(boolean)
saveAssociation in interface EbeanServerownerBean - the bean instance holding the property we want to savepropertyName - the property we want to savepublic void saveAssociation(Object ownerBean, String propertyName, Transaction t)
EbeanServerThis is similar to performing a save cascade on a specific property manually.
Note that you can turn on/off cascading for a transaction via
Transaction.setPersistCascade(boolean)
saveAssociation in interface EbeanServerownerBean - the bean instance holding the property we want to savepropertyName - the property we want to savepublic int save(Iterator<?> it)
save in interface EbeanServerpublic int save(Collection<?> c)
save in interface EbeanServerpublic int save(Iterator<?> it, Transaction t)
save in interface EbeanServerpublic int delete(Class<?> beanType, Object id)
EbeanServerdelete in interface EbeanServerpublic int delete(Class<?> beanType, Object id, Transaction t)
EbeanServerdelete in interface EbeanServerpublic void delete(Class<?> beanType, Collection<?> ids)
EbeanServerdelete in interface EbeanServerpublic void delete(Class<?> beanType, Collection<?> ids, Transaction t)
EbeanServerdelete in interface EbeanServerpublic void delete(Object bean)
delete in interface EbeanServerEbean.delete(Object)public void delete(Object bean, Transaction t)
delete in interface EbeanServerpublic int delete(Iterator<?> it)
delete in interface EbeanServerpublic int delete(Collection<?> c)
delete in interface EbeanServerpublic int delete(Iterator<?> it, Transaction t)
delete in interface EbeanServerpublic int execute(CallableSql callSql, Transaction t)
execute in interface EbeanServerpublic int execute(CallableSql callSql)
execute in interface EbeanServerEbean.execute(CallableSql)public int execute(SqlUpdate updSql, Transaction t)
execute in interface EbeanServerpublic int execute(SqlUpdate updSql)
execute in interface EbeanServerEbean.execute(SqlUpdate)public int execute(Update<?> update, Transaction t)
execute in interface EbeanServerpublic int execute(Update<?> update)
execute in interface EbeanServerpublic <T> BeanManager<T> getBeanManager(Class<T> beanClass)
public List<BeanDescriptor<?>> getBeanDescriptors()
getBeanDescriptors in interface SpiEbeanServerpublic List<MetaBeanInfo> getMetaBeanInfoList()
public void register(BeanPersistController c)
public void deregister(BeanPersistController c)
public boolean isSupportedType(Type genericType)
SpiEbeanServerisSupportedType in interface SpiEbeanServerpublic Object getBeanId(Object bean)
EbeanServergetBeanId in interface EbeanServerpublic <T> BeanDescriptor<T> getBeanDescriptor(Class<T> beanClass)
getBeanDescriptor in interface SpiEbeanServerpublic List<BeanDescriptor<?>> getBeanDescriptors(String tableName)
getBeanDescriptors in interface SpiEbeanServerpublic BeanDescriptor<?> getBeanDescriptorById(String descriptorId)
getBeanDescriptorById in interface SpiEbeanServerpublic void remoteTransactionEvent(RemoteTransactionEvent event)
remoteTransactionEvent in interface SpiEbeanServerpublic SpiTransaction createServerTransaction(boolean isExplicit, int isolationLevel)
SpiEbeanServerTo specify to use the default transaction isolation use a value of -1.
createServerTransaction in interface SpiEbeanServerpublic SpiTransaction createQueryTransaction()
SpiEbeanServercreateQueryTransaction in interface SpiEbeanServerpublic CallStack createCallStack()
This trims off the avaje ebean part of the stack trace so that the first element in the CallStack should be application code.
createCallStack in interface SpiEbeanServerpublic JsonContext createJsonContext()
EbeanServercreateJsonContext in interface EbeanServerpublic void collectQueryStats(ObjectGraphNode node, long loadedBeanCount, long timeMicros)
SpiEbeanServercollectQueryStats in interface SpiEbeanServerCopyright © 2014. All Rights Reserved.