public abstract class HstQueryBuilder extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HstQueryBuilder.Order |
Modifier | Constructor and Description |
---|---|
protected |
HstQueryBuilder() |
public static HstQueryBuilder create(HippoBean... scopeBeans) throws RuntimeQueryException
HstQueryBuilder
instance for scopeBeans
.scopeBeans
- Array of the scopes for the HstQuery
returned by build()
. Note
at least 1 non-null-value must be suppliedHstQueryBuilder
instanceRuntimeQueryException
- if there is not at least 1 non-null-value in scopeBeans
public static HstQueryBuilder create(javax.jcr.Node... scopeNodes) throws RuntimeQueryException
HstQueryBuilder
instance for scopeNodes
.scopeNodes
- Array of the scopes for the HstQuery
returned by build()
. Note
at least 1 non-null-value must be suppliedHstQueryBuilder
instanceRuntimeQueryException
- if there is not at least 1 non-null-value in scopeNodes
public HstQuery build() throws RuntimeQueryException
HstQuery
for this HstQueryBuilder
where the backing HstQueryManager
is taken
from HstRequestContext.getQueryManager()
RuntimeQueryException
- in case the #build results in a QueryException
or FilterException
public abstract HstQuery build(HstQueryManager queryManager) throws RuntimeQueryException
HstQuery
for this HstQueryBuilder
where the backing HstQueryManager
is provided
by the argument queryManager
RuntimeQueryException
- in case the #build results in a QueryException
or FilterException
public HstQueryBuilder ofTypes(Class<? extends HippoBean>... ofTypeClazzes)
ofTypeClazzes
- the result most return documents only of types
where subtypes are included.
If ofTypeClazzes
is null
the parameter is ignoredHstQueryBuilder
instancepublic HstQueryBuilder ofTypes(String... ofTypeClazzes)
ofTypeClazzes
- the result most return documents only of types
where subtypes are included.
If ofTypeClazzes
is null
the parameter is ignoredHstQueryBuilder
instancepublic HstQueryBuilder ofPrimaryTypes(String... primaryNodeTypes)
primaryNodeTypes
- the result most return documents only of primaryNodeTypeNames
where subtypes
are not included. If primaryNodeTypes
is null
the parameter is ignoredHstQueryBuilder
instancepublic HstQueryBuilder ofPrimaryTypes(Class<? extends HippoBean>... primaryNodeTypeClazzes)
primaryNodeTypeClazzes
- the result most return documents only of primaryNodeTypeNames
where subtypes
are not included. If primaryNodeTypes
is null
the parameter is ignoredHstQueryBuilder
instancepublic HstQueryBuilder excludeScopes(javax.jcr.Node... excludeScopeNodes)
public HstQueryBuilder excludeScopes(HippoBean... excludeScopeBeans)
protected List<javax.jcr.Node> excludeScopes()
public HstQueryBuilder where(Constraint constraint)
protected Constraint where()
public HstQueryBuilder orderBy(HstQueryBuilder.Order order, String... fieldNames)
order
- the HstQueryBuilder.Order
in which the results should be ordered. If null
, the order is ascendingfieldNames
- the fieldNames
to order on in sortOrder
sort order. The fieldNames
argument
can be null
in which case it is just ignored. A field name in the array that is empty is
skipped.HstQueryBuilder
instancepublic HstQueryBuilder orderByCaseInsensitive(HstQueryBuilder.Order order, String... fieldNames)
order
- the HstQueryBuilder.Order
in which the results should be ordered. If null
, the order is ascendingfieldNames
- the fieldNames
to order on case insensitive in sortOrder
sort order. The fieldNames
argument
can be null
in which case it is just ignored. A field name in the array that is empty is
skipped.HstQueryBuilder
instancepublic HstQueryBuilder orderByAscending(String... fieldNames)
fieldNames
- the fieldNames
to order on in ascending sort order. The fieldNames
argument
can be null
in which case it is just ignored. A field name in the array that is empty is
skipped.HstQueryBuilder
instancepublic HstQueryBuilder orderByAscendingCaseInsensitive(String... fieldNames)
fieldNames
- the fieldNames
to order on case insensitive in sort order. The fieldNames
argument
can be null
in which case it is just ignored. A field name in the array that is empty is
skipped.HstQueryBuilder
instancepublic HstQueryBuilder orderByDescending(String... fieldNames)
fieldNames
- the fieldNames
to order on in descending sort order. The fieldNames
argument
can be null
in which case it is just ignored. A field name in the array that is empty is
skipped.HstQueryBuilder
instancepublic HstQueryBuilder orderByDescendingCaseInsensitive(String... fieldNames)
fieldNames
- the fieldNames
to order on case insensitive in descending sort order. The fieldNames
argument
can be null
in which case it is just ignored. A field name in the array that is empty is
skipped.HstQueryBuilder
instancepublic HstQueryBuilder offset(int offset)
-1
which means it is ignored. A negative offset will be ignoredoffset
- the offset
to use, negative values will be ignoredpublic HstQueryBuilder limit(int limit)
limit
- the limit
to use, negative values will be ignoredCopyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.