public class FullTextQueryImpl extends org.hibernate.query.internal.AbstractProducedQuery implements FullTextQuery
FullTextQuery.DOCUMENT, DOCUMENT_ID, EXPLANATION, ID, OBJECT_CLASS, SCORE, SPATIAL_DISTANCE, THIS| Constructor and Description |
|---|
FullTextQueryImpl(HSQuery hSearchQuery,
org.hibernate.engine.spi.SessionImplementor session,
org.hibernate.query.ParameterMetadata parameterMetadata)
Constructs a
FullTextQueryImpl instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
disableFullTextFilter(String name)
Disable a given filter by its name
|
int |
doGetResultSize() |
protected List |
doHibernateSearchList() |
FullTextFilter |
enableFullTextFilter(String name)
Enable a given filter by its name.
|
int |
executeUpdate() |
org.apache.lucene.search.Explanation |
explain(int documentId)
Return the Lucene
Explanation
object describing the score computation for the matching object/document
in the current query |
FacetManager |
getFacetManager() |
int |
getFirstResult() |
Map<String,Object> |
getHints() |
javax.persistence.LockModeType |
getLockMode() |
protected Map |
getLockModes() |
org.hibernate.LockOptions |
getLockOptions() |
int |
getMaxResults() |
javax.persistence.Parameter<?> |
getParameter(int position) |
javax.persistence.Parameter |
getParameter(int position,
Class type) |
javax.persistence.Parameter<?> |
getParameter(String name) |
javax.persistence.Parameter |
getParameter(String name,
Class type) |
Set<javax.persistence.Parameter<?>> |
getParameters() |
Object |
getParameterValue(int position) |
Object |
getParameterValue(javax.persistence.Parameter param) |
Object |
getParameterValue(String name) |
String |
getQueryString() |
List |
getResultList() |
int |
getResultSize()
Returns the number of hits for this search
Caution:
The number of results might be slightly different from
getResultList().size() because getResultList()
may be not in sync with the database at the time of query. |
String[] |
getReturnAliases()
Deprecated.
|
org.hibernate.type.Type[] |
getReturnTypes()
Deprecated.
|
boolean |
hasPartialResults() |
FullTextQueryImpl |
initializeObjectsWith(ObjectLookupMethod lookupMethod,
DatabaseRetrievalMethod retrievalMethod)
Refine the strategies used to load entities.
|
boolean |
isBound(javax.persistence.Parameter param) |
protected boolean |
isNativeQuery() |
Iterator |
iterate()
Return an iterator on the results.
|
FullTextQueryImpl |
limitExecutionTimeTo(long timeout,
TimeUnit timeUnit)
Limit the time used by Hibernate Search to execute the query.
|
List |
list() |
ScrollableResultsImpl |
scroll() |
org.hibernate.query.spi.ScrollableResultsImplementor |
scroll(org.hibernate.ScrollMode scrollMode) |
FullTextQueryImpl |
setCriteriaQuery(org.hibernate.Criteria criteria)
Defines the Database Query used to load the Lucene results.
|
FullTextQueryImpl |
setEntity(int position,
Object val)
Deprecated.
|
FullTextQueryImpl |
setEntity(String name,
Object val)
Deprecated.
|
FullTextQueryImpl |
setFetchSize(int fetchSize) |
FullTextQueryImpl |
setFilter(org.apache.lucene.search.Filter filter)
Deprecated.
|
FullTextQuery |
setFirstResult(int firstResult) |
FullTextQueryImpl |
setFlushMode(javax.persistence.FlushModeType flushModeType) |
FullTextQuery |
setHint(String hintName,
Object value) |
FullTextQueryImpl |
setLockMode(javax.persistence.LockModeType lockModeType) |
org.hibernate.query.spi.QueryImplementor |
setLockMode(String alias,
org.hibernate.LockMode lockMode) |
org.hibernate.query.spi.QueryImplementor |
setLockOptions(org.hibernate.LockOptions lockOptions) |
FullTextQuery |
setMaxResults(int maxResults) |
FullTextQueryImpl |
setParameter(int position,
Calendar value,
javax.persistence.TemporalType temporalType) |
FullTextQueryImpl |
setParameter(int position,
Date value,
javax.persistence.TemporalType temporalType) |
FullTextQueryImpl |
setParameter(int position,
Object value) |
FullTextQueryImpl |
setParameter(javax.persistence.Parameter calendarParameter,
Calendar calendar,
javax.persistence.TemporalType temporalType) |
FullTextQueryImpl |
setParameter(javax.persistence.Parameter dateParameter,
Date date,
javax.persistence.TemporalType temporalType) |
FullTextQueryImpl |
setParameter(javax.persistence.Parameter tParameter,
Object t) |
FullTextQueryImpl |
setParameter(String name,
Calendar value,
javax.persistence.TemporalType temporalType) |
FullTextQueryImpl |
setParameter(String name,
Date value,
javax.persistence.TemporalType temporalType) |
FullTextQueryImpl |
setParameter(String name,
Object value) |
FullTextQueryImpl |
setProjection(String... fields)
Defines the Lucene field names projected and returned in a query result
Each field is converted back to it's object representation, an Object[] being returned for each "row"
(similar to an HQL or a Criteria API projection).
|
FullTextQueryImpl |
setResultTransformer(org.hibernate.transform.ResultTransformer transformer)
Deprecated.
|
FullTextQueryImpl |
setSort(org.apache.lucene.search.Sort sort)
Allows to let lucene sort the results.
|
FullTextQueryImpl |
setSpatialParameters(Coordinates center,
String fieldName)
Defines the center of the spatial search for this query to project distance in results
|
FullTextQueryImpl |
setSpatialParameters(double latitude,
double longitude,
String fieldName)
Defines the center of the spatial search for this query to project distance in results
|
FullTextQueryImpl |
setTimeout(int timeout) |
FullTextQueryImpl |
setTimeout(long timeout,
TimeUnit timeUnit)
Define a timeout period for a given unit of time.
|
String |
toString() |
Object |
unwrap(Class type) |
addQueryHint, afterQuery, applyAliasSpecificLockModeHint, applyCacheableHint, applyCacheModeHint, applyCacheRegionHint, applyCommentHint, applyEntityGraphQueryHint, applyFetchSizeHint, applyFlushModeHint, applyFollowOnLockingHint, applyHibernateLockModeHint, applyJpaCacheRetrieveMode, applyJpaCacheStoreMode, applyLockModeTypeHint, applyLockTimeoutHint, applyNativeQueryLockMode, applyPassDistinctThrough, applyReadOnlyHint, applyTimeoutHint, beforeQuery, canApplyAliasSpecificLockModeHints, collectBaselineHints, collectHints, determineProperBooleanType, determineProperBooleanType, determineType, doExecuteUpdate, doIterate, doList, doScroll, getCacheMode, getCacheRegion, getComment, getExceptionConverter, getFetchSize, getFlushMode, getHibernateFlushMode, getNamedParameterMap, getNamedParameters, getParameterMetadata, getPositionalParameterTypes, getPositionalParameterValues, getProducer, getQueryOptions, getQueryParameterBindings, getQueryParameters, getSingleResult, getSupportedHints, getTimeout, isCacheable, isCallable, isReadOnly, putIfNotNull, putIfNotNull, resolveEntityName, setCacheable, setCacheMode, setCacheRegion, setComment, setFlushMode, setHibernateFlushMode, setOptionalEntityName, setOptionalId, setOptionalObject, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setProperties, setProperties, setReadOnly, stream, uniqueElement, uniqueResult, uniqueResultOptionalclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetProducer, setOptionalEntityName, setOptionalId, setOptionalObjectaddQueryHint, getCacheMode, getCacheRegion, getComment, getFetchSize, getHibernateFlushMode, getParameterMetadata, getQueryOptions, getSingleResult, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBinary, setBinary, setBoolean, setBoolean, setByte, setByte, setCacheable, setCacheMode, setCacheRegion, setCalendar, setCalendar, setCalendarDate, setCalendarDate, setCharacter, setCharacter, setComment, setDate, setDate, setDouble, setDouble, setFloat, setFloat, setFlushMode, setHibernateFlushMode, setInteger, setInteger, setLocale, setLocale, setLong, setLong, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameters, setProperties, setProperties, setReadOnly, setSerializable, setSerializable, setShort, setShort, setString, setString, setText, setText, setTime, setTime, setTimestamp, setTimestamp, stream, uniqueResult, uniqueResultOptionalpublic FullTextQueryImpl(HSQuery hSearchQuery, org.hibernate.engine.spi.SessionImplementor session, org.hibernate.query.ParameterMetadata parameterMetadata)
FullTextQueryImpl instance.hSearchQuery - The querysession - Access to the Hibernate session.parameterMetadata - Additional query metadata.public FullTextQueryImpl setSort(org.apache.lucene.search.Sort sort)
FullTextQuerysetSort in interface FullTextQuerysort - The lucene sort object.@Deprecated public FullTextQueryImpl setFilter(org.apache.lucene.search.Filter filter)
FullTextQuerysetFilter in interface FullTextQueryfilter - The Lucene filter.Filterpublic List getResultList()
getResultList in interface javax.persistence.QuerygetResultList in interface javax.persistence.TypedQuerypublic Iterator iterate()
iterate in class org.hibernate.query.internal.AbstractProducedQuerypublic ScrollableResultsImpl scroll()
scroll in class org.hibernate.query.internal.AbstractProducedQuerypublic org.hibernate.query.spi.ScrollableResultsImplementor scroll(org.hibernate.ScrollMode scrollMode)
scroll in class org.hibernate.query.internal.AbstractProducedQuerypublic List list()
list in class org.hibernate.query.internal.AbstractProducedQueryprotected List doHibernateSearchList()
public org.apache.lucene.search.Explanation explain(int documentId)
FullTextQueryExplanation
object describing the score computation for the matching object/document
in the current queryexplain in interface FullTextQuerydocumentId - Lucene Document id to be explain. This is NOT the object idExplanationpublic int getResultSize()
FullTextQuerygetResultList().size() because getResultList()
may be not in sync with the database at the time of query.getResultSize in interface FullTextQuerypublic int doGetResultSize()
public FullTextQueryImpl setCriteriaQuery(org.hibernate.Criteria criteria)
FullTextQuerysetCriteriaQuery in interface FullTextQuerycriteria - a query defined using Criteriathis for method chainingpublic FullTextQueryImpl setProjection(String... fields)
FullTextQueryTwoWayFieldBridge
Unless notified in their JavaDoc, all built-in bridges are two-way. All @DocumentId fields are projectable by design.
If the projected field is not a projectable field, null is returned in the object[]setProjection in interface FullTextQueryfields - the fields to use for projectionthis for method chainingpublic FullTextQueryImpl setSpatialParameters(Coordinates center, String fieldName)
FullTextQuerysetSpatialParameters in interface FullTextQuerycenter - the search centerfieldName - name of the spatial fieldthis for method chainingpublic FullTextQueryImpl setSpatialParameters(double latitude, double longitude, String fieldName)
FullTextQuerysetSpatialParameters in interface FullTextQuerylatitude - latitude of the search centerlongitude - longitude of the search centerfieldName - name of the spatial fieldthis for method chainingpublic FullTextQuery setMaxResults(int maxResults)
setMaxResults in interface javax.persistence.QuerysetMaxResults in interface javax.persistence.TypedQuerysetMaxResults in interface FullTextQuerysetMaxResults in class org.hibernate.query.internal.AbstractProducedQuerypublic int getMaxResults()
getMaxResults in interface javax.persistence.QuerygetMaxResults in class org.hibernate.query.internal.AbstractProducedQuerypublic FullTextQuery setFirstResult(int firstResult)
setFirstResult in interface javax.persistence.QuerysetFirstResult in interface javax.persistence.TypedQuerysetFirstResult in interface FullTextQuerysetFirstResult in class org.hibernate.query.internal.AbstractProducedQuerypublic int getFirstResult()
getFirstResult in interface javax.persistence.QuerygetFirstResult in class org.hibernate.query.internal.AbstractProducedQuerypublic FullTextQuery setHint(String hintName, Object value)
setHint in interface javax.persistence.QuerysetHint in interface javax.persistence.TypedQuerysetHint in interface FullTextQuerysetHint in class org.hibernate.query.internal.AbstractProducedQuerypublic Map<String,Object> getHints()
getHints in interface javax.persistence.QuerygetHints in class org.hibernate.query.internal.AbstractProducedQuerypublic FullTextQueryImpl setParameter(javax.persistence.Parameter tParameter, Object t)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.persistence.TypedQuerysetParameter in class org.hibernate.query.internal.AbstractProducedQuerypublic FullTextQueryImpl setParameter(javax.persistence.Parameter calendarParameter, Calendar calendar, javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.persistence.TypedQuerysetParameter in class org.hibernate.query.internal.AbstractProducedQuerypublic FullTextQueryImpl setParameter(javax.persistence.Parameter dateParameter, Date date, javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.persistence.TypedQuerysetParameter in class org.hibernate.query.internal.AbstractProducedQuerypublic FullTextQueryImpl setParameter(String name, Object value)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.persistence.TypedQuerysetParameter in class org.hibernate.query.internal.AbstractProducedQuerypublic FullTextQueryImpl setParameter(String name, Date value, javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.persistence.TypedQuerysetParameter in class org.hibernate.query.internal.AbstractProducedQuerypublic FullTextQueryImpl setParameter(String name, Calendar value, javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.persistence.TypedQuerysetParameter in class org.hibernate.query.internal.AbstractProducedQuerypublic FullTextQueryImpl setParameter(int position, Object value)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.persistence.TypedQuerysetParameter in class org.hibernate.query.internal.AbstractProducedQuerypublic FullTextQueryImpl setParameter(int position, Date value, javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.persistence.TypedQuerysetParameter in class org.hibernate.query.internal.AbstractProducedQuerypublic Set<javax.persistence.Parameter<?>> getParameters()
getParameters in interface javax.persistence.QuerygetParameters in class org.hibernate.query.internal.AbstractProducedQuerypublic FullTextQueryImpl setParameter(int position, Calendar value, javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.persistence.TypedQuerysetParameter in class org.hibernate.query.internal.AbstractProducedQuerypublic javax.persistence.Parameter<?> getParameter(String name)
getParameter in interface javax.persistence.QuerygetParameter in class org.hibernate.query.internal.AbstractProducedQuerypublic javax.persistence.Parameter<?> getParameter(int position)
getParameter in interface javax.persistence.QuerygetParameter in class org.hibernate.query.internal.AbstractProducedQuerypublic javax.persistence.Parameter getParameter(String name, Class type)
getParameter in interface javax.persistence.QuerygetParameter in class org.hibernate.query.internal.AbstractProducedQuerypublic javax.persistence.Parameter getParameter(int position,
Class type)
getParameter in interface javax.persistence.QuerygetParameter in class org.hibernate.query.internal.AbstractProducedQuerypublic boolean isBound(javax.persistence.Parameter param)
isBound in interface javax.persistence.QueryisBound in class org.hibernate.query.internal.AbstractProducedQuerypublic Object getParameterValue(javax.persistence.Parameter param)
getParameterValue in interface javax.persistence.QuerygetParameterValue in class org.hibernate.query.internal.AbstractProducedQuerypublic Object getParameterValue(String name)
getParameterValue in interface javax.persistence.QuerygetParameterValue in class org.hibernate.query.internal.AbstractProducedQuerypublic Object getParameterValue(int position)
getParameterValue in interface javax.persistence.QuerygetParameterValue in class org.hibernate.query.internal.AbstractProducedQuerypublic FullTextQueryImpl setFlushMode(javax.persistence.FlushModeType flushModeType)
setFlushMode in interface javax.persistence.QuerysetFlushMode in interface javax.persistence.TypedQuerysetFlushMode in interface FullTextQuerysetFlushMode in class org.hibernate.query.internal.AbstractProducedQuerypublic FullTextQueryImpl setFetchSize(int fetchSize)
setFetchSize in interface org.hibernate.BasicQueryContractsetFetchSize in class org.hibernate.query.internal.AbstractProducedQuerypublic org.hibernate.query.spi.QueryImplementor setLockOptions(org.hibernate.LockOptions lockOptions)
setLockOptions in class org.hibernate.query.internal.AbstractProducedQuery@Deprecated public FullTextQueryImpl setResultTransformer(org.hibernate.transform.ResultTransformer transformer)
FullTextQuerysetResultTransformer in interface FullTextQuerysetResultTransformer in class org.hibernate.query.internal.AbstractProducedQuerytransformer - the ResultTransformer to use during projectionthis for method chainingpublic Object unwrap(Class type)
unwrap in interface javax.persistence.Queryunwrap in class org.hibernate.query.internal.AbstractProducedQuerytype - the type to unwrapIllegalArgumentException is thrown. Supported types are:
public FullTextQueryImpl setLockMode(javax.persistence.LockModeType lockModeType)
setLockMode in interface javax.persistence.QuerysetLockMode in interface javax.persistence.TypedQuerysetLockMode in class org.hibernate.query.internal.AbstractProducedQuerypublic javax.persistence.LockModeType getLockMode()
getLockMode in interface javax.persistence.QuerygetLockMode in class org.hibernate.query.internal.AbstractProducedQuerypublic org.hibernate.LockOptions getLockOptions()
getLockOptions in class org.hibernate.query.internal.AbstractProducedQuerypublic int executeUpdate()
executeUpdate in interface javax.persistence.QueryexecuteUpdate in class org.hibernate.query.internal.AbstractProducedQuerypublic org.hibernate.query.spi.QueryImplementor setLockMode(String alias, org.hibernate.LockMode lockMode)
setLockMode in class org.hibernate.query.internal.AbstractProducedQueryprotected Map getLockModes()
public FullTextFilter enableFullTextFilter(String name)
FullTextQueryenableFullTextFilter in interface FullTextQueryname - the name of the filterFullTextFilter object that allows filter parameter injectionpublic void disableFullTextFilter(String name)
FullTextQuerydisableFullTextFilter in interface FullTextQueryname - the filter nanepublic FacetManager getFacetManager()
getFacetManager in interface FullTextQuerypublic FullTextQueryImpl setTimeout(int timeout)
setTimeout in interface org.hibernate.BasicQueryContractsetTimeout in class org.hibernate.query.internal.AbstractProducedQuerypublic FullTextQueryImpl setTimeout(long timeout, TimeUnit timeUnit)
FullTextQueryQueryTimeoutException is raised.setTimeout in interface FullTextQuerytimeout - time out periodtimeUnit - time out unitthis to allow method chainingpublic FullTextQueryImpl limitExecutionTimeTo(long timeout, TimeUnit timeUnit)
FullTextQueryFullTextQuery.hasPartialResults() returns true.limitExecutionTimeTo in interface FullTextQuerytimeout - time out periodtimeUnit - time out unitthis for method chainingpublic boolean hasPartialResults()
hasPartialResults in interface FullTextQueryFullTextQuery.limitExecutionTimeTo(long, java.util.concurrent.TimeUnit) }, returns true
if partial results are returned (ie if the time limit has been reached
and the result fetching process has been terminated.public FullTextQueryImpl initializeObjectsWith(ObjectLookupMethod lookupMethod, DatabaseRetrievalMethod retrievalMethod)
FullTextQueryinitializeObjectsWith in interface FullTextQuerylookupMethod - lookup methodretrievalMethod - how to initilize an objectthis for method chainingpublic String getQueryString()
protected boolean isNativeQuery()
isNativeQuery in class org.hibernate.query.internal.AbstractProducedQuery@Deprecated public org.hibernate.type.Type[] getReturnTypes()
getReturnTypes in interface org.hibernate.BasicQueryContract@Deprecated public String[] getReturnAliases()
@Deprecated public FullTextQueryImpl setEntity(int position, Object val)
@Deprecated public FullTextQueryImpl setEntity(String name, Object val)
Copyright © 2006–2017 Hibernate. All rights reserved.