|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.AbstractCriteriaImpl
public abstract class AbstractCriteriaImpl
A generic Criteria implementation.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface net.sourceforge.openutils.mgnlcriteria.jcr.query.TranslatableCriteria |
|---|
TranslatableCriteria.CriterionEntry, TranslatableCriteria.OrderEntry |
| Field Summary | |
|---|---|
protected Class<?> |
classType
|
protected List<TranslatableCriteria.CriterionEntry> |
criterionEntries
|
protected boolean |
forcePagingWithDocumentOrder
|
protected org.slf4j.Logger |
log
|
protected int |
maxResults
|
protected int |
offset
|
protected List<TranslatableCriteria.OrderEntry> |
orderEntries
|
protected String |
path
|
protected String |
spellCheckString
|
protected String |
workspace
|
| Constructor Summary | |
|---|---|
protected |
AbstractCriteriaImpl()
|
| Method Summary | |
|---|---|
Criteria |
add(Criterion criterion)
Add a restriction to constrain the results to be retrieved. |
Criteria |
addOrder(Order order)
Add an ordering to the result set. |
AdvancedResult |
execute()
Executes the query |
Collection<TranslatableCriteria.CriterionEntry> |
getCriterionEntries()
Gets the Order entries of this Criteria instance. |
int |
getFirstResult()
Returns the firstResult. |
int |
getMaxResults()
Returns the maxResults. |
Collection<TranslatableCriteria.OrderEntry> |
getOrderEntries()
Gets the Order entries of this Criteria instance. |
Criteria |
setBasePath(String path)
Sets the base path of the query, i.e. |
Criteria |
setFirstResult(int firstResult)
Set the first result to be retrieved. |
Criteria |
setForcePagingWithDocumentOrder(boolean force)
Enable paging while keeping results sorted in document order. |
Criteria |
setMaxResults(int maxResults)
Set a limit upon the number of objects to be retrieved. |
Criteria |
setPaging(int itemsPerPage,
int pageNumberStartingFromOne)
|
Criteria |
setSpellCheckString(String spellCheckString)
Sets the original input string for spell checking. |
Criteria |
setWorkspace(String workspace)
Sets the name of the workspace where the search will take place |
String |
toXpathExpression()
Returns the generated xpath expression |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.slf4j.Logger log
protected String path
protected Class<?> classType
protected List<TranslatableCriteria.CriterionEntry> criterionEntries
protected List<TranslatableCriteria.OrderEntry> orderEntries
protected int maxResults
protected int offset
protected String spellCheckString
protected String workspace
protected boolean forcePagingWithDocumentOrder
| Constructor Detail |
|---|
protected AbstractCriteriaImpl()
| Method Detail |
|---|
public Collection<TranslatableCriteria.CriterionEntry> getCriterionEntries()
getCriterionEntries in interface TranslatableCriteriapublic Collection<TranslatableCriteria.OrderEntry> getOrderEntries()
getOrderEntries in interface TranslatableCriteriapublic Criteria add(Criterion criterion)
restriction to constrain the results to be retrieved.
add in interface Criteriacriterion - The criterion object representing the restriction to be applied.
public Criteria addOrder(Order order)
ordering to the result set. Only one Order criterion per query can be
applied. Any Order added after the first one will be ignored.
addOrder in interface Criteriaorder - The order object representing an ordering to be applied to the results.
public Criteria setBasePath(String path)
setBasePath in interface Criteriapath - the handle of a node, or a xpath query prefix in the form //handle/of/a/node//*
public int getFirstResult()
public Criteria setFirstResult(int firstResult)
setFirstResult in interface CriteriafirstResult - the first result to retrieve, numbered from 0
public int getMaxResults()
public Criteria setMaxResults(int maxResults)
setMaxResults in interface CriteriamaxResults - the maximum number of results
public Criteria setPaging(int itemsPerPage,
int pageNumberStartingFromOne)
setPaging in interface CriteriaitemsPerPage - maximum number of results per page (i.e. page size)pageNumberStartingFromOne - page number to retrieve (1, 2, 3, ...)
public Criteria setSpellCheckString(String spellCheckString)
setSpellCheckString in interface CriteriaspellCheckString - the actual input string for spell checking
public Criteria setWorkspace(String workspace)
setWorkspace in interface Criteriaworkspace - the name of a workspace
public Criteria setForcePagingWithDocumentOrder(boolean force)
Enable paging while keeping results sorted in document order.
Document order is only applied by jackrabbit after the paginated result has been retrieved.
This means that if you have 20 nodes and you want to retrieve them in 2 pages containing 10 elements, only the order of elements in a single page is kept (but the "first" 10 noted in the first page will not be the nodes you are expecting in document order). Setting this flag to true forces the retrieval of the full list of nodes and a post-pagination which will mimic the behaviour you get when an "order by" is specified.
Warning: this has surely a performance hit, since jackrabbit applied document ordering by retrieving any single node (while normally pagination is applied directly on the luce index).
setForcePagingWithDocumentOrder in interface Criteriaforce - true to force paging while keeping results sorted in document order
public String toXpathExpression()
toXpathExpression in interface Criteriapublic AdvancedResult execute()
execute in interface ExecutableQuery
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||