- All Implemented Interfaces:
CancelableQuery,Query<T>,QueryBuilder<Query<T>,,T> QueryBuilderProjection<Query<T>,,T> SpiCancelableQuery,SpiQuery<T>,SpiQueryFetch,TxnProfileEventCodes
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.ebean.Query
Query.LockType, Query.LockWait, Query.Property<T>Nested classes/interfaces inherited from interface io.ebeaninternal.api.SpiQuery
SpiQuery.Mode, SpiQuery.TemporalMode, SpiQuery.Type -
Field Summary
Fields inherited from class io.ebeaninternal.server.querydefn.AbstractQuery
useMasterFields inherited from interface io.ebeaninternal.api.TxnProfileEventCodes
EVT_CALLABLESQL, EVT_COMMIT, EVT_DELETE, EVT_DELETE_PERMANENT, EVT_DELETE_SOFT, EVT_INSERT, EVT_ORMUPDATE, EVT_ROLLBACK, EVT_UPDATE, EVT_UPDATESQL, FIND_ATTRIBUTE, FIND_ATTRIBUTE_SET, FIND_COUNT, FIND_DELETE, FIND_EXISTS, FIND_ID_LIST, FIND_ITERATE, FIND_MANY, FIND_MANY_LAZY, FIND_ONE, FIND_ONE_LAZY, FIND_SUBQUERY, FIND_UPDATE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultOrmQuery(BeanDescriptor<T> desc, SpiEbeanServer server, ExpressionFactory expressionFactory) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddNested(String name, OrmQueryDetail nestedDetail, FetchConfig config) Add a nested fetch graph.final voidaddSoftDeletePredicate(String softDeletePredicate) final Stringalias()Return root table alias set byQueryBuilder.alias(String)command.alsoIf(BooleanSupplier predicate, Consumer<Query<T>> consumer) final <D> DtoQuery<D> final UpdateQuery<T> asUpdate()final StringReturn the base table to use if user defined on the query.final CacheModeReturn the cache mode for using the bean cache (Get and Put).final BindParamsReturn the bind parameters.final intReturn the hint for Statement.setFetchSize().final CacheIdLookup<T> Bean cache lookup for find by ids.final voidCheck that the named parameters have had their values set.final booleanReturn true if the query should have an order by appended automatically.final SpiQuerySecondaryConvert joins as necessary to query joins etc.copy()Return a copy of the query.copy(SpiEbeanServer server) Return a copy of the query attaching to a different EbeanServer.final CountDistinctOrderReturns the count distinct order setting.final SpiNamedParamcreateNamedParameter(String name) Create a named parameter placeholder.final intdelete()final intdelete(Transaction transaction) final BeanDescriptor<T> Return the bean descriptor for this query.final OrmQueryDetaildetail()Return the query detail.Return the distinct on clause.distinctOn(String distinctOn) final booleanexists()fetch(String path, FetchConfig joinConfig) fetch(String path, String properties, FetchConfig config) fetchCache(String path) fetchCache(String path, String properties) final voidfetchProperties(String path, OrmQueryProperties other) Set the fetch properties for the given path.final voidfetchProperties(String property, Set<String> columns, FetchConfig config) Specify the fetch properties for the given path.fetchQuery(String path) fetchQuery(String path, String properties) final ExpressionList<T> filterMany(String prop) final intfinal voidfinal voidfinal voidfindEachWhile(Predicate<T> consumer) final FutureRowCount<T> final FutureList<T> final <A> List<A> findIds()final QueryIterator<T> findList()findMap()final TfindOne()findSet()final <A> Afinal <A> List<A> final <A> Optional<A> final <A> Set<A> findVersionsBetween(Timestamp start, Timestamp end) final StringReturn root table alias with default option.final TimestampgetAsOf()Return the asOf Timestamp which the query should run as.final intReturn the table alias used for the base table.final ExpressionFactoryfinal intReturn the index of the first row to return in the query.final Query.LockTypefinal Query.LockWaitReturn the ForUpdate mode.final Stringfinal ObjectgetId()final intReturn the maximum number of rows to return in the query.Return the Order By clause or null if there is none defined.final StringReturn the origin key.final QueryTypefinal voidhandleLoadError(String fullName, Exception e) Handles load errors.final booleanReturns true if either firstRow or maxRows has been set.final ExpressionList<T> having()having(Expression expression) final SpiExpressionList<T> Can return null if no expressions where added to the having clause.final Stringhint()Return the SQL hint to include in the query.final voidIncrement the counter of tables used in 'As Of' query.final voidincrementAsOfTableCount(int increment) Increment the counter of tables used in 'As Of' query.Return the bind parameters ensuring it is initialised.final booleanReturn true if the base table is using history.final booleanReturn true if this is a 'As Of' query.final booleanReturn true if AutoTune should be attempted on this query.final BooleanReturn explicit AutoTune setting or null.final booleanfinal booleanReturn true if the query should GET against bean cache.final booleanReturn true if the query should PUT against the bean cache.final booleanfinal booleanReturn true if the query detail has neither select or joins specified.final booleanReturn true if lazy loading has been disabled on the query.final booleanreturn true if user specified to use SQL DISTINCT (effectively excludes id property).final booleanReturn true if this is a "find all" query.final booleanReturn true if this is a "find by id" query.final booleanReturn true if we must hit the DB (Cache reload or select for update).final booleanfinal booleanReturn true if this query includes soft deleted rows.final booleanReturn true if the Id property is manually included in the query (DTO queries).final booleanReturn true if this is a native sql query.final booleanisRawSql()Return true if this is a RawSql query.final BooleanReturn true if the beans returned by this query should be read only.final booleanReturn true if this is a single attribute query.final booleanReturn false when this is a lazy load or refresh query for a bean.booleanReturn true if this query should not use the read only data source.final booleanReturn true if this is a future query.final booleanReturn true if this is a find versions between query.final booleanisWithId()Return true if the query should include the Id property.final Stringlabel()Return the label set on the query.final intReturn the default lazy load batch size.final BeanPropertyAssocMany<?> Return the lazy loading 'many' property.final StringReturn the property that invoked lazy load.final StringReturn a more detailed description of the lazy or query load.final StringloadMode()Return the load mode (+lazy or +query).final TableJoinReturn the extra join for a M2M lazy load.final ManyWhereJoinsReturn the extra joins required to support the where clause for 'Many' properties.final StringmapKey()Return the property used to specify keys for a map.final SpiQuery.Modemode()Return the query mode.final StringReturn the unmodified native sql query (with named params etc).final NaturalKeyQueryData<T> Collect natural key data for this query or null if the query does not match the requirements of natural key lookup.final NaturalKeyBindParamReturn a Natural Key bind parameter if supported by this query.orderBy()orderById(boolean orderById) final booleanReturn true if there is no Order By clause.final ObjectGraphNodeUsed to hook back a lazy loading query to the original query (query point).final PersistenceContextReturn the TransactionContext.final PersistenceContextScopeReturn the PersistenceContextScope that this query should use.final StringReturn the label manually set on the query or from the profile location.final CQueryPlanKeyprepare(SpiOrmQueryRequest<T> request) Prepare the query which prepares any expressions (sub-query expressions etc) and calculates the query plan key.final StringReturn the profile event id based on query mode and type.final StringReturn the id used to identify a particular query for the given bean type.final ProfileLocationReturn the profile location for this query.final ProfilingListenerIf return null then no profiling for this query.final voidBuild the key for the bind values used in the query (for l2 query cache).final CacheModeReturn the cache mode if this query should use/check the query cache.final HashQueryReturn a hash that includes the query plan and bind values.final ObjectReturn the query plan key.final SpiRawSqlrawSql()Return the RawSql that was set to use for this query.final voidresetBeanCacheAutoMode(boolean findOne) Reset AUTO mode to OFF for findList().select(FetchGroup<T> fetchGroup) final voidReturn true if select all properties was used to ensure the property invoking a lazy load was included in the query.final voidselectProperties(OrmQueryProperties properties) Set the select properties.final voidselectProperties(Set<String> props) Specify the select properties.final voidsetArrayParameter(String name, Collection<?> values) Bind the named multi-value array parameter which we would use with Postgres ANY.final voidSet when the base table is using history.setAutoTune(boolean autoTune) final voidsetAutoTuned(boolean autoTuned) Set to true if this query has been tuned by autoTune.setBaseTable(String baseTable) setBeanCacheMode(CacheMode beanCacheMode) setBufferFetchSizeHint(int bufferFetchSizeHint) setCountDistinct(CountDistinctOrder countDistinctOrder) final voidsetDefaultFetchBuffer(int fetchSize) Set the JDBC fetchSize buffer hint if not explicitly set.final voidSet default select clauses where none have been explicitly defined.final CQueryPlanKeySet the query to be delete by ids due to cascading delete.final voidsetDetail(OrmQueryDetail detail) Replace the query detail.setDisableLazyLoading(boolean disableLazyLoading) setDistinct(boolean distinct) Internally set to use SQL DISTINCT on the query but still have id property included.final voidsetFilterMany(String prop, ExpressionList<?> filterMany) Set a filter to a join path.setFirstRow(int firstRow) final voidsetGeneratedSql(String generatedSql) Set the generated sql for debug purposes.setLazyLoadBatchSize(int lazyLoadBatchSize) final voidThis becomes a lazy loading query for a many relationship.final voidsetLazyLoadManyPath(String lazyLoadManyPath) Set the path of the many when +query/+lazy loading query is executed.final voidsetLazyLoadProperty(String lazyLoadProperty) Set the property that invoked the lazy load and MUST be included in the lazy loading query.final voidsetLoadDescription(String loadMode, String loadDescription) Set the load mode (+lazy or +query) and the load description.final voidsetM2MIncludeJoin(TableJoin m2mIncludeJoin) Set the extra join for a M2M lazy load.final voidSet to true when we only include the Id property if it is explicitly included in the select().setMaxRows(int maxRows) final voidsetMode(SpiQuery.Mode mode) Set the query mode.final voidsetNativeSql(String nativeSql) setOrderBy(OrderBy<T> orderBy) final ObjectGraphNodesetOrigin(CallOrigin callOrigin) Return the origin point for the query.setParameter(int position, Object value) Set an ordered bind parameter according to its position.setParameter(Object value) setParameter(String name, Object value) Set a named bind parameter.setParameters(Object... values) final voidsetParentNode(ObjectGraphNode parentNode) Set the profile point of the bean or collection that is lazy loading.final voidsetPersistenceContext(PersistenceContext persistenceContext) Set an explicit TransactionContext (typically for a refresh query).setProfileLocation(ProfileLocation profileLocation) final voidsetProfilePath(String label, String relativePath, ProfileLocation profileLocation) Set the on a secondary query given the label, relativePath and profile location of the parent query.final voidsetProfilingListener(ProfilingListener profilingListener) This has the effect of turning on profiling for this query.setReadOnly(boolean readOnly) final voidSet the select clause to select the Id property.final voidMark the query as selecting a single attribute.final voidsetTenantId(Object tenantId) Set the tenantId to use for lazy loading.setTimeout(int secs) final voidsetType(SpiQuery.Type type) Set the query type (List, Set etc).final voidSetup to be a delete or update query.final voidsetUsageProfiling(boolean usageProfiling) Set to false if this query should not be included in the AutoTune usage profiling information.setUseQueryCache(CacheMode useQueryCache) final voidSimplify nested expression lists where possible.final SpiQuery.TemporalModeReturn the Temporal mode for the query.final ObjecttenantId()Return the tenantId to use for lazy loading.final inttimeout()Return the timeout.final StringtoString()Return the transaction explicitly assigned or null.final booleantuneFetchProperties(OrmQueryDetail tunedDetail) AutoTune tune the detail specifying properties to select on already defined joins and adding extra joins where they are missing.final SpiQuery.Typetype()Return the type of query (List, Set, Map, Bean, rowCount etc).final intupdate()final intupdate(Transaction transaction) final OrmUpdatePropertiesReturn the properties for an update query.usingConnection(Connection connection) usingDatabase(Database database) final voidSet that this is a future query that will execute in the background.usingTransaction(Transaction transaction) validate()Validate all the expression properties/paths given the bean descriptor.final TimestampReturn the find versions end timestamp.final TimestampReturn the find versions start timestamp.final ExpressionList<T> where()where(Expression expression) final SpiExpressionList<T> Can return null if no expressions where added to the where clause.withLock(Query.LockType lockType) withLock(Query.LockType lockType, Query.LockWait lockWait) Methods inherited from class io.ebeaninternal.server.querydefn.AbstractQuery
cancel, checkCancelled, setCancelableQueryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.ebean.CancelableQuery
cancelMethods inherited from interface io.ebean.QueryBuilder
setUseCache, setUseQueryCacheMethods inherited from interface io.ebeaninternal.api.SpiCancelableQuery
checkCancelled, setCancelableQuery
-
Constructor Details
-
DefaultOrmQuery
public DefaultOrmQuery(BeanDescriptor<T> desc, SpiEbeanServer server, ExpressionFactory expressionFactory)
-
-
Method Details
-
setNativeSql
-
asDto
- Specified by:
asDtoin interfaceQueryBuilder<Query<T>,T>
-
asUpdate
- Specified by:
asUpdatein interfaceQueryBuilder<Query<T>,T>
-
descriptor
Description copied from interface:SpiQueryReturn the bean descriptor for this query.- Specified by:
descriptorin interfaceSpiQuery<T>
-
isFindAll
public final boolean isFindAll()Description copied from interface:SpiQueryReturn true if this is a "find all" query. Used to set a "find all" profile location if necessary. -
isFindById
public final boolean isFindById()Description copied from interface:SpiQueryReturn true if this is a "find by id" query. This includes a check for a single "equal to" expression for the Id.- Specified by:
isFindByIdin interfaceSpiQuery<T>
-
profileEventId
Description copied from interface:SpiQueryReturn the profile event id based on query mode and type.- Specified by:
profileEventIdin interfaceSpiQuery<T>
-
profileId
Description copied from interface:SpiQueryReturn the id used to identify a particular query for the given bean type. -
setProfileLocation
- Specified by:
setProfileLocationin interfaceQuery<T>
-
label
Description copied from interface:SpiQueryReturn the label set on the query. -
hint
Description copied from interface:SpiQueryReturn the SQL hint to include in the query. -
planLabel
Description copied from interface:SpiQueryReturn the label manually set on the query or from the profile location. -
setProfilePath
public final void setProfilePath(String label, String relativePath, @Nullable ProfileLocation profileLocation) Description copied from interface:SpiQuerySet the on a secondary query given the label, relativePath and profile location of the parent query.- Specified by:
setProfilePathin interfaceSpiQuery<T>
-
setLabel
- Specified by:
setLabelin interfaceQueryBuilder<Query<T>,T>
-
setHint
- Specified by:
setHintin interfaceQueryBuilder<Query<T>,T>
-
isAutoTunable
public final boolean isAutoTunable()Description copied from interface:SpiQueryReturn true if AutoTune should be attempted on this query.- Specified by:
isAutoTunablein interfaceSpiQuery<T>
-
apply
- Specified by:
applyin interfaceQueryBuilderProjection<Query<T>,T>
-
alsoIf
- Specified by:
alsoIfin interfaceQueryBuilder<Query<T>,T>
-
addSoftDeletePredicate
- Specified by:
addSoftDeletePredicatein interfaceSpiQuery<T>
-
softDeletePredicates
- Specified by:
softDeletePredicatesin interfaceSpiQuery<T>
-
isAsOfBaseTable
public final boolean isAsOfBaseTable()Description copied from interface:SpiQueryReturn true if the base table is using history.- Specified by:
isAsOfBaseTablein interfaceSpiQuery<T>
-
setAsOfBaseTable
public final void setAsOfBaseTable()Description copied from interface:SpiQuerySet when the base table is using history.- Specified by:
setAsOfBaseTablein interfaceSpiQuery<T>
-
setAllowLoadErrors
- Specified by:
setAllowLoadErrorsin interfaceQueryBuilder<Query<T>,T>
-
incrementAsOfTableCount
public final void incrementAsOfTableCount()Description copied from interface:SpiQueryIncrement the counter of tables used in 'As Of' query.- Specified by:
incrementAsOfTableCountin interfaceSpiQuery<T>
-
incrementAsOfTableCount
public final void incrementAsOfTableCount(int increment) Description copied from interface:SpiQueryIncrement the counter of tables used in 'As Of' query.- Specified by:
incrementAsOfTableCountin interfaceSpiQuery<T>
-
getAsOfTableCount
public final int getAsOfTableCount()Description copied from interface:SpiQueryReturn the table alias used for the base table.- Specified by:
getAsOfTableCountin interfaceSpiQuery<T>
-
getAsOf
Description copied from interface:SpiQueryReturn the asOf Timestamp which the query should run as. -
asOf
- Specified by:
asOfin interfaceQueryBuilder<Query<T>,T>
-
setIncludeSoftDeletes
- Specified by:
setIncludeSoftDeletesin interfaceQueryBuilder<Query<T>,T>
-
rawSql
Description copied from interface:SpiQueryReturn the RawSql that was set to use for this query. -
setRawSql
- Specified by:
setRawSqlin interfaceQueryBuilder<Query<T>,T>
-
getOriginKey
Description copied from interface:SpiQueryReturn the origin key.- Specified by:
getOriginKeyin interfaceSpiQuery<T>
-
lazyLoadBatchSize
public final int lazyLoadBatchSize()Description copied from interface:SpiQueryReturn the default lazy load batch size.- Specified by:
lazyLoadBatchSizein interfaceSpiQuery<T>
-
setLazyLoadBatchSize
- Specified by:
setLazyLoadBatchSizein interfaceQueryBuilder<Query<T>,T>
-
lazyLoadProperty
Description copied from interface:SpiQueryReturn the property that invoked lazy load.- Specified by:
lazyLoadPropertyin interfaceSpiQuery<T>
-
setLazyLoadProperty
Description copied from interface:SpiQuerySet the property that invoked the lazy load and MUST be included in the lazy loading query.- Specified by:
setLazyLoadPropertyin interfaceSpiQuery<T>
-
getExpressionFactory
- Specified by:
getExpressionFactoryin interfaceQuery<T>
-
manyWhereJoins
Return the extra joins required to support the where clause for 'Many' properties.- Specified by:
manyWhereJoinsin interfaceSpiQuery<T>
-
selectAllForLazyLoadProperty
public final void selectAllForLazyLoadProperty()Return true if select all properties was used to ensure the property invoking a lazy load was included in the query.- Specified by:
selectAllForLazyLoadPropertyin interfaceSpiQuery<T>
-
setLazyLoadManyPath
Description copied from interface:SpiQuerySet the path of the many when +query/+lazy loading query is executed.- Specified by:
setLazyLoadManyPathin interfaceSpiQuery<T>
-
convertJoins
Description copied from interface:SpiQueryConvert joins as necessary to query joins etc.- Specified by:
convertJoinsin interfaceSpiQuery<T>
-
setDefaultSelectClause
public final void setDefaultSelectClause()Description copied from interface:SpiQuerySet default select clauses where none have been explicitly defined.- Specified by:
setDefaultSelectClausein interfaceSpiQuery<T>
-
setTenantId
Description copied from interface:SpiQuerySet the tenantId to use for lazy loading.- Specified by:
setTenantIdin interfaceSpiQuery<T>
-
tenantId
Description copied from interface:SpiQueryReturn the tenantId to use for lazy loading. -
setDetail
Description copied from interface:SpiQueryReplace the query detail. This is used by the AutoTune feature to as a fast way to set the query properties and joins.Note care must be taken to keep the where, orderBy, firstRows and maxRows held in the detail attributes.
-
tuneFetchProperties
Description copied from interface:SpiQueryAutoTune tune the detail specifying properties to select on already defined joins and adding extra joins where they are missing.- Specified by:
tuneFetchPropertiesin interfaceSpiQuery<T>
-
detail
Description copied from interface:SpiQueryReturn the query detail. -
filterMany
- Specified by:
filterManyin interfaceQuery<T>
-
setFilterMany
Description copied from interface:SpiQuerySet a filter to a join path.- Specified by:
setFilterManyin interfaceSpiQuery<T>
-
setupForDeleteOrUpdate
public final void setupForDeleteOrUpdate()Setup to be a delete or update query.- Specified by:
setupForDeleteOrUpdatein interfaceSpiQuery<T>
-
setDeleteByIdsPlan
Description copied from interface:SpiQuerySet the query to be delete by ids due to cascading delete.- Specified by:
setDeleteByIdsPlanin interfaceSpiQuery<T>
-
setSelectId
public final void setSelectId()Set the select clause to select the Id property.- Specified by:
setSelectIdin interfaceSpiQuery<T>
-
setSingleAttribute
public final void setSingleAttribute()Description copied from interface:SpiQueryMark the query as selecting a single attribute.- Specified by:
setSingleAttributein interfaceSpiQuery<T>
-
isSingleAttribute
public final boolean isSingleAttribute()Return true if this is a single attribute query.- Specified by:
isSingleAttributein interfaceSpiQuery<T>
-
countDistinctOrder
Description copied from interface:SpiQueryReturns the count distinct order setting.- Specified by:
countDistinctOrderin interfaceSpiQuery<T>
-
isWithId
public final boolean isWithId()Description copied from interface:SpiQueryReturn true if the query should include the Id property.distinct and single attribute queries exclude the Id property.
-
cacheIdLookup
Description copied from interface:SpiQueryBean cache lookup for find by ids.- Specified by:
cacheIdLookupin interfaceSpiQuery<T>
-
naturalKey
Description copied from interface:SpiQueryCollect natural key data for this query or null if the query does not match the requirements of natural key lookup.- Specified by:
naturalKeyin interfaceSpiQuery<T>
-
naturalKeyBindParam
Description copied from interface:SpiQueryReturn a Natural Key bind parameter if supported by this query.- Specified by:
naturalKeyBindParamin interfaceSpiQuery<T>
-
copy
Description copied from interface:SpiQueryReturn a copy of the query.Note that this does NOT copy the forUpdate property. See #2762.
-
copy
Description copied from interface:SpiQueryReturn a copy of the query attaching to a different EbeanServer. -
setPersistenceContextScope
- Specified by:
setPersistenceContextScopein interfaceQueryBuilder<Query<T>,T>
-
persistenceContextScope
Description copied from interface:SpiQueryReturn the PersistenceContextScope that this query should use.This can be null and in that case use the default scope.
- Specified by:
persistenceContextScopein interfaceSpiQuery<T>
-
type
Description copied from interface:SpiQueryReturn the type of query (List, Set, Map, Bean, rowCount etc). -
setType
Description copied from interface:SpiQuerySet the query type (List, Set etc). -
distinctOn
Description copied from interface:SpiQueryReturn the distinct on clause.- Specified by:
distinctOnin interfaceSpiQuery<T>
-
loadDescription
Description copied from interface:SpiQueryReturn a more detailed description of the lazy or query load.- Specified by:
loadDescriptionin interfaceSpiQuery<T>
-
loadMode
Description copied from interface:SpiQueryReturn the load mode (+lazy or +query). -
setLoadDescription
Description copied from interface:SpiQuerySet the load mode (+lazy or +query) and the load description.- Specified by:
setLoadDescriptionin interfaceSpiQuery<T>
-
persistenceContext
Return the TransactionContext.If no TransactionContext is present on the query then the TransactionContext from the Transaction is used (transaction scoped persistence context).
- Specified by:
persistenceContextin interfaceSpiQuery<T>
-
setPersistenceContext
Set an explicit TransactionContext (typically for a refresh query).If no TransactionContext is present on the query then the TransactionContext from the Transaction is used (transaction scoped persistence context).
- Specified by:
setPersistenceContextin interfaceSpiQuery<T>
-
setLazyLoadForParents
Description copied from interface:SpiQueryThis becomes a lazy loading query for a many relationship.- Specified by:
setLazyLoadForParentsin interfaceSpiQuery<T>
-
lazyLoadMany
Description copied from interface:SpiQueryReturn the lazy loading 'many' property.- Specified by:
lazyLoadManyin interfaceSpiQuery<T>
-
isDetailEmpty
public final boolean isDetailEmpty()Return true if the query detail has neither select or joins specified.- Specified by:
isDetailEmptyin interfaceSpiQuery<T>
-
isAutoTuned
public final boolean isAutoTuned()- Specified by:
isAutoTunedin interfaceQuery<T>
-
setAutoTuned
public final void setAutoTuned(boolean autoTuned) Description copied from interface:SpiQuerySet to true if this query has been tuned by autoTune.- Specified by:
setAutoTunedin interfaceSpiQuery<T>
-
isAutoTune
Description copied from interface:SpiQueryReturn explicit AutoTune setting or null. If null then not explicitly set so we use the default behaviour.- Specified by:
isAutoTunein interfaceSpiQuery<T>
-
setAutoTune
- Specified by:
setAutoTunein interfaceQueryBuilder<Query<T>,T>
-
withLock
- Specified by:
withLockin interfaceQueryBuilder<Query<T>,T>
-
withLock
- Specified by:
withLockin interfaceQueryBuilder<Query<T>,T>
-
forUpdate
- Specified by:
forUpdatein interfaceQueryBuilder<Query<T>,T>
-
forUpdateNoWait
- Specified by:
forUpdateNoWaitin interfaceQueryBuilder<Query<T>,T>
-
forUpdateSkipLocked
- Specified by:
forUpdateSkipLockedin interfaceQueryBuilder<Query<T>,T>
-
isForUpdate
public final boolean isForUpdate()- Specified by:
isForUpdatein interfaceQuery<T>
-
getForUpdateLockWait
Description copied from interface:SpiQueryReturn the ForUpdate mode.- Specified by:
getForUpdateLockWaitin interfaceQuery<T>- Specified by:
getForUpdateLockWaitin interfaceSpiQuery<T>
-
getForUpdateLockType
- Specified by:
getForUpdateLockTypein interfaceQuery<T>
-
profilingListener
Description copied from interface:SpiQueryIf return null then no profiling for this query. If a ProfilingListener is returned this implies that profiling is turned on for this query (and all the objects this query creates).- Specified by:
profilingListenerin interfaceSpiQuery<T>
-
setProfilingListener
Description copied from interface:SpiQueryThis has the effect of turning on profiling for this query.- Specified by:
setProfilingListenerin interfaceSpiQuery<T>
-
getQueryType
- Specified by:
getQueryTypein interfaceQuery<T>
-
mode
Description copied from interface:SpiQueryReturn the query mode. -
temporalMode
Description copied from interface:SpiQueryReturn the Temporal mode for the query.- Specified by:
temporalModein interfaceSpiQuery<T>
-
isAsOfQuery
public final boolean isAsOfQuery()Description copied from interface:SpiQueryReturn true if this is a 'As Of' query.- Specified by:
isAsOfQueryin interfaceSpiQuery<T>
-
isIncludeSoftDeletes
public final boolean isIncludeSoftDeletes()Description copied from interface:SpiQueryReturn true if this query includes soft deleted rows.- Specified by:
isIncludeSoftDeletesin interfaceSpiQuery<T>
-
setMode
Description copied from interface:SpiQuerySet the query mode. -
usingFuture
public final void usingFuture()Description copied from interface:SpiQuerySet that this is a future query that will execute in the background.- Specified by:
usingFuturein interfaceSpiQuery<T>
-
isUsingFuture
public final boolean isUsingFuture()Description copied from interface:SpiQueryReturn true if this is a future query.- Specified by:
isUsingFuturein interfaceSpiQuery<T>
-
isUsageProfiling
public final boolean isUsageProfiling()Description copied from interface:SpiQueryReturn false when this is a lazy load or refresh query for a bean.We just take/copy the data from those beans and don't collect AutoTune usage profiling on those lazy load or refresh beans.
- Specified by:
isUsageProfilingin interfaceSpiQuery<T>
-
setUsageProfiling
public final void setUsageProfiling(boolean usageProfiling) Description copied from interface:SpiQuerySet to false if this query should not be included in the AutoTune usage profiling information.- Specified by:
setUsageProfilingin interfaceSpiQuery<T>
-
setParentNode
Description copied from interface:SpiQuerySet the profile point of the bean or collection that is lazy loading.This enables use to hook this back to the original 'root' query by the queryPlanHash and stackPoint.
- Specified by:
setParentNodein interfaceSpiQuery<T>
-
parentNode
Description copied from interface:SpiQueryUsed to hook back a lazy loading query to the original query (query point).This will return null or an "original" query.
- Specified by:
parentNodein interfaceSpiQuery<T>
-
setOrigin
Description copied from interface:SpiQueryReturn the origin point for the query.This MUST be call prior to a query being changed via tuning. This is because the queryPlanHash is used to identify the query point.
-
isNativeSql
public final boolean isNativeSql()Description copied from interface:SpiQueryReturn true if this is a native sql query.- Specified by:
isNativeSqlin interfaceSpiQuery<T>
-
nativeSql
Description copied from interface:SpiQueryReturn the unmodified native sql query (with named params etc). -
queryPlanKey
Description copied from interface:SpiQueryReturn the query plan key.- Specified by:
queryPlanKeyin interfaceSpiQuery<T>
-
prepare
Prepare the query which prepares any expressions (sub-query expressions etc) and calculates the query plan key. -
queryBindKey
Description copied from interface:SpiQueryBuild the key for the bind values used in the query (for l2 query cache).Combined with queryPlanHash() to return queryHash (a unique key for a query).
- Specified by:
queryBindKeyin interfaceSpiQuery<T>
-
queryHash
Return a hash that includes the query plan and bind values.This hash can be used to identify if we have executed the exact same query (including bind values) before.
-
isRawSql
public final boolean isRawSql()Description copied from interface:SpiQueryReturn true if this is a RawSql query. -
timeout
public final int timeout()Return the timeout. -
hasMaxRowsOrFirstRow
public final boolean hasMaxRowsOrFirstRow()Description copied from interface:SpiQueryReturns true if either firstRow or maxRows has been set.- Specified by:
hasMaxRowsOrFirstRowin interfaceSpiQuery<T>
-
isVersionsBetween
public final boolean isVersionsBetween()Description copied from interface:SpiQueryReturn true if this is a find versions between query.- Specified by:
isVersionsBetweenin interfaceSpiQuery<T>
-
versionStart
Description copied from interface:SpiQueryReturn the find versions start timestamp.- Specified by:
versionStartin interfaceSpiQuery<T>
-
versionEnd
Description copied from interface:SpiQueryReturn the find versions end timestamp.- Specified by:
versionEndin interfaceSpiQuery<T>
-
isReadOnly
Description copied from interface:SpiQueryReturn true if the beans returned by this query should be read only.- Specified by:
isReadOnlyin interfaceSpiQuery<T>
-
setReadOnly
- Specified by:
setReadOnlyin interfaceQueryBuilder<Query<T>,T>
-
isBeanCachePut
public final boolean isBeanCachePut()Description copied from interface:SpiQueryReturn true if the query should PUT against the bean cache.- Specified by:
isBeanCachePutin interfaceSpiQuery<T>
-
isBeanCacheGet
public final boolean isBeanCacheGet()Description copied from interface:SpiQueryReturn true if the query should GET against bean cache.- Specified by:
isBeanCacheGetin interfaceSpiQuery<T>
-
isForceHitDatabase
public final boolean isForceHitDatabase()Description copied from interface:SpiQueryReturn true if we must hit the DB (Cache reload or select for update).- Specified by:
isForceHitDatabasein interfaceSpiQuery<T>
-
resetBeanCacheAutoMode
public final void resetBeanCacheAutoMode(boolean findOne) Description copied from interface:SpiQueryReset AUTO mode to OFF for findList(). Expect explicit cache use with findList().- Specified by:
resetBeanCacheAutoModein interfaceSpiQuery<T>
-
beanCacheMode
Description copied from interface:SpiQueryReturn the cache mode for using the bean cache (Get and Put).- Specified by:
beanCacheModein interfaceSpiQuery<T>
-
queryCacheMode
Description copied from interface:SpiQueryReturn the cache mode if this query should use/check the query cache.- Specified by:
queryCacheModein interfaceSpiQuery<T>
-
setBeanCacheMode
- Specified by:
setBeanCacheModein interfaceQueryBuilder<Query<T>,T>
-
setUseQueryCache
- Specified by:
setUseQueryCachein interfaceQueryBuilder<Query<T>,T>
-
setTimeout
- Specified by:
setTimeoutin interfaceQueryBuilder<Query<T>,T>
-
selectProperties
Description copied from interface:SpiQueryFetchSpecify the select properties.- Specified by:
selectPropertiesin interfaceSpiQueryFetch
-
fetchProperties
Description copied from interface:SpiQueryFetchSpecify the fetch properties for the given path.- Specified by:
fetchPropertiesin interfaceSpiQueryFetch
-
selectProperties
Description copied from interface:SpiQuerySet the select properties.- Specified by:
selectPropertiesin interfaceSpiQuery<T>
-
fetchProperties
Description copied from interface:SpiQuerySet the fetch properties for the given path.- Specified by:
fetchPropertiesin interfaceSpiQuery<T>
-
addNested
Description copied from interface:SpiQueryFetchAdd a nested fetch graph.- Specified by:
addNestedin interfaceSpiQueryFetch
-
distinctOn
- Specified by:
distinctOnin interfaceQueryBuilderProjection<Query<T>,T>
-
select
- Specified by:
selectin interfaceQueryBuilderProjection<Query<T>,T>
-
select
- Specified by:
selectin interfaceQueryBuilderProjection<Query<T>,T>
-
fetch
- Specified by:
fetchin interfaceQueryBuilderProjection<Query<T>,T>
-
fetch
- Specified by:
fetchin interfaceQueryBuilderProjection<Query<T>,T>
-
fetch
- Specified by:
fetchin interfaceQueryBuilderProjection<Query<T>,T>
-
fetch
- Specified by:
fetchin interfaceQueryBuilderProjection<Query<T>,T>
-
fetchQuery
- Specified by:
fetchQueryin interfaceQueryBuilderProjection<Query<T>,T>
-
fetchCache
- Specified by:
fetchCachein interfaceQueryBuilderProjection<Query<T>,T>
-
fetchLazy
- Specified by:
fetchLazyin interfaceQueryBuilderProjection<Query<T>,T>
-
fetchQuery
- Specified by:
fetchQueryin interfaceQueryBuilderProjection<Query<T>,T>
-
fetchCache
- Specified by:
fetchCachein interfaceQueryBuilderProjection<Query<T>,T>
-
fetchLazy
- Specified by:
fetchLazyin interfaceQueryBuilderProjection<Query<T>,T>
-
transaction
Description copied from interface:SpiQueryReturn the transaction explicitly assigned or null.- Specified by:
transactionin interfaceSpiQuery<T>
-
usingTransaction
- Specified by:
usingTransactionin interfaceQueryBuilder<Query<T>,T>
-
usingConnection
- Specified by:
usingConnectionin interfaceQueryBuilder<Query<T>,T>
-
usingDatabase
- Specified by:
usingDatabasein interfaceQueryBuilder<Query<T>,T>
-
usingMaster
- Specified by:
usingMasterin interfaceQueryBuilder<Query<T>,T>
-
isUseMaster
public boolean isUseMaster()Description copied from interface:SpiQueryReturn true if this query should not use the read only data source.- Specified by:
isUseMasterin interfaceSpiQuery<T>
-
delete
public final int delete()- Specified by:
deletein interfaceQueryBuilder<Query<T>,T>
-
delete
-
update
public final int update() -
update
-
findIds
- Specified by:
findIdsin interfaceQueryBuilder<Query<T>,T>
-
exists
public final boolean exists()- Specified by:
existsin interfaceQueryBuilder<Query<T>,T>
-
findCount
public final int findCount()- Specified by:
findCountin interfaceQueryBuilder<Query<T>,T>
-
findEachWhile
- Specified by:
findEachWhilein interfaceQueryBuilder<Query<T>,T>
-
findEach
- Specified by:
findEachin interfaceQueryBuilder<Query<T>,T>
-
findEach
- Specified by:
findEachin interfaceQueryBuilder<Query<T>,T>
-
findIterate
- Specified by:
findIteratein interfaceQueryBuilder<Query<T>,T>
-
findStream
- Specified by:
findStreamin interfaceQueryBuilder<Query<T>,T>
-
findVersions
- Specified by:
findVersionsin interfaceQueryBuilder<Query<T>,T>
-
findVersionsBetween
- Specified by:
findVersionsBetweenin interfaceQueryBuilder<Query<T>,T>
-
findList
- Specified by:
findListin interfaceQueryBuilder<Query<T>,T>
-
findSet
- Specified by:
findSetin interfaceQueryBuilder<Query<T>,T>
-
findMap
- Specified by:
findMapin interfaceQueryBuilder<Query<T>,T>
-
findSingleAttributeList
- Specified by:
findSingleAttributeListin interfaceQueryBuilder<Query<T>,T>
-
findSingleAttributeSet
- Specified by:
findSingleAttributeSetin interfaceQueryBuilder<Query<T>,T>
-
findSingleAttribute
public final <A> A findSingleAttribute()- Specified by:
findSingleAttributein interfaceQueryBuilder<Query<T>,T>
-
findSingleAttributeOrEmpty
- Specified by:
findSingleAttributeOrEmptyin interfaceQueryBuilder<Query<T>,T>
-
findOne
- Specified by:
findOnein interfaceQueryBuilder<Query<T>,T>
-
findOneOrEmpty
- Specified by:
findOneOrEmptyin interfaceQueryBuilder<Query<T>,T>
-
findFutureIds
- Specified by:
findFutureIdsin interfaceQueryBuilder<Query<T>,T>
-
findFutureList
- Specified by:
findFutureListin interfaceQueryBuilder<Query<T>,T>
-
findFutureCount
- Specified by:
findFutureCountin interfaceQueryBuilder<Query<T>,T>
-
findPagedList
- Specified by:
findPagedListin interfaceQueryBuilder<Query<T>,T>
-
setParameter
- Specified by:
setParameterin interfaceQuery<T>
-
setParameters
- Specified by:
setParametersin interfaceQuery<T>
-
setParameter
Set an ordered bind parameter according to its position. Note that the position starts at 1 to be consistent with JDBC PreparedStatement. You need to set a parameter value for each ? you have in the query.- Specified by:
setParameterin interfaceQuery<T>
-
setParameter
Set a named bind parameter. Named parameters have a colon to prefix the name.- Specified by:
setParameterin interfaceQuery<T>
-
setArrayParameter
Description copied from interface:SpiQueryBind the named multi-value array parameter which we would use with Postgres ANY.- Specified by:
setArrayParameterin interfaceSpiQuery<T>
-
checkPagingOrderBy
public final boolean checkPagingOrderBy()Description copied from interface:SpiQueryReturn true if the query should have an order by appended automatically.- Specified by:
checkPagingOrderByin interfaceSpiQuery<T>
-
orderByIsEmpty
public final boolean orderByIsEmpty()Description copied from interface:SpiQueryReturn true if there is no Order By clause.- Specified by:
orderByIsEmptyin interfaceSpiQuery<T>
-
getOrderBy
Description copied from interface:SpiQueryReturn the Order By clause or null if there is none defined.- Specified by:
getOrderByin interfaceSpiQuery<T>
-
orderBy
-
orderBy
- Specified by:
orderByin interfaceQueryBuilder<Query<T>,T>
-
setOrderBy
- Specified by:
setOrderByin interfaceQueryBuilder<Query<T>,T>
-
isManualId
public final boolean isManualId()Description copied from interface:SpiQueryReturn true if the Id property is manually included in the query (DTO queries).- Specified by:
isManualIdin interfaceSpiQuery<T>
-
setManualId
public final void setManualId()Description copied from interface:SpiQuerySet to true when we only include the Id property if it is explicitly included in the select().- Specified by:
setManualIdin interfaceSpiQuery<T>
-
isDistinct
public final boolean isDistinct()return true if user specified to use SQL DISTINCT (effectively excludes id property).- Specified by:
isDistinctin interfaceSpiQuery<T>
-
setDistinct
Internally set to use SQL DISTINCT on the query but still have id property included.- Specified by:
setDistinctin interfaceQueryBuilder<Query<T>,T>
-
setCountDistinct
- Specified by:
setCountDistinctin interfaceQueryBuilder<Query<T>,T>
-
isCountDistinct
public final boolean isCountDistinct()- Specified by:
isCountDistinctin interfaceQuery<T>
-
getBeanType
- Specified by:
getBeanTypein interfaceQueryBuilder<Query<T>,T>
-
toString
-
m2mIncludeJoin
Description copied from interface:SpiQueryReturn the extra join for a M2M lazy load.- Specified by:
m2mIncludeJoinin interfaceSpiQuery<T>
-
setM2MIncludeJoin
Description copied from interface:SpiQuerySet the extra join for a M2M lazy load.- Specified by:
setM2MIncludeJoinin interfaceSpiQuery<T>
-
setDisableLazyLoading
- Specified by:
setDisableLazyLoadingin interfaceQueryBuilder<Query<T>,T>
-
isDisableLazyLoading
public final boolean isDisableLazyLoading()Description copied from interface:SpiQueryReturn true if lazy loading has been disabled on the query.- Specified by:
isDisableLazyLoadingin interfaceSpiQuery<T>
-
getFirstRow
public final int getFirstRow()Description copied from interface:SpiQueryReturn the index of the first row to return in the query.- Specified by:
getFirstRowin interfaceQuery<T>- Specified by:
getFirstRowin interfaceSpiQuery<T>
-
setFirstRow
- Specified by:
setFirstRowin interfaceQueryBuilder<Query<T>,T>
-
getMaxRows
public final int getMaxRows()Description copied from interface:SpiQueryReturn the maximum number of rows to return in the query.- Specified by:
getMaxRowsin interfaceQuery<T>- Specified by:
getMaxRowsin interfaceSpiQuery<T>
-
setMaxRows
- Specified by:
setMaxRowsin interfaceQueryBuilder<Query<T>,T>
-
mapKey
Description copied from interface:SpiQueryReturn the property used to specify keys for a map. -
setMapKey
- Specified by:
setMapKeyin interfaceQueryBuilder<Query<T>,T>
-
getId
-
setId
-
bindParams
Description copied from interface:SpiQueryReturn the bind parameters.- Specified by:
bindParamsin interfaceSpiQuery<T>
-
initBindParams
Description copied from interface:SpiQueryReturn the bind parameters ensuring it is initialised.- Specified by:
initBindParamsin interfaceSpiQuery<T>
-
where
-
where
-
simplifyExpressions
public final void simplifyExpressions()Description copied from interface:SpiQuerySimplify nested expression lists where possible.- Specified by:
simplifyExpressionsin interfaceSpiQuery<T>
-
having
-
having
-
havingExpressions
Description copied from interface:SpiQueryCan return null if no expressions where added to the having clause.- Specified by:
havingExpressionsin interfaceSpiQuery<T>
-
whereExpressions
Description copied from interface:SpiQueryCan return null if no expressions where added to the where clause.- Specified by:
whereExpressionsin interfaceSpiQuery<T>
-
getGeneratedSql
- Specified by:
getGeneratedSqlin interfaceQueryBuilder<Query<T>,T>
-
setGeneratedSql
Description copied from interface:SpiQuerySet the generated sql for debug purposes.- Specified by:
setGeneratedSqlin interfaceSpiQuery<T>
-
checkNamedParameters
public final void checkNamedParameters()Description copied from interface:SpiQueryCheck that the named parameters have had their values set.- Specified by:
checkNamedParametersin interfaceSpiQuery<T>
-
createNamedParameter
Description copied from interface:SpiQueryCreate a named parameter placeholder.- Specified by:
createNamedParameterin interfaceSpiQuery<T>
-
setDefaultFetchBuffer
public final void setDefaultFetchBuffer(int fetchSize) Description copied from interface:SpiQuerySet the JDBC fetchSize buffer hint if not explicitly set.- Specified by:
setDefaultFetchBufferin interfaceSpiQuery<T>
-
setBufferFetchSizeHint
- Specified by:
setBufferFetchSizeHintin interfaceQueryBuilder<Query<T>,T>
-
bufferFetchSizeHint
public final int bufferFetchSizeHint()Description copied from interface:SpiQueryReturn the hint for Statement.setFetchSize().- Specified by:
bufferFetchSizeHintin interfaceSpiQuery<T>
-
setBaseTable
- Specified by:
setBaseTablein interfaceQueryBuilder<Query<T>,T>
-
baseTable
Description copied from interface:SpiQueryReturn the base table to use if user defined on the query. -
alias
- Specified by:
aliasin interfaceQueryBuilder<Query<T>,T>
-
alias
Description copied from interface:SpiQueryReturn root table alias set byQueryBuilder.alias(String)command. -
getAlias
Description copied from interface:SpiQueryReturn root table alias with default option. -
validate
- Specified by:
validatein interfaceQueryBuilder<Query<T>,T>
-
validate
Validate all the expression properties/paths given the bean descriptor. -
updateProperties
Description copied from interface:SpiQueryReturn the properties for an update query.- Specified by:
updatePropertiesin interfaceSpiQuery<T>
-
profileLocation
Description copied from interface:SpiQueryReturn the profile location for this query.- Specified by:
profileLocationin interfaceSpiQuery<T>
-
handleLoadError
Description copied from interface:SpiQueryHandles load errors.- Specified by:
handleLoadErrorin interfaceSpiQuery<T>
-
orderById
- Specified by:
orderByIdin interfaceQueryBuilder<Query<T>,T>
-