Interface OpenJPAQuery<X>
- All Superinterfaces:
Query, TypedQuery<X>
- All Known Subinterfaces:
OpenJPAQuerySPI<X>
- All Known Implementing Classes:
AbstractQuery, QueryImpl
Interface implemented by OpenJPA queries.
- Since:
- 0.4.0
- Author:
- Abe White
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.static final intDeprecated.use theFlushModeTypeenum instead.static final intDeprecated.use theFlushModeTypeenum instead.static final StringHint key for specifying the number of rows to optimize for.static final intDeprecated.use theQueryOperationTypeinstead.static final intDeprecated.use theQueryOperationTypeinstead.static final intDeprecated.use theQueryOperationTypeinstead. -
Method Summary
Modifier and TypeMethodDescriptionaddAggregateListener(AggregateListener listener) Deprecated.cast toQueryImplinstead.addFilterListener(FilterListener listener) Deprecated.cast toQueryImplinstead.closeAll()Close all open query results.compile()Compile the query.Return the candidate collection, ornullif an extent was specified instead of a collection.String[]getDataStoreActions(Map params) Returns a description of the commands that will be sent to the datastore in order to execute this query.The owning entity manager.Fetch plan for controlling the loading of results.intReturn the 0-based start index for the returned results.Return the current flush mode.booleanWhether to ignore changes in the current transaction.Query language.intReturn the maximum number of results to retrieve. orInteger.MAX_VALUEfor no limit.The named parameters for the query; empty map if none or if query uses positional parameters.Query operation type.Object[]The positional parameters for the query; empty array if none or if query uses named parameters.Query string.booleanGets whether the type of user-supplied bind parameter value and the type of target persistent property they bind to are checked with strong or weak constraint.Query result element type.Gets hints supported by this query.booleanWhether this query has positional parameters.booleanWhether subclasses are included in the query results.removeAggregateListener(AggregateListener listener) Deprecated.cast toQueryImplinstead.removeFilterListener(FilterListener listener) Deprecated.cast toQueryImplinstead.Set a collection of candidates.setFirstResult(int startPosition) setFlushMode(FlushModeType flushMode) setIgnoreChanges(boolean ignore) Whether to ignore changes in the current transaction.setMaxResults(int maxResult) setParameter(int position, Object value) setParameter(int position, Calendar value, TemporalType temporalType) setParameter(int position, Date value, TemporalType temporalType) setParameter(String name, Object value) setParameter(String name, Calendar value, TemporalType temporalType) setParameter(String name, Date value, TemporalType temporalType) setParameters(Object... params) Set parameters.setParameters(Map params) Set parameters.voidSets whether the type of user-supplied bind parameter value and the type of target persistent property they bind to are checked with strong or weak constraint.setResultClass(Class type) Query result element type.setSubclasses(boolean subs) Whether subclasses are included in the query results.Methods inherited from interface Query
executeUpdate, getCacheRetrieveMode, getCacheStoreMode, getHints, getLockMode, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, getTimeout, isBound, unwrapMethods inherited from interface TypedQuery
getResultList, getResultStream, getSingleResult, getSingleResultOrNull, setCacheRetrieveMode, setCacheStoreMode, setLockMode, setParameter, setParameter, setParameter, setTimeout
-
Field Details
-
HINT_RESULT_COUNT
Hint key for specifying the number of rows to optimize for.- See Also:
-
OP_SELECT
-
OP_DELETE
-
OP_UPDATE
-
FLUSH_TRUE
-
FLUSH_FALSE
-
FLUSH_WITH_CONNECTION
Deprecated.use theFlushModeTypeenum instead.- See Also:
-
-
Method Details
-
getEntityManager
OpenJPAEntityManager getEntityManager()The owning entity manager. -
getLanguage
String getLanguage()Query language. -
getOperation
QueryOperationType getOperation()Query operation type. -
getFetchPlan
FetchPlan getFetchPlan()Fetch plan for controlling the loading of results. -
getQueryString
String getQueryString()Query string. -
getIgnoreChanges
boolean getIgnoreChanges()Whether to ignore changes in the current transaction. -
setIgnoreChanges
Whether to ignore changes in the current transaction. -
getCandidateCollection
Collection getCandidateCollection()Return the candidate collection, ornullif an extent was specified instead of a collection. -
setCandidateCollection
Set a collection of candidates. -
getResultClass
Class getResultClass()Query result element type. -
setResultClass
Query result element type. -
hasSubclasses
boolean hasSubclasses()Whether subclasses are included in the query results. -
setSubclasses
Whether subclasses are included in the query results. -
getFirstResult
int getFirstResult()Return the 0-based start index for the returned results.- Specified by:
getFirstResultin interfaceQuery
-
getMaxResults
int getMaxResults()Return the maximum number of results to retrieve. orInteger.MAX_VALUEfor no limit.- Specified by:
getMaxResultsin interfaceQuery
-
compile
OpenJPAQuery<X> compile()Compile the query. -
hasPositionalParameters
boolean hasPositionalParameters()Whether this query has positional parameters. -
getPositionalParameters
Object[] getPositionalParameters()The positional parameters for the query; empty array if none or if query uses named parameters. -
getNamedParameters
-
setParameters
Set parameters. -
setParameters
Set parameters. -
closeAll
OpenJPAQuery<X> closeAll()Close all open query results. -
getDataStoreActions
-
setMaxResults
- Specified by:
setMaxResultsin interfaceQuery- Specified by:
setMaxResultsin interfaceTypedQuery<X>
-
setFirstResult
- Specified by:
setFirstResultin interfaceQuery- Specified by:
setFirstResultin interfaceTypedQuery<X>
-
setHint
- Specified by:
setHintin interfaceQuery- Specified by:
setHintin interfaceTypedQuery<X>
-
setParameter
- Specified by:
setParameterin interfaceQuery- Specified by:
setParameterin interfaceTypedQuery<X>
-
setParameter
- Specified by:
setParameterin interfaceQuery- Specified by:
setParameterin interfaceTypedQuery<X>
-
setParameter
- Specified by:
setParameterin interfaceQuery- Specified by:
setParameterin interfaceTypedQuery<X>
-
setParameter
- Specified by:
setParameterin interfaceQuery- Specified by:
setParameterin interfaceTypedQuery<X>
-
setParameter
- Specified by:
setParameterin interfaceQuery- Specified by:
setParameterin interfaceTypedQuery<X>
-
setParameter
- Specified by:
setParameterin interfaceQuery- Specified by:
setParameterin interfaceTypedQuery<X>
-
setRelaxBindParameterTypeChecking
Sets whether the type of user-supplied bind parameter value and the type of target persistent property they bind to are checked with strong or weak constraint.
The same can be set viahintwithout puncturing standard JPA API.- Parameters:
hint- a String or Boolean value.- See Also:
-
getRelaxBindParameterTypeChecking
boolean getRelaxBindParameterTypeChecking()Gets whether the type of user-supplied bind parameter value and the type of target persistent property they bind to are checked with strong or weak constraint.- Returns:
- the booelan state. False by default, i.e. the type of a bind parameter value is checked strongly against the target property type.
-
setFlushMode
- Specified by:
setFlushModein interfaceQuery- Specified by:
setFlushModein interfaceTypedQuery<X>
-
getFlushMode
FlushModeType getFlushMode()Return the current flush mode.- Specified by:
getFlushModein interfaceQuery
-
addFilterListener
Deprecated.cast toQueryImplinstead. This method pierces the published-API boundary, as does the SPI cast. -
removeFilterListener
Deprecated.cast toQueryImplinstead. This method pierces the published-API boundary, as does the SPI cast. -
addAggregateListener
Deprecated.cast toQueryImplinstead. This method pierces the published-API boundary, as does the SPI cast. -
removeAggregateListener
Deprecated.cast toQueryImplinstead. This method pierces the published-API boundary, as does the SPI cast. -
getSupportedHints
-
FlushModeTypeenum instead.