public class QueryImpl<X> extends AbstractQueryImpl<X> implements TypedQuery<X>, HibernateQuery, HibernateQuery
Query
and TypedQuery
contracts.Modifier and Type | Class and Description |
---|---|
static class |
QueryImpl.JpaPositionalParameterRegistrationImpl<T>
Specialized handling for JPA "positional parameters".
|
BaseQueryImpl.ParameterBindImpl<T>
Modifier and Type | Field and Description |
---|---|
static EntityManagerMessageLogger |
LOG |
Constructor and Description |
---|
QueryImpl(Query query,
AbstractEntityManagerImpl em) |
QueryImpl(Query query,
AbstractEntityManagerImpl em,
Map<String,Class> namedParameterTypeRedefinitions) |
Modifier and Type | Method and Description |
---|---|
protected void |
applyAliasSpecificLockModeHint(String alias,
LockMode lockMode)
Apply the alias specific lock modes.
|
protected boolean |
applyCacheableHint(boolean isCacheable)
Apply the cacheable (true/false) hint.
|
protected boolean |
applyCacheModeHint(CacheMode cacheMode)
Apply the CacheMode hint.
|
protected boolean |
applyCacheRegionHint(String regionName)
Apply the cache region hint
|
protected boolean |
applyCommentHint(String comment)
Apply the comment hint.
|
protected boolean |
applyFetchSizeHint(int fetchSize)
Apply the fetch size hint
|
protected void |
applyFirstResult(int firstResult)
Apply the given first-result value.
|
protected boolean |
applyFlushModeHint(FlushMode flushMode)
Apply the FlushMode hint.
|
protected boolean |
applyLockTimeoutHint(int timeout)
Apply the lock timeout (in seconds!) hint
|
protected void |
applyMaxResults(int maxResults)
Apply the given max results value.
|
protected boolean |
applyReadOnlyHint(boolean isReadOnly)
Apply the read-only (true/false) hint.
|
protected boolean |
applyTimeoutHint(int timeout)
Apply the query timeout hint.
|
protected boolean |
canApplyAliasSpecificLockModeHints()
Can alias-specific lock modes be applied?
|
Query |
getHibernateQuery()
Gives access to the underlying Hibernate query object..
|
List<X> |
getResultList()
Execute a SELECT query and return the query results
as a typed List.
|
X |
getSingleResult()
Execute a SELECT query that returns a single result.
|
protected void |
internalApplyLockMode(LockModeType lockModeType) |
protected int |
internalExecuteUpdate()
Actually execute the update; all pre-requisites have been checked.
|
protected boolean |
isNativeSqlQuery()
Is the query represented here a native SQL query?
|
protected boolean |
isSelectQuery()
Is the query represented here a SELECT query?
|
<T> T |
unwrap(Class<T> tClass)
Return an object of the specified type to allow access to
the provider-specific API.
|
checkTransaction, executeUpdate, getEntityManager, getLockMode, getSupportedHints, setFirstResult, setFlushMode, setHint, setLockMode, setMaxResults, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter
checkOpen, entityManager, findParameterRegistration, findParameterRegistration, findParameterRegistration, getEntityGraphQueryHint, getFirstResult, getFlushMode, getHints, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, getSpecifiedFlushMode, getSpecifiedMaxResults, isBound, registerParameter, validateBinding
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setFirstResult, setFlushMode, setHint, setLockMode, setMaxResults, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter
executeUpdate, getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, isBound
public static final EntityManagerMessageLogger LOG
public QueryImpl(Query query, AbstractEntityManagerImpl em)
public QueryImpl(Query query, AbstractEntityManagerImpl em, Map<String,Class> namedParameterTypeRedefinitions)
protected boolean isNativeSqlQuery()
BaseQueryImpl
isNativeSqlQuery
in class BaseQueryImpl
true
if it is a native SQL query; false
otherwiseprotected boolean isSelectQuery()
BaseQueryImpl
isSelectQuery
in class BaseQueryImpl
true
if the query is a SELECT; false
otherwise.public Query getHibernateQuery()
HibernateQuery
getHibernateQuery
in interface HibernateQuery
protected int internalExecuteUpdate()
AbstractQueryImpl
internalExecuteUpdate
in class AbstractQueryImpl<X>
protected void applyMaxResults(int maxResults)
BaseQueryImpl
applyMaxResults
in class BaseQueryImpl
maxResults
- The specified max resultsprotected void applyFirstResult(int firstResult)
BaseQueryImpl
applyFirstResult
in class BaseQueryImpl
firstResult
- The specified first-result value.protected boolean applyTimeoutHint(int timeout)
BaseQueryImpl
applyTimeoutHint
in class BaseQueryImpl
timeout
- The timeout (in seconds!) specified as a hinttrue
if the hint was "applied"protected boolean applyCommentHint(String comment)
BaseQueryImpl
applyCommentHint
in class BaseQueryImpl
comment
- The comment specified as a hinttrue
if the hint was "applied"protected boolean applyFetchSizeHint(int fetchSize)
BaseQueryImpl
applyFetchSizeHint
in class BaseQueryImpl
fetchSize
- The fetch size specified as a hinttrue
if the hint was "applied"protected boolean applyCacheableHint(boolean isCacheable)
BaseQueryImpl
applyCacheableHint
in class BaseQueryImpl
isCacheable
- The value specified as hinttrue
if the hint was "applied"protected boolean applyCacheRegionHint(String regionName)
BaseQueryImpl
applyCacheRegionHint
in class BaseQueryImpl
regionName
- The name of the cache region specified as a hinttrue
if the hint was "applied"protected boolean applyReadOnlyHint(boolean isReadOnly)
BaseQueryImpl
applyReadOnlyHint
in class BaseQueryImpl
isReadOnly
- The value specified as hinttrue
if the hint was "applied"protected boolean applyCacheModeHint(CacheMode cacheMode)
BaseQueryImpl
applyCacheModeHint
in class BaseQueryImpl
cacheMode
- The CacheMode value specified as a hint.true
if the hint was "applied"protected boolean applyFlushModeHint(FlushMode flushMode)
BaseQueryImpl
applyFlushModeHint
in class BaseQueryImpl
flushMode
- The FlushMode value specified as hinttrue
if the hint was "applied"protected boolean canApplyAliasSpecificLockModeHints()
BaseQueryImpl
canApplyAliasSpecificLockModeHints
in class BaseQueryImpl
true
indicates they can be applied, false
otherwise.protected void applyAliasSpecificLockModeHint(String alias, LockMode lockMode)
BaseQueryImpl
BaseQueryImpl.canApplyAliasSpecificLockModeHints()
has already been
called and returned true
.applyAliasSpecificLockModeHint
in class BaseQueryImpl
alias
- The alias to apply the 'lockMode' to.lockMode
- The LockMode to apply.public List<X> getResultList()
TypedQuery
getResultList
in interface Query
getResultList
in interface TypedQuery<X>
public X getSingleResult()
TypedQuery
getSingleResult
in interface Query
getSingleResult
in interface TypedQuery<X>
public <T> T unwrap(Class<T> tClass)
Query
PersistenceException
is thrown.protected void internalApplyLockMode(LockModeType lockModeType)
internalApplyLockMode
in class BaseQueryImpl
protected boolean applyLockTimeoutHint(int timeout)
BaseQueryImpl
applyLockTimeoutHint
in class BaseQueryImpl
timeout
- The timeout (in seconds!) specified as a hinttrue
if the hint was "applied"Copyright © 2017 JBoss by Red Hat. All rights reserved.