java.lang.Object
io.ebeaninternal.server.querydefn.AbstractQuery
io.ebeaninternal.server.querydefn.DefaultDtoQuery<T>
- All Implemented Interfaces:
CancelableQuery,DtoQuery<T>,SpiCancelableQuery,SpiDtoQuery<T>,SpiSqlBinding
Default implementation of DtoQuery.
-
Field Summary
Fields inherited from class io.ebeaninternal.server.querydefn.AbstractQuery
useMaster -
Constructor Summary
ConstructorsConstructorDescriptionDefaultDtoQuery(SpiEbeanServer server, io.ebeaninternal.server.dto.DtoBeanDescriptor<T> descriptor, SpiQuery<?> ormQuery) Create given an underlying ORM query.DefaultDtoQuery(SpiEbeanServer server, io.ebeaninternal.server.dto.DtoBeanDescriptor<T> descriptor, String sql) Create given a native SQL query. -
Method Summary
Modifier and TypeMethodDescriptionio.ebeaninternal.server.dto.DtoQueryPlanbuildPlan(io.ebeaninternal.server.dto.DtoMappingRequest request) Build the query plan.voidvoidvoidfindEachWhile(Predicate<T> consumer) findList()findOne()Return the named or positioned parameters.intReturn the hint for Statement.setFetchSize().intReturn the first row to fetch.getLabel()Return the label (to collect metrics on when set).intReturn the maximum number of rows to fetch.getQuery()return the query.intReturn the query timeout.booleanReturn true if the query is in relaxed mapping mode.booleanReturn true if this query should not use the read only data source.voidObtain the location if necessary.SpiQuery<?> ormQuery()Return an underlying ORM query (if this query is built from an ORM query).planKey()Return the key for query plan.Return the label with fallback to profile location label.Return the profile location.voidputQueryPlan(Object planKey, io.ebeaninternal.server.dto.DtoQueryPlan plan) Put the query plan into the cache.io.ebeaninternal.server.dto.DtoQueryPlanGet the query plan for the cache.setArrayParameter(String paramName, Collection<?> values) setBufferFetchSizeHint(int bufferFetchSizeHint) setFirstRow(int firstRow) setMaxRows(int maxRows) setNullParameter(int position, int jdbcType) setNullParameter(String name, int jdbcType) setParameter(int position, Object value) setParameter(Object value) setParameter(String paramName, Object value) setParameters(Object... values) setProfileLocation(ProfileLocation profileLocation) setTimeout(int secs) toString()Return the transaction explicitly associated to the query.type()Return the associated DTO bean type.usingConnection(Connection connection) usingTransaction(Transaction transaction) 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.ebeaninternal.api.SpiCancelableQuery
checkCancelled, setCancelableQuery
-
Constructor Details
-
DefaultDtoQuery
public DefaultDtoQuery(SpiEbeanServer server, io.ebeaninternal.server.dto.DtoBeanDescriptor<T> descriptor, SpiQuery<?> ormQuery) Create given an underlying ORM query. -
DefaultDtoQuery
public DefaultDtoQuery(SpiEbeanServer server, io.ebeaninternal.server.dto.DtoBeanDescriptor<T> descriptor, String sql) Create given a native SQL query.
-
-
Method Details
-
planKey
Description copied from interface:SpiDtoQueryReturn the key for query plan.- Specified by:
planKeyin interfaceSpiDtoQuery<T>
-
queryPlan
Description copied from interface:SpiDtoQueryGet the query plan for the cache.- Specified by:
queryPlanin interfaceSpiDtoQuery<T>
-
buildPlan
public io.ebeaninternal.server.dto.DtoQueryPlan buildPlan(io.ebeaninternal.server.dto.DtoMappingRequest request) Description copied from interface:SpiDtoQueryBuild the query plan.- Specified by:
buildPlanin interfaceSpiDtoQuery<T>
-
putQueryPlan
Description copied from interface:SpiDtoQueryPut the query plan into the cache.- Specified by:
putQueryPlanin interfaceSpiDtoQuery<T>
-
usingTransaction
- Specified by:
usingTransactionin interfaceDtoQuery<T>
-
usingConnection
- Specified by:
usingConnectionin interfaceDtoQuery<T>
-
usingMaster
- Specified by:
usingMasterin interfaceDtoQuery<T>
-
isUseMaster
public boolean isUseMaster()Description copied from interface:SpiSqlBindingReturn true if this query should not use the read only data source.- Specified by:
isUseMasterin interfaceSpiSqlBinding
-
findEach
-
findEach
-
findEachWhile
- Specified by:
findEachWhilein interfaceDtoQuery<T>
-
findIterate
- Specified by:
findIteratein interfaceDtoQuery<T>
-
findStream
- Specified by:
findStreamin interfaceDtoQuery<T>
-
findList
-
findOne
-
findOneOrEmpty
- Specified by:
findOneOrEmptyin interfaceDtoQuery<T>
-
setNullParameter
- Specified by:
setNullParameterin interfaceDtoQuery<T>
-
setNullParameter
- Specified by:
setNullParameterin interfaceDtoQuery<T>
-
setParameter
- Specified by:
setParameterin interfaceDtoQuery<T>
-
setParameter
- Specified by:
setParameterin interfaceDtoQuery<T>
-
setArrayParameter
- Specified by:
setArrayParameterin interfaceDtoQuery<T>
-
setParameters
- Specified by:
setParametersin interfaceDtoQuery<T>
-
setParameter
- Specified by:
setParameterin interfaceDtoQuery<T>
-
toString
-
type
Description copied from interface:SpiDtoQueryReturn the associated DTO bean type.- Specified by:
typein interfaceSpiDtoQuery<T>
-
ormQuery
Description copied from interface:SpiDtoQueryReturn an underlying ORM query (if this query is built from an ORM query).- Specified by:
ormQueryin interfaceSpiDtoQuery<T>
-
transaction
Description copied from interface:SpiSqlBindingReturn the transaction explicitly associated to the query.- Specified by:
transactionin interfaceSpiSqlBinding
-
setRelaxedMode
- Specified by:
setRelaxedModein interfaceDtoQuery<T>
-
isRelaxedMode
public boolean isRelaxedMode()Description copied from interface:SpiDtoQueryReturn true if the query is in relaxed mapping mode.- Specified by:
isRelaxedModein interfaceSpiDtoQuery<T>
-
setLabel
-
getLabel
Description copied from interface:SpiSqlBindingReturn the label (to collect metrics on when set).- Specified by:
getLabelin interfaceSpiSqlBinding
-
planLabel
Description copied from interface:SpiDtoQueryReturn the label with fallback to profile location label.- Specified by:
planLabelin interfaceSpiDtoQuery<T>
-
obtainLocation
public void obtainLocation()Description copied from interface:SpiDtoQueryObtain the location if necessary.- Specified by:
obtainLocationin interfaceSpiDtoQuery<T>
-
setProfileLocation
- Specified by:
setProfileLocationin interfaceDtoQuery<T>
-
profileLocation
Description copied from interface:SpiDtoQueryReturn the profile location.- Specified by:
profileLocationin interfaceSpiDtoQuery<T>
-
getFirstRow
public int getFirstRow()Description copied from interface:SpiSqlBindingReturn the first row to fetch.- Specified by:
getFirstRowin interfaceSpiSqlBinding
-
setFirstRow
- Specified by:
setFirstRowin interfaceDtoQuery<T>
-
getMaxRows
public int getMaxRows()Description copied from interface:SpiSqlBindingReturn the maximum number of rows to fetch.- Specified by:
getMaxRowsin interfaceSpiSqlBinding
-
setMaxRows
- Specified by:
setMaxRowsin interfaceDtoQuery<T>
-
getTimeout
public int getTimeout()Description copied from interface:SpiSqlBindingReturn the query timeout.- Specified by:
getTimeoutin interfaceSpiSqlBinding
-
setTimeout
- Specified by:
setTimeoutin interfaceDtoQuery<T>
-
getBindParams
Description copied from interface:SpiSqlBindingReturn the named or positioned parameters.- Specified by:
getBindParamsin interfaceSpiSqlBinding
-
setBufferFetchSizeHint
- Specified by:
setBufferFetchSizeHintin interfaceDtoQuery<T>
-
getBufferFetchSizeHint
public int getBufferFetchSizeHint()Description copied from interface:SpiSqlBindingReturn the hint for Statement.setFetchSize().- Specified by:
getBufferFetchSizeHintin interfaceSpiSqlBinding
-
getQuery
Description copied from interface:SpiSqlBindingreturn the query.- Specified by:
getQueryin interfaceSpiSqlBinding
-