public class QueryImpl<X> extends AbstractQuery<X> implements Serializable
Query
interface._boundParams, _convertPositionalParams, _declaredParams, _em, _qmd, _relaxBindParameterTypeChecking
FLUSH_FALSE, FLUSH_TRUE, FLUSH_WITH_CONNECTION, HINT_RESULT_COUNT, OP_DELETE, OP_SELECT, OP_UPDATE
Constructor and Description |
---|
QueryImpl(EntityManagerImpl em,
Query query)
Deprecated.
|
QueryImpl(EntityManagerImpl em,
RuntimeExceptionTranslator ret,
Query query)
Deprecated.
|
QueryImpl(EntityManagerImpl em,
RuntimeExceptionTranslator ret,
Query query,
QueryMetaData qmd)
Constructor; supply factory exception translator and delegate.
|
Modifier and Type | Method and Description |
---|---|
OpenJPAQuery<X> |
addAggregateListener(AggregateListener listener)
Register an aggregate listener for the query.
|
OpenJPAQuery<X> |
addFilterListener(FilterListener listener)
Register a filter listener for the query.
|
protected void |
assertOpen() |
OpenJPAQuery<X> |
closeAll()
Close all open query results.
|
OpenJPAQuery<X> |
compile()
Compile the query.
|
boolean |
equals(Object other) |
int |
executeUpdate() |
Collection<?> |
getCandidateCollection()
Return the candidate collection, or
null if 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.
|
Query |
getDelegate()
Delegate.
|
OpenJPAEntityManager |
getEntityManager()
The owning entity manager.
|
FetchPlan |
getFetchPlan()
Fetch plan for controlling the loading of results.
|
int |
getFirstResult()
Return the 0-based start index for the returned results.
|
javax.persistence.FlushModeType |
getFlushMode()
Return the current flush mode.
|
Map<String,Object> |
getHints()
Get all the active hints and their values.
|
boolean |
getIgnoreChanges()
Whether to ignore changes in the current transaction.
|
String |
getLanguage()
Query language.
|
javax.persistence.LockModeType |
getLockMode() |
int |
getMaxResults()
Return the maximum number of results to retrieve.
|
QueryOperationType |
getOperation()
Query operation type.
|
OrderedMap<Object,Class<?>> |
getParamTypes() |
String |
getQueryString()
Query string.
|
Class |
getResultClass()
Query result element type.
|
List |
getResultList() |
X |
getSingleResult()
Execute a query that returns a single result.
|
Set<String> |
getSupportedHints()
Gets hints supported by this query.
|
int |
hashCode() |
boolean |
hasSubclasses()
Whether subclasses are included in the query results.
|
protected void |
lock() |
OpenJPAQuery<X> |
removeAggregateListener(AggregateListener listener)
Remove an aggregate listener from the query.
|
OpenJPAQuery<X> |
removeFilterListener(FilterListener listener)
Remove a filter listener from the query.
|
OpenJPAQuery<X> |
setCandidateCollection(Collection coll)
Set a collection of candidates.
|
OpenJPAQuery<X> |
setFirstResult(int startPosition) |
OpenJPAQuery<X> |
setFlushMode(javax.persistence.FlushModeType flushMode) |
OpenJPAQuery<X> |
setHint(String key,
Object value) |
OpenJPAQuery<X> |
setIgnoreChanges(boolean ignore)
Whether to ignore changes in the current transaction.
|
javax.persistence.TypedQuery<X> |
setLockMode(javax.persistence.LockModeType lockMode)
Sets lock mode on the given query.
|
OpenJPAQuery<X> |
setMaxResults(int max) |
OpenJPAQuery<X> |
setResultClass(Class cls)
Query result element type.
|
OpenJPAQuery<X> |
setSubclasses(boolean subs)
Whether subclasses are included in the query results.
|
String |
toString() |
protected void |
unlock() |
<T> T |
unwrap(Class<T> cls)
Unwraps this receiver to an instance of the given class, if possible.
|
declareParameter, getBoundParameterKeys, getDeclaredParameterKeys, getDeclaredParameterKeys, getDeclaredParameters, getNamedParameters, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, getPositionalParameters, getRelaxBindParameterTypeChecking, hasPositionalParameters, isBound, isNative, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameters, setParameters, setRelaxBindParameterTypeChecking
public QueryImpl(EntityManagerImpl em, RuntimeExceptionTranslator ret, Query query, QueryMetaData qmd)
em
- The EntityManager which created this queryret
- Exception translator for this queryquery
- The underlying "kernel" query.public QueryImpl(EntityManagerImpl em, RuntimeExceptionTranslator ret, Query query)
public QueryImpl(EntityManagerImpl em, Query query)
public Query getDelegate()
public OpenJPAEntityManager getEntityManager()
OpenJPAQuery
getEntityManager
in interface OpenJPAQuery<X>
public String getLanguage()
OpenJPAQuery
getLanguage
in interface OpenJPAQuery<X>
public QueryOperationType getOperation()
OpenJPAQuery
getOperation
in interface OpenJPAQuery<X>
public FetchPlan getFetchPlan()
OpenJPAQuery
getFetchPlan
in interface OpenJPAQuery<X>
public String getQueryString()
OpenJPAQuery
getQueryString
in interface OpenJPAQuery<X>
public boolean getIgnoreChanges()
OpenJPAQuery
getIgnoreChanges
in interface OpenJPAQuery<X>
public OpenJPAQuery<X> setIgnoreChanges(boolean ignore)
OpenJPAQuery
setIgnoreChanges
in interface OpenJPAQuery<X>
public OpenJPAQuery<X> addFilterListener(FilterListener listener)
OpenJPAQuerySPI
addFilterListener
in interface OpenJPAQuery<X>
addFilterListener
in interface OpenJPAQuerySPI<X>
public OpenJPAQuery<X> removeFilterListener(FilterListener listener)
OpenJPAQuerySPI
removeFilterListener
in interface OpenJPAQuery<X>
removeFilterListener
in interface OpenJPAQuerySPI<X>
public OpenJPAQuery<X> addAggregateListener(AggregateListener listener)
OpenJPAQuerySPI
addAggregateListener
in interface OpenJPAQuery<X>
addAggregateListener
in interface OpenJPAQuerySPI<X>
public OpenJPAQuery<X> removeAggregateListener(AggregateListener listener)
OpenJPAQuerySPI
removeAggregateListener
in interface OpenJPAQuery<X>
removeAggregateListener
in interface OpenJPAQuerySPI<X>
public Collection<?> getCandidateCollection()
OpenJPAQuery
null
if an
extent was specified instead of a collection.getCandidateCollection
in interface OpenJPAQuery<X>
public OpenJPAQuery<X> setCandidateCollection(Collection coll)
OpenJPAQuery
setCandidateCollection
in interface OpenJPAQuery<X>
public Class getResultClass()
OpenJPAQuery
getResultClass
in interface OpenJPAQuery<X>
public OpenJPAQuery<X> setResultClass(Class cls)
OpenJPAQuery
setResultClass
in interface OpenJPAQuery<X>
public boolean hasSubclasses()
OpenJPAQuery
hasSubclasses
in interface OpenJPAQuery<X>
public OpenJPAQuery<X> setSubclasses(boolean subs)
OpenJPAQuery
setSubclasses
in interface OpenJPAQuery<X>
public int getFirstResult()
OpenJPAQuery
getFirstResult
in interface javax.persistence.Query
getFirstResult
in interface OpenJPAQuery<X>
public OpenJPAQuery<X> setFirstResult(int startPosition)
setFirstResult
in interface javax.persistence.Query
setFirstResult
in interface javax.persistence.TypedQuery<X>
setFirstResult
in interface OpenJPAQuery<X>
public int getMaxResults()
OpenJPAQuery
Integer.MAX_VALUE
for no limit.getMaxResults
in interface javax.persistence.Query
getMaxResults
in interface OpenJPAQuery<X>
public OpenJPAQuery<X> setMaxResults(int max)
setMaxResults
in interface javax.persistence.Query
setMaxResults
in interface javax.persistence.TypedQuery<X>
setMaxResults
in interface OpenJPAQuery<X>
public OpenJPAQuery<X> compile()
OpenJPAQuery
compile
in interface OpenJPAQuery<X>
public List getResultList()
getResultList
in interface javax.persistence.Query
getResultList
in interface javax.persistence.TypedQuery<X>
public X getSingleResult()
getSingleResult
in interface javax.persistence.Query
getSingleResult
in interface javax.persistence.TypedQuery<X>
public int executeUpdate()
executeUpdate
in interface javax.persistence.Query
public javax.persistence.FlushModeType getFlushMode()
OpenJPAQuery
getFlushMode
in interface javax.persistence.Query
getFlushMode
in interface OpenJPAQuery<X>
public OpenJPAQuery<X> setFlushMode(javax.persistence.FlushModeType flushMode)
setFlushMode
in interface javax.persistence.Query
setFlushMode
in interface javax.persistence.TypedQuery<X>
setFlushMode
in interface OpenJPAQuery<X>
public OpenJPAQuery<X> closeAll()
OpenJPAQuery
closeAll
in interface OpenJPAQuery<X>
public String[] getDataStoreActions(Map params)
OpenJPAQuery
getDataStoreActions
in interface OpenJPAQuery<X>
params
- the named parameter map for the query invocationpublic javax.persistence.LockModeType getLockMode()
getLockMode
in interface javax.persistence.Query
public javax.persistence.TypedQuery<X> setLockMode(javax.persistence.LockModeType lockMode)
setLockMode
in interface javax.persistence.Query
setLockMode
in interface javax.persistence.TypedQuery<X>
ignorePreparedQuery()
public Map<String,Object> getHints()
getHints
in interface javax.persistence.Query
public OpenJPAQuery<X> setHint(String key, Object value)
setHint
in interface javax.persistence.Query
setHint
in interface javax.persistence.TypedQuery<X>
setHint
in interface OpenJPAQuery<X>
public Set<String> getSupportedHints()
OpenJPAQuery
getSupportedHints
in interface OpenJPAQuery<X>
public <T> T unwrap(Class<T> cls)
unwrap
in interface javax.persistence.Query
if
- the given class is null, generic Object.class
or a class
that is not wrapped by this receiver.protected void lock()
lock
in class AbstractQuery<X>
protected void unlock()
unlock
in class AbstractQuery<X>
protected void assertOpen()
assertOpen
in class AbstractQuery<X>
public OrderedMap<Object,Class<?>> getParamTypes()
getParamTypes
in class AbstractQuery<X>
Copyright © 2006–2018 Apache Software Foundation. All rights reserved.