Package io.ebeaninternal.server.core
Interface SpiOrmQueryRequest<T>
-
- All Superinterfaces:
BeanQueryRequest<T>
,DocQueryRequest<T>
- All Known Implementing Classes:
OrmQueryRequest
public interface SpiOrmQueryRequest<T> extends BeanQueryRequest<T>, DocQueryRequest<T>
Defines the ORM query request api.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
delete()
Execute the query as a delete.void
endTransIfRequired()
Will end a locally created transaction.String
escapeLikeString(String value)
Escapes a string to use it as exact match in Like clause.int
findCount()
Execute the find row count query.void
findEach(Consumer<T> consumer)
Execute the find returning a QueryIterator and visitor pattern.void
findEachWhile(Predicate<T> consumer)
Execute the find returning a QueryIterator and visitor pattern.Object
findId()
Execute the query as findById.<A> List<A>
findIds()
Execute the find ids query.QueryIterator<T>
findIterate()
Execute the find returning a QueryIterator.List<T>
findList()
Execute the query as findList.<K> Map<K,T>
findMap()
Execute the query as findMap.SpiResultSet
findResultSet()
Execute returning the ResultSet.Set<T>
findSet()
Execute the query as findSet.<A> List<A>
findSingleAttributeList()
Execute the findSingleAttributeList query.List<Version<T>>
findVersions()
Execute the finVersions() query.List<T>
getBeanCacheHits()
Return the bean cache hits (when all hits / no misses).<K> Map<K,T>
getBeanCacheHitsAsMap()
Return the bean cache hits for findMap (when all hits / no misses).BeanDescriptor<T>
getBeanDescriptor()
Return the associated BeanDescriptor.String
getDBLikeClause(boolean rawLikeExpression)
Return the Database platform like clause.boolean
getFromBeanCache()
Maybe hit the bean cache returning true if everything was obtained from the cache (that there were no misses).<A> A
getFromQueryCache()
Try to get the query result from the query cache.SpiQuery<T>
getQuery()
Return the query.void
initTransIfRequired()
This will create a local (readOnly) transaction if no current transaction exists.boolean
isDeleteByStatement()
Return true if delete by statement is allowed for this type given cascade rules etc.boolean
isUseDocStore()
Return true if this query is expected to use the doc store.void
markNotQueryOnly()
Mark the underlying transaction as not being query only.void
prepareQuery()
Prepare the query for execution.void
resetBeanCacheAutoMode(boolean findOne)
Reset Bean cache mode AUTO - require explicit setting for bean cache use with findList().void
setIterateSingleContext()
Set when we want to use a single persistence context for all beans returned in the query (so all beans are held in memory)int
update()
Execute the query as a update.-
Methods inherited from interface io.ebean.event.BeanQueryRequest
getEbeanServer, getTransaction, isMultiValueIdSupported, isMultiValueSupported, isPadInExpression
-
Methods inherited from interface io.ebeanservice.docstore.api.DocQueryRequest
createJsonReadOptions, executeSecondaryQueries, getTransaction, setTransaction
-
-
-
-
Method Detail
-
getQuery
SpiQuery<T> getQuery()
Return the query.- Specified by:
getQuery
in interfaceBeanQueryRequest<T>
- Specified by:
getQuery
in interfaceDocQueryRequest<T>
-
getBeanDescriptor
BeanDescriptor<T> getBeanDescriptor()
Return the associated BeanDescriptor.
-
prepareQuery
void prepareQuery()
Prepare the query for execution.
-
initTransIfRequired
void initTransIfRequired()
This will create a local (readOnly) transaction if no current transaction exists.A transaction may have been passed in explicitly or currently be active in the thread local. If not, then a readOnly transaction is created to execute this query.
-
endTransIfRequired
void endTransIfRequired()
Will end a locally created transaction.It ends the transaction by using a rollback() as the transaction is known to be readOnly.
-
delete
int delete()
Execute the query as a delete.
-
update
int update()
Execute the query as a update.
-
findCount
int findCount()
Execute the find row count query.
-
findEach
void findEach(Consumer<T> consumer)
Execute the find returning a QueryIterator and visitor pattern.
-
findEachWhile
void findEachWhile(Predicate<T> consumer)
Execute the find returning a QueryIterator and visitor pattern.
-
findIterate
QueryIterator<T> findIterate()
Execute the find returning a QueryIterator.
-
findVersions
List<Version<T>> findVersions()
Execute the finVersions() query.
-
findSingleAttributeList
<A> List<A> findSingleAttributeList()
Execute the findSingleAttributeList query.
-
findResultSet
SpiResultSet findResultSet()
Execute returning the ResultSet.
-
getFromQueryCache
<A> A getFromQueryCache()
Try to get the query result from the query cache.
-
getFromBeanCache
boolean getFromBeanCache()
Maybe hit the bean cache returning true if everything was obtained from the cache (that there were no misses). Do this for findList() on many natural keys or many Ids.
-
getBeanCacheHits
List<T> getBeanCacheHits()
Return the bean cache hits (when all hits / no misses).
-
getBeanCacheHitsAsMap
<K> Map<K,T> getBeanCacheHitsAsMap()
Return the bean cache hits for findMap (when all hits / no misses).
-
resetBeanCacheAutoMode
void resetBeanCacheAutoMode(boolean findOne)
Reset Bean cache mode AUTO - require explicit setting for bean cache use with findList().
-
getDBLikeClause
String getDBLikeClause(boolean rawLikeExpression)
Return the Database platform like clause.
-
escapeLikeString
String escapeLikeString(String value)
Escapes a string to use it as exact match in Like clause.
-
markNotQueryOnly
void markNotQueryOnly()
Mark the underlying transaction as not being query only.
-
isUseDocStore
boolean isUseDocStore()
Return true if this query is expected to use the doc store.
-
isDeleteByStatement
boolean isDeleteByStatement()
Return true if delete by statement is allowed for this type given cascade rules etc.
-
setIterateSingleContext
void setIterateSingleContext()
Set when we want to use a single persistence context for all beans returned in the query (so all beans are held in memory)
-
-