Class HibernateOrmSearchQueryAdapter<R>
- java.lang.Object
-
- org.hibernate.query.spi.AbstractCommonQueryContract
-
- org.hibernate.query.spi.AbstractSelectionQuery<R>
-
- org.hibernate.query.spi.AbstractQuery<R>
-
- org.hibernate.search.mapper.orm.search.query.impl.HibernateOrmSearchQueryAdapter<R>
-
- All Implemented Interfaces:
Query,TypedQuery<R>,org.hibernate.query.CommonQueryContract,org.hibernate.query.MutationQuery,org.hibernate.query.Query<R>,org.hibernate.query.SelectionQuery<R>,org.hibernate.query.spi.DomainQueryExecutionContext,org.hibernate.query.spi.QueryImplementor<R>
@SuppressForbiddenApis(reason="We need to use the internal QueryOptionsImpl in order to implement a org.hibernate.query.Query") public final class HibernateOrmSearchQueryAdapter<R> extends org.hibernate.query.spi.AbstractQuery<R>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HibernateOrmSearchQueryAdapter<R>applyGraph(org.hibernate.graph.RootGraph graph, org.hibernate.graph.GraphSemantic semantic)protected voidbeforeQuery()static <R> HibernateOrmSearchQueryAdapter<R>create(SearchQuery<R> query)protected intdoExecuteUpdate()protected List<R>doList()protected org.hibernate.query.spi.ScrollableResultsImplementor<R>doScroll(org.hibernate.ScrollMode scrollMode)intexecuteUpdate()Execute an update or delete statement.Map<String,Object>getHints()Get the properties and hints and associated values that are in effect for the query instance.LockModeTypegetLockMode()Get the current lock mode for the query.org.hibernate.LockOptionsgetLockOptions()org.hibernate.query.spi.QueryParameterBindingsgetParameterBindings()org.hibernate.query.spi.ParameterMetadataImplementorgetParameterMetadata()org.hibernate.query.spi.QueryParameterBindingsgetQueryParameterBindings()StringgetQueryString()List<R>list()protected <P> org.hibernate.query.spi.QueryParameterBinding<P>locateBinding(int position)protected <P> org.hibernate.query.spi.QueryParameterBinding<P>locateBinding(Parameter<P> parameter)protected <P> org.hibernate.query.spi.QueryParameterBinding<P>locateBinding(String name)protected <P> org.hibernate.query.spi.QueryParameterBinding<P>locateBinding(org.hibernate.query.spi.QueryParameterImplementor<P> parameter)org.hibernate.query.spi.ScrollableResultsImplementor<R>scroll()HibernateOrmSearchQueryAdapter<R>setHint(String hintName, Object value)Set a query property or hint.HibernateOrmSearchQueryAdapter<R>setLockMode(LockModeType lockModeType)Set the lock mode type to be used for the query execution.HibernateOrmSearchQueryAdapter<R>setLockMode(String alias, org.hibernate.LockMode lockMode)org.hibernate.query.spi.QueryImplementor<R>setResultListTransformer(org.hibernate.query.ResultListTransformer<R> resultListTransformer)HibernateOrmSearchQueryAdapter<R>setTimeout(int timeout)<T> org.hibernate.query.spi.QueryImplementor<T>setTupleTransformer(org.hibernate.query.TupleTransformer<T> transformer)StringtoString()<T> Tunwrap(Class<T> cls)Return an object of the specified type to allow access to the provider-specific API.-
Methods inherited from class org.hibernate.query.spi.AbstractQuery
addQueryHint, applyOptions, collectHints, getComment, getFirstResult, getFlushMode, getMaxResults, getParameters, getQueryOptions, getSupportedHints, isCacheable, prepareForExecution, resolveJdbcParameterTypeIfNecessary, setCacheable, setCacheMode, setCacheRegion, setCacheRetrieveMode, setCacheStoreMode, setComment, setFetchSize, setFirstResult, setFlushMode, setHibernateFlushMode, setLockOptions, setMaxResults, setOptionalEntityName, setOptionalId, setOptionalObject, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setProperties, setProperties, setReadOnly
-
Methods inherited from class org.hibernate.query.spi.AbstractSelectionQuery
afterQuery, afterQuery, applyOptions, buildTupleMetadata, checkQueryReturnType, getCacheMode, getCacheRegion, getCacheRetrieveMode, getCacheStoreMode, getCallback, getFetchSize, getHibernateLockMode, getSessionFactory, getSingleResult, getSingleResultOrNull, hasAppliedGraph, hasCallbackActions, hasLimit, isReadOnly, requiresTxn, resetCallback, scroll, setAliasSpecificLockMode, setFollowOnLocking, setHibernateLockMode, stream, uniqueElement, uniqueResult, uniqueResultOptional, verifyResultType, visitQueryReturnType
-
Methods inherited from class org.hibernate.query.spi.AbstractCommonQueryContract
applyAdditionalPossibleHints, applyAliasSpecificLockModeHint, applyCacheableHint, applyCacheModeHint, applyCacheRegionHint, applyCommentHint, applyEntityGraphHint, applyFetchSizeHint, applyFirstResult, applyFlushModeHint, applyFollowOnLockingHint, applyGraph, applyGraph, applyHibernateLockMode, applyHint, applyJpaCacheRetrieveModeHint, applyJpaCacheStoreModeHint, applyJpaFlushMode, applyLockModeHint, applyLockModeType, applyLockTimeoutHint, applyLockTimeoutHint, applyMaxResults, applyResultListTransformer, applySelectionHint, applySynchronizeSpacesHint, applyTimeoutHint, applyTupleTransformer, determineType, getHibernateFlushMode, getIntegerLiteral, getJpaFlushMode, getMaxRows, getParameter, getParameter, getParameter, getParameter, getParameterValue, getParameterValue, getParameterValue, getSession, getTimeout, isBound, putIfNotNull, putIfNotNull
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.query.CommonQueryContract
getHibernateFlushMode, getTimeout
-
Methods inherited from interface jakarta.persistence.Query
getParameter, getParameter, getParameter, getParameter, getParameterValue, getParameterValue, getParameterValue, isBound
-
Methods inherited from interface org.hibernate.query.Query
applyFetchGraph, applyLoadGraph, getResultList, getResultStream, getSingleResult, stream, uniqueResult, uniqueResultOptional
-
-
-
-
Method Detail
-
create
public static <R> HibernateOrmSearchQueryAdapter<R> create(SearchQuery<R> query)
-
unwrap
public <T> T unwrap(Class<T> cls)
Description copied from interface:QueryReturn an object of the specified type to allow access to the provider-specific API. If the provider's query implementation does not support the specified class, thePersistenceExceptionis thrown.- Parameters:
cls- the class of the object to be returned. This is normally either the underlying query implementation class or an interface that it implements.- Returns:
- an instance of the specified class
-
getQueryString
public String getQueryString()
-
setHint
public HibernateOrmSearchQueryAdapter<R> setHint(String hintName, Object value)
Description copied from interface:TypedQuerySet a query property or hint. The hints elements may be used to specify query properties and hints. Properties defined by this specification must be observed by the provider. Vendor-specific hints that are not recognized by a provider must be silently ignored. Portable applications should not rely on the standard timeout hint. Depending on the database in use and the locking mechanisms used by the provider, this hint may or may not be observed.- Specified by:
setHintin interfaceorg.hibernate.query.CommonQueryContract- Specified by:
setHintin interfaceorg.hibernate.query.MutationQuery- Specified by:
setHintin interfaceQuery- Specified by:
setHintin interfaceorg.hibernate.query.Query<R>- Specified by:
setHintin interfaceorg.hibernate.query.SelectionQuery<R>- Specified by:
setHintin interfaceTypedQuery<R>- Overrides:
setHintin classorg.hibernate.query.spi.AbstractQuery<R>- Parameters:
hintName- name of property or hintvalue- value for the property or hint- Returns:
- the same query instance
-
setTimeout
public HibernateOrmSearchQueryAdapter<R> setTimeout(int timeout)
- Specified by:
setTimeoutin interfaceorg.hibernate.query.CommonQueryContract- Specified by:
setTimeoutin interfaceorg.hibernate.query.MutationQuery- Specified by:
setTimeoutin interfaceorg.hibernate.query.Query<R>- Specified by:
setTimeoutin interfaceorg.hibernate.query.SelectionQuery<R>- Overrides:
setTimeoutin classorg.hibernate.query.spi.AbstractQuery<R>
-
applyGraph
public HibernateOrmSearchQueryAdapter<R> applyGraph(org.hibernate.graph.RootGraph graph, org.hibernate.graph.GraphSemantic semantic)
-
scroll
public org.hibernate.query.spi.ScrollableResultsImplementor<R> scroll()
-
doScroll
protected org.hibernate.query.spi.ScrollableResultsImplementor<R> doScroll(org.hibernate.ScrollMode scrollMode)
- Specified by:
doScrollin classorg.hibernate.query.spi.AbstractSelectionQuery<R>
-
doList
protected List<R> doList()
- Specified by:
doListin classorg.hibernate.query.spi.AbstractSelectionQuery<R>
-
beforeQuery
protected void beforeQuery()
- Overrides:
beforeQueryin classorg.hibernate.query.spi.AbstractSelectionQuery<R>
-
getHints
public Map<String,Object> getHints()
Description copied from interface:QueryGet the properties and hints and associated values that are in effect for the query instance.
-
getParameterMetadata
public org.hibernate.query.spi.ParameterMetadataImplementor getParameterMetadata()
- Specified by:
getParameterMetadatain interfaceorg.hibernate.query.Query<R>- Specified by:
getParameterMetadatain classorg.hibernate.query.spi.AbstractCommonQueryContract
-
getParameterBindings
public org.hibernate.query.spi.QueryParameterBindings getParameterBindings()
-
getQueryParameterBindings
public org.hibernate.query.spi.QueryParameterBindings getQueryParameterBindings()
- Specified by:
getQueryParameterBindingsin interfaceorg.hibernate.query.spi.DomainQueryExecutionContext- Specified by:
getQueryParameterBindingsin classorg.hibernate.query.spi.AbstractCommonQueryContract
-
locateBinding
protected <P> org.hibernate.query.spi.QueryParameterBinding<P> locateBinding(String name)
- Overrides:
locateBindingin classorg.hibernate.query.spi.AbstractCommonQueryContract
-
locateBinding
protected <P> org.hibernate.query.spi.QueryParameterBinding<P> locateBinding(int position)
- Overrides:
locateBindingin classorg.hibernate.query.spi.AbstractCommonQueryContract
-
locateBinding
protected <P> org.hibernate.query.spi.QueryParameterBinding<P> locateBinding(Parameter<P> parameter)
- Overrides:
locateBindingin classorg.hibernate.query.spi.AbstractCommonQueryContract
-
locateBinding
protected <P> org.hibernate.query.spi.QueryParameterBinding<P> locateBinding(org.hibernate.query.spi.QueryParameterImplementor<P> parameter)
- Overrides:
locateBindingin classorg.hibernate.query.spi.AbstractCommonQueryContract
-
setTupleTransformer
public <T> org.hibernate.query.spi.QueryImplementor<T> setTupleTransformer(org.hibernate.query.TupleTransformer<T> transformer)
-
setResultListTransformer
public org.hibernate.query.spi.QueryImplementor<R> setResultListTransformer(org.hibernate.query.ResultListTransformer<R> resultListTransformer)
-
setLockMode
public HibernateOrmSearchQueryAdapter<R> setLockMode(LockModeType lockModeType)
Description copied from interface:TypedQuerySet the lock mode type to be used for the query execution.- Specified by:
setLockModein interfaceQuery- Specified by:
setLockModein interfaceorg.hibernate.query.Query<R>- Specified by:
setLockModein interfaceorg.hibernate.query.SelectionQuery<R>- Specified by:
setLockModein interfaceTypedQuery<R>- Overrides:
setLockModein classorg.hibernate.query.spi.AbstractQuery<R>- Parameters:
lockModeType- lock mode- Returns:
- the same query instance
-
getLockMode
public LockModeType getLockMode()
Description copied from interface:QueryGet the current lock mode for the query. Returns null if a lock mode has not been set on the query object.- Specified by:
getLockModein interfaceQuery- Specified by:
getLockModein interfaceorg.hibernate.query.SelectionQuery<R>- Overrides:
getLockModein classorg.hibernate.query.spi.AbstractQuery<R>- Returns:
- lock mode
-
getLockOptions
public org.hibernate.LockOptions getLockOptions()
-
executeUpdate
public int executeUpdate() throws org.hibernate.HibernateExceptionDescription copied from interface:QueryExecute an update or delete statement.- Specified by:
executeUpdatein interfaceorg.hibernate.query.MutationQuery- Specified by:
executeUpdatein interfaceQuery- Specified by:
executeUpdatein interfaceorg.hibernate.query.Query<R>- Overrides:
executeUpdatein classorg.hibernate.query.spi.AbstractQuery<R>- Returns:
- the number of entities updated or deleted
- Throws:
org.hibernate.HibernateException
-
doExecuteUpdate
protected int doExecuteUpdate()
- Specified by:
doExecuteUpdatein classorg.hibernate.query.spi.AbstractQuery<R>
-
setLockMode
public HibernateOrmSearchQueryAdapter<R> setLockMode(String alias, org.hibernate.LockMode lockMode)
-
-