|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.search.jpa.impl.FullTextQueryImpl
public class FullTextQueryImpl
Implements JPA 2 query interface and delegate the call to a Hibernate Core FullTextQuery. This has the consequence of "duplicating" the JPA 2 query logic in some areas.
Field Summary |
---|
Fields inherited from interface org.hibernate.search.ProjectionConstants |
---|
DOCUMENT, DOCUMENT_ID, EXPLANATION, ID, OBJECT_CLASS, SCORE, THIS |
Constructor Summary | |
---|---|
FullTextQueryImpl(FullTextQuery query,
Session session)
|
Method Summary | ||
---|---|---|
void |
disableFullTextFilter(String name)
Disable a given filter by its name |
|
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()
|
|
javax.persistence.FlushModeType |
getFlushMode()
|
|
Map<String,Object> |
getHints()
|
|
javax.persistence.LockModeType |
getLockMode()
|
|
int |
getMaxResults()
|
|
javax.persistence.Parameter<?> |
getParameter(int position)
|
|
|
getParameter(int position,
Class<T> type)
|
|
javax.persistence.Parameter<?> |
getParameter(String name)
|
|
|
getParameter(String name,
Class<T> type)
|
|
Set<javax.persistence.Parameter<?>> |
getParameters()
|
|
Object |
getParameterValue(int position)
|
|
|
getParameterValue(javax.persistence.Parameter<T> param)
|
|
Object |
getParameterValue(String name)
|
|
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. |
|
Object |
getSingleResult()
|
|
boolean |
hasPartialResults()
*Experimental* API, subject to change or removal When using FullTextQuery.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. |
|
FullTextQuery |
initializeObjectsWith(ObjectLookupMethod lookupMethod,
DatabaseRetrievalMethod retrievalMethod)
Refine the strategies used to load entities. |
|
boolean |
isBound(javax.persistence.Parameter<?> param)
|
|
FullTextQuery |
limitExecutionTimeTo(long timeout,
TimeUnit timeUnit)
*Experimental* API, subject to change or removal Limit the time used by Hibernate Search to execute the query. |
|
FullTextQuery |
setCriteriaQuery(Criteria criteria)
Defines the Database Query used to load the Lucene results. |
|
FullTextQuery |
setFilter(org.apache.lucene.search.Filter filter)
Allows to use lucene filters. |
|
javax.persistence.Query |
setFirstResult(int firstResult)
|
|
javax.persistence.Query |
setFlushMode(javax.persistence.FlushModeType flushMode)
|
|
javax.persistence.Query |
setHint(String hintName,
Object value)
|
|
javax.persistence.Query |
setLockMode(javax.persistence.LockModeType lockModeType)
|
|
javax.persistence.Query |
setMaxResults(int maxResults)
|
|
javax.persistence.Query |
setParameter(int position,
Calendar value,
javax.persistence.TemporalType temporalType)
|
|
javax.persistence.Query |
setParameter(int position,
Date value,
javax.persistence.TemporalType temporalType)
|
|
javax.persistence.Query |
setParameter(int position,
Object value)
|
|
javax.persistence.Query |
setParameter(javax.persistence.Parameter<Calendar> calendarParameter,
Calendar calendar,
javax.persistence.TemporalType temporalType)
|
|
javax.persistence.Query |
setParameter(javax.persistence.Parameter<Date> dateParameter,
Date date,
javax.persistence.TemporalType temporalType)
|
|
|
setParameter(javax.persistence.Parameter<T> tParameter,
T t)
|
|
javax.persistence.Query |
setParameter(String name,
Calendar value,
javax.persistence.TemporalType temporalType)
|
|
javax.persistence.Query |
setParameter(String name,
Date value,
javax.persistence.TemporalType temporalType)
|
|
javax.persistence.Query |
setParameter(String name,
Object value)
|
|
FullTextQuery |
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). |
|
FullTextQuery |
setResultTransformer(ResultTransformer transformer)
defines a result transformer used during projection |
|
FullTextQuery |
setSort(org.apache.lucene.search.Sort sort)
Allows to let lucene sort the results. |
|
|
unwrap(Class<T> type)
|
|
javax.persistence.PersistenceException |
wrapLockException(HibernateException e,
LockOptions lockOptions)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FullTextQueryImpl(FullTextQuery query, Session session)
Method Detail |
---|
public FullTextQuery setSort(org.apache.lucene.search.Sort sort)
FullTextQuery
setSort
in interface FullTextQuery
sort
- The lucene sort object.
public FullTextQuery setFilter(org.apache.lucene.search.Filter filter)
FullTextQuery
setFilter
in interface FullTextQuery
filter
- The lucene filter.
public int getResultSize()
FullTextQuery
getResultList().size()
because getResultList()
may be not in sync with the database at the time of query.
getResultSize
in interface FullTextQuery
public FullTextQuery setCriteriaQuery(Criteria criteria)
FullTextQuery
setCriteriaQuery
in interface FullTextQuery
public FullTextQuery setProjection(String... fields)
FullTextQuery
TwoWayFieldBridge
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 FullTextQuery
public FullTextFilter enableFullTextFilter(String name)
FullTextQuery
enableFullTextFilter
in interface FullTextQuery
public void disableFullTextFilter(String name)
FullTextQuery
disableFullTextFilter
in interface FullTextQuery
public FullTextQuery setResultTransformer(ResultTransformer transformer)
FullTextQuery
setResultTransformer
in interface FullTextQuery
public List getResultList()
getResultList
in interface javax.persistence.Query
public FacetManager getFacetManager()
getFacetManager
in interface FullTextQuery
public javax.persistence.PersistenceException wrapLockException(HibernateException e, LockOptions lockOptions)
public Object getSingleResult()
getSingleResult
in interface javax.persistence.Query
public javax.persistence.Query setMaxResults(int maxResults)
setMaxResults
in interface javax.persistence.Query
public int getMaxResults()
getMaxResults
in interface javax.persistence.Query
public javax.persistence.Query setFirstResult(int firstResult)
setFirstResult
in interface javax.persistence.Query
public int getFirstResult()
getFirstResult
in interface javax.persistence.Query
public org.apache.lucene.search.Explanation explain(int documentId)
FullTextQuery
Explanation
object describing the score computation for the matching object/document
in the current query
explain
in interface FullTextQuery
documentId
- Lucene Document id to be explain. This is NOT the object id
public FullTextQuery limitExecutionTimeTo(long timeout, TimeUnit timeUnit)
FullTextQuery
FullTextQuery.hasPartialResults()
returns true.
limitExecutionTimeTo
in interface FullTextQuery
timeout
- time out periodtimeUnit
- time out unitpublic boolean hasPartialResults()
FullTextQuery
FullTextQuery.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.
hasPartialResults
in interface FullTextQuery
public FullTextQuery initializeObjectsWith(ObjectLookupMethod lookupMethod, DatabaseRetrievalMethod retrievalMethod)
FullTextQuery
initializeObjectsWith
in interface FullTextQuery
public int executeUpdate()
executeUpdate
in interface javax.persistence.Query
public javax.persistence.Query setHint(String hintName, Object value)
setHint
in interface javax.persistence.Query
public Map<String,Object> getHints()
getHints
in interface javax.persistence.Query
public <T> javax.persistence.Query setParameter(javax.persistence.Parameter<T> tParameter, T t)
setParameter
in interface javax.persistence.Query
public javax.persistence.Query setParameter(javax.persistence.Parameter<Calendar> calendarParameter, Calendar calendar, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
public javax.persistence.Query setParameter(javax.persistence.Parameter<Date> dateParameter, Date date, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
public javax.persistence.Query setParameter(String name, Object value)
setParameter
in interface javax.persistence.Query
public javax.persistence.Query setParameter(String name, Date value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
public javax.persistence.Query setParameter(String name, Calendar value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
public javax.persistence.Query setParameter(int position, Object value)
setParameter
in interface javax.persistence.Query
public javax.persistence.Query setParameter(int position, Date value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
public Set<javax.persistence.Parameter<?>> getParameters()
getParameters
in interface javax.persistence.Query
public javax.persistence.Query setParameter(int position, Calendar value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
public javax.persistence.Parameter<?> getParameter(String name)
getParameter
in interface javax.persistence.Query
public javax.persistence.Parameter<?> getParameter(int position)
getParameter
in interface javax.persistence.Query
public <T> javax.persistence.Parameter<T> getParameter(String name, Class<T> type)
getParameter
in interface javax.persistence.Query
public <T> javax.persistence.Parameter<T> getParameter(int position, Class<T> type)
getParameter
in interface javax.persistence.Query
public boolean isBound(javax.persistence.Parameter<?> param)
isBound
in interface javax.persistence.Query
public <T> T getParameterValue(javax.persistence.Parameter<T> param)
getParameterValue
in interface javax.persistence.Query
public Object getParameterValue(String name)
getParameterValue
in interface javax.persistence.Query
public Object getParameterValue(int position)
getParameterValue
in interface javax.persistence.Query
public javax.persistence.Query setFlushMode(javax.persistence.FlushModeType flushMode)
setFlushMode
in interface javax.persistence.Query
public javax.persistence.FlushModeType getFlushMode()
getFlushMode
in interface javax.persistence.Query
public javax.persistence.Query setLockMode(javax.persistence.LockModeType lockModeType)
setLockMode
in interface javax.persistence.Query
public javax.persistence.LockModeType getLockMode()
getLockMode
in interface javax.persistence.Query
public <T> T unwrap(Class<T> type)
unwrap
in interface javax.persistence.Query
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |