java.lang.Object
io.ebeaninternal.server.query.CQuery<T>
- All Implemented Interfaces:
CancelableQuery,SpiProfileTransactionEvent,DbReadContext
public final class CQuery<T>
extends Object
implements DbReadContext, CancelableQuery, SpiProfileTransactionEvent
An object that represents a SqlSelect statement.
The SqlSelect is based on a tree (Object Graph). The tree is traversed to see what parts are included in the tree according to the value of find.getInclude();
The tree structure is flattened into a SqlSelectChain. The SqlSelectChain is the key object used in reading the flat resultSet back into Objects.
-
Constructor Summary
ConstructorsConstructorDescriptionCQuery(OrmQueryRequest<T> request, CQueryPredicates predicates, CQueryPlan queryPlan) Create the Sql select based on the request. -
Method Summary
Modifier and TypeMethodDescriptionbindLog()voidcancel()voidclose()Close the resources.Return the DataReader.Return the generated sql.voidhandleLoadError(String fullName, Exception e) Handles a load error on given property.booleanincludeSecondary(BeanPropertyAssocMany<?> many) Return true if this many property should be included in unmodifiable query via a secondary query.booleanShould we create profileNodes for beans created in this query.booleanReturn true if this request disables lazy loading.booleanReturn true if the beans that already exist in the persistence context should have data from the database loaded into them.booleanisRawSql()Return true if this is a raw sql query as opposed to Ebean generated sql.Return the persistence context.voidprofile()Add the event information to the profiling transaction.voidprofileBean(EntityBeanIntercept ebi, String prefix) Add AutoTune profiling for a loaded entity bean.Return the query mode.voidregister(BeanPropertyAssocMany<?> many, BeanCollection<?> bc) Register a collection for lazy loading.voidregister(String path, EntityBeanIntercept ebi) Register a reference for lazy loading.voidregisterBeanInherit(BeanPropertyAssocOne<?> property, EntityBeanIntercept ebi) Register a reference with inheritance for lazy loading.voidsetCurrentPrefix(String currentPrefix, Map<String, String> currentPathMap) Set the JoinNode - used by proxy/reference beans for profiling.voidsetLazyLoadedChildBean(EntityBean bean, Object lazyLoadParentId) Set back the bean that has just been loaded with its id.booleanReturn true if we are loading unmodifiable beans.
-
Constructor Details
-
CQuery
Create the Sql select based on the request.
-
-
Method Details
-
isLoadContextBean
public boolean isLoadContextBean()Description copied from interface:DbReadContextReturn true if the beans that already exist in the persistence context should have data from the database loaded into them.This is the case for REFRESH and forUpdate queries.
- Specified by:
isLoadContextBeanin interfaceDbReadContext
-
isDisableLazyLoading
public boolean isDisableLazyLoading()Description copied from interface:DbReadContextReturn true if this request disables lazy loading.- Specified by:
isDisableLazyLoadingin interfaceDbReadContext
-
unmodifiable
public boolean unmodifiable()Description copied from interface:DbReadContextReturn true if we are loading unmodifiable beans.- Specified by:
unmodifiablein interfaceDbReadContext
-
dataReader
Description copied from interface:DbReadContextReturn the DataReader.- Specified by:
dataReaderin interfaceDbReadContext
-
queryMode
Description copied from interface:DbReadContextReturn the query mode.- Specified by:
queryModein interfaceDbReadContext
-
predicates
-
cancel
public void cancel()- Specified by:
cancelin interfaceCancelableQuery
-
close
public void close()Close the resources.The JDBC resultSet and statement need to be closed. Its important that this method is called.
-
persistenceContext
Return the persistence context.- Specified by:
persistenceContextin interfaceDbReadContext
-
setLazyLoadedChildBean
Description copied from interface:DbReadContextSet back the bean that has just been loaded with its id.- Specified by:
setLazyLoadedChildBeanin interfaceDbReadContext
-
profile
public void profile()Description copied from interface:SpiProfileTransactionEventAdd the event information to the profiling transaction.- Specified by:
profilein interfaceSpiProfileTransactionEvent
-
registerBeanInherit
Description copied from interface:DbReadContextRegister a reference with inheritance for lazy loading.- Specified by:
registerBeanInheritin interfaceDbReadContext
-
register
Description copied from interface:DbReadContextRegister a reference for lazy loading.- Specified by:
registerin interfaceDbReadContext
-
register
Description copied from interface:DbReadContextRegister a collection for lazy loading.- Specified by:
registerin interfaceDbReadContext
-
includeSecondary
Description copied from interface:DbReadContextReturn true if this many property should be included in unmodifiable query via a secondary query.- Specified by:
includeSecondaryin interfaceDbReadContext
-
isRawSql
public boolean isRawSql()Return true if this is a raw sql query as opposed to Ebean generated sql.- Specified by:
isRawSqlin interfaceDbReadContext
-
bindLog
-
transaction
-
generatedSql
Return the generated sql. -
isAutoTuneProfiling
public boolean isAutoTuneProfiling()Should we create profileNodes for beans created in this query.This is true for all queries except lazy load bean queries.
- Specified by:
isAutoTuneProfilingin interfaceDbReadContext
-
profileBean
Description copied from interface:DbReadContextAdd AutoTune profiling for a loaded entity bean.- Specified by:
profileBeanin interfaceDbReadContext
-
setCurrentPrefix
Description copied from interface:DbReadContextSet the JoinNode - used by proxy/reference beans for profiling.- Specified by:
setCurrentPrefixin interfaceDbReadContext
-
handleLoadError
Description copied from interface:DbReadContextHandles a load error on given property.- Specified by:
handleLoadErrorin interfaceDbReadContext
-
dependentTables
-