T
- public class SearchQuery<T> extends Object implements SimpleQuery<SearchQuery<T>>, SimpleProjectable<T>
Constructor and Description |
---|
SearchQuery(org.hibernate.search.FullTextSession session,
EntityPath<T> path)
Create a new SearchQuery instance
|
SearchQuery(org.hibernate.Session session,
EntityPath<T> path) |
Modifier and Type | Method and Description |
---|---|
long |
count()
Get the count of matched elements
|
SearchQuery<T> |
distinct()
Set the Query to return distinct results
|
boolean |
exists() |
com.mysema.commons.lang.CloseableIterator<T> |
iterate()
Get the projection as a typed closeable Iterator
|
com.mysema.commons.lang.CloseableIterator<T> |
iterateDistinct() |
SearchQuery<T> |
limit(long limit)
Set the limit / max results for the query results
|
List<T> |
list()
Get the projection as a typed List
|
SearchResults<T> |
listResults()
Get the projection in
SearchResults form |
boolean |
notExists() |
SearchQuery<T> |
offset(long offset)
Set the offset for the query results
|
SearchQuery<T> |
orderBy(OrderSpecifier<?>... o)
Add order expressions
|
SearchQuery<T> |
restrict(QueryModifiers modifiers)
Set both limit and offset of the query results
|
<P> SearchQuery<T> |
set(ParamExpression<P> param,
P value)
Set the given parameter to the given value
|
T |
singleResult()
Get the projection as a single result or null if no result is found
|
T |
uniqueResult()
Get the projection as a unique result or null if no result is found
|
SearchQuery<T> |
where(Predicate... e)
Adds the given filter conditions
|
public SearchQuery(org.hibernate.search.FullTextSession session, EntityPath<T> path)
session
- path
- public SearchQuery(org.hibernate.Session session, EntityPath<T> path)
public boolean exists()
exists
in interface SimpleProjectable<T>
public boolean notExists()
notExists
in interface SimpleProjectable<T>
public long count()
SimpleProjectable
count
in interface SimpleProjectable<T>
public SearchQuery<T> distinct()
SimpleQuery
distinct
in interface SimpleQuery<SearchQuery<T>>
public com.mysema.commons.lang.CloseableIterator<T> iterate()
SimpleProjectable
iterate
in interface SimpleProjectable<T>
public com.mysema.commons.lang.CloseableIterator<T> iterateDistinct()
public SearchQuery<T> limit(long limit)
SimpleQuery
limit
in interface SimpleQuery<SearchQuery<T>>
public List<T> list()
SimpleProjectable
list
in interface SimpleProjectable<T>
public SearchResults<T> listResults()
SimpleProjectable
SearchResults
formlistResults
in interface SimpleProjectable<T>
public SearchQuery<T> offset(long offset)
SimpleQuery
offset
in interface SimpleQuery<SearchQuery<T>>
public SearchQuery<T> orderBy(OrderSpecifier<?>... o)
SimpleQuery
orderBy
in interface SimpleQuery<SearchQuery<T>>
public SearchQuery<T> restrict(QueryModifiers modifiers)
SimpleQuery
restrict
in interface SimpleQuery<SearchQuery<T>>
public <P> SearchQuery<T> set(ParamExpression<P> param, P value)
SimpleQuery
set
in interface SimpleQuery<SearchQuery<T>>
public T singleResult()
SimpleProjectable
for multiple results only the first one is returned
singleResult
in interface SimpleProjectable<T>
public T uniqueResult()
SimpleProjectable
uniqueResult
in interface SimpleProjectable<T>
public SearchQuery<T> where(Predicate... e)
FilteredClause
Skips null arguments
where
in interface FilteredClause<SearchQuery<T>>
e
- filter conditions to be addedCopyright © 2007–2015 Mysema Ltd. All rights reserved.