Interface HstQuery
-
public interface HstQuery
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_LIMIT
The default limit that is used for a HstQuery.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addOrderByAscending(String fieldNameAttribute)
Order the object found case sensitive ascendingvoid
addOrderByAscendingCaseInsensitive(String fieldNameAttribute)
Order the object found case insensitive ascendingvoid
addOrderByDescending(String fieldNameAttribute)
Order the object found case sensitive descendingvoid
addOrderByDescendingCaseInsensitive(String fieldNameAttribute)
Order the object found case insensitive descendingvoid
addScopes(List<HippoBean> scopes)
add scopes to search in.void
addScopes(javax.jcr.Node[] scopes)
add scopes to search in.Filter
createFilter()
void
excludeScopes(List<HippoBean> scopes)
add scopes to exclude from search.void
excludeScopes(javax.jcr.Node[] scopes)
add scopes to exclude from search.HstQueryResult
execute()
The actual execution of the HstQuery.BaseFilter
getFilter()
int
getLimit()
Returns the limit of the HstQuery.int
getOffset()
Returns the offset of the HstQuery.String
getQueryAsString(boolean skipDefaultOrderBy)
Returns the query as string.void
setFilter(BaseFilter filter)
void
setLimit(int limit)
Sets the limit of search results.void
setOffset(int offset)
Sets the offset to start searching from.
-
-
-
Field Detail
-
DEFAULT_LIMIT
static final int DEFAULT_LIMIT
The default limit that is used for a HstQuery. UsesetLimit(int)
if you need to override this value.- See Also:
- Constant Field Values
-
-
Method Detail
-
setFilter
void setFilter(BaseFilter filter)
-
getFilter
BaseFilter getFilter()
-
createFilter
Filter createFilter()
- Returns:
- a new empty Filter
-
setLimit
void setLimit(int limit)
Sets the limit of search results. Note that setting this value very high might influence performance negatively- Parameters:
limit
-
-
getQueryAsString
String getQueryAsString(boolean skipDefaultOrderBy) throws QueryException
Returns the query as string. WhenskipDefaultOrder
isTRUE, the string representation will only include an 'order by' clause when there is set one explicitly. - Parameters:
skipDefaultOrderBy
-- Returns:
- the query as string
- Throws:
QueryException
- if we cannot build the query string
-
getLimit
int getLimit()
Returns the limit of the HstQuery. If no limit is set, it returns the default HstQuery limitDEFAULT_LIMIT
- Returns:
- the limit
-
setOffset
void setOffset(int offset)
Sets the offset to start searching from. Default offset is-1
which means it is ignored. A negative offset will be ignored- Parameters:
offset
-
-
getOffset
int getOffset()
Returns the offset of the HstQuery. If no offset is set throughsetOffset(int)
, the offset will be-1
and will be ignored- Returns:
- the offset
-
addOrderByAscending
void addOrderByAscending(String fieldNameAttribute)
Order the object found case sensitive ascending- Parameters:
fieldNameAttribute
- the name of the field used to sort the search result
-
addOrderByAscendingCaseInsensitive
void addOrderByAscendingCaseInsensitive(String fieldNameAttribute)
Order the object found case insensitive ascending- Parameters:
fieldNameAttribute
- the name of the field used to sort the search result
-
addOrderByDescending
void addOrderByDescending(String fieldNameAttribute)
Order the object found case sensitive descending- Parameters:
fieldNameAttribute
- the name of the field used to sort the search result
-
addOrderByDescendingCaseInsensitive
void addOrderByDescendingCaseInsensitive(String fieldNameAttribute)
Order the object found case insensitive descending- Parameters:
fieldNameAttribute
- the name of the field used to sort the search result
-
addScopes
void addScopes(List<HippoBean> scopes)
add scopes to search in. If the exact scope is already added to exclude from the search, it is removed from the excluded list.- Parameters:
scopes
-
-
addScopes
void addScopes(javax.jcr.Node[] scopes)
add scopes to search in. If the exact scope is already added to exclude from the search, it is removed from the excluded list.- Parameters:
scopes
-
-
excludeScopes
void excludeScopes(List<HippoBean> scopes)
add scopes to exclude from search. If the exact scope is already added as a scope to search in, it is removed from there- Parameters:
scopes
-
-
excludeScopes
void excludeScopes(javax.jcr.Node[] scopes)
add scopes to exclude from search. If the exact scope is already added as a scope to search in, it is removed from there- Parameters:
scopes
-
-
execute
HstQueryResult execute() throws QueryException
The actual execution of the HstQuery. The HstQueryResult will never contain one and the same result twice. So, if a result matches the search criteria twice, it is still returned as one hit.- Returns:
HstQueryResult
- Throws:
QueryException
-
-