public interface QueryObjectModelFactory extends QueryObjectModelFactory
QueryObjectModelFactory
interface, with methods to create additional components for
more powerful queries.JCR_JOIN_TYPE_INNER, JCR_JOIN_TYPE_LEFT_OUTER, JCR_JOIN_TYPE_RIGHT_OUTER, JCR_OPERATOR_EQUAL_TO, JCR_OPERATOR_GREATER_THAN, JCR_OPERATOR_GREATER_THAN_OR_EQUAL_TO, JCR_OPERATOR_LESS_THAN, JCR_OPERATOR_LESS_THAN_OR_EQUAL_TO, JCR_OPERATOR_LIKE, JCR_OPERATOR_NOT_EQUAL_TO, JCR_ORDER_ASCENDING, JCR_ORDER_DESCENDING
Modifier and Type | Method and Description |
---|---|
ArithmeticOperand |
add(DynamicOperand left,
DynamicOperand right)
Create an arithmetic dynamic operand that adds the numeric value of the two supplied operand(s).
|
Ordering |
ascending(DynamicOperand operand)
Orders by the value of the specified operand, in ascending order.
|
Ordering |
ascendingNullsFirst(DynamicOperand operand)
Orders by the value of the specified operand, in ascending order.
|
Between |
between(DynamicOperand operand,
StaticOperand lowerBound,
StaticOperand upperBound,
boolean includeLowerBound,
boolean includeUpperBound)
Tests that the value (or values) defined by the supplied dynamic operand are within a specified range.
|
Cast |
cast(DynamicOperand operand,
String desiredType)
Creates a dynamic operand that casts another operand to a desired type.
|
ChildCount |
childCount(String selectorName)
Evaluates to a
LONG value equal to the number of children for each of the node(s) in the specified selector. |
QueryObjectModel |
createQuery(SelectQuery command)
Creates a query for a select query command.
|
SetQueryObjectModel |
createQuery(SetQuery command)
Creates a set query.
|
Ordering |
descending(DynamicOperand operand)
Orders by the value of the specified operand, in descending order.
|
Ordering |
descendingNullsLast(DynamicOperand operand)
Orders by the value of the specified operand, in descending order.
|
ArithmeticOperand |
divide(DynamicOperand left,
DynamicOperand right)
Create an arithmetic dynamic operand that divides the numeric value of the first operand by the numeric value of the
second.
|
SetQuery |
except(QueryCommand left,
QueryCommand right,
Ordering[] orderings,
Limit limit,
boolean all)
Creates a query command that returns all rows that are in the result of the left-hand query but not in the result of the
right-hand query.
|
SetCriteria |
in(DynamicOperand operand,
StaticOperand... values)
Tests that the value (or values) defined by the supplied dynamic operand are found within the specified set of values.
|
SetQuery |
intersect(QueryCommand left,
QueryCommand right,
Ordering[] orderings,
Limit limit,
boolean all)
Creates a query command that returns all rows that are both in the result of the left-hand query and in the result of the
right-hand query.
|
Limit |
limit(int rowLimit,
int offset)
Evaluates to a limit on the maximum number of tuples in the results and the number of rows that are skipped before the
first tuple in the results.
|
ArithmeticOperand |
multiply(DynamicOperand left,
DynamicOperand right)
Create an arithmetic dynamic operand that multplies the numeric value of the first operand by the numeric value of the
second.
|
NodeDepth |
nodeDepth(String selectorName)
Evaluates to a
LONG value equal to the depth of a node in the specified selector. |
NodePath |
nodePath(String selectorName)
Evaluates to a
PATH value equal to the prefix-qualified path of a node in the specified selector. |
ReferenceValue |
referenceValue(String selectorName)
Creates a dynamic operand that evaluates to the REFERENCE value of the any property on the specified selector.
|
ReferenceValue |
referenceValue(String selectorName,
String propertyName)
Creates a dynamic operand that evaluates to the REFERENCE value of the specified property on the specified selector.
|
Relike |
relike(StaticOperand operand1,
PropertyValue operand2)
Filters node-tuples based on reverse like operation.
|
SelectQuery |
select(Source source,
Constraint constraint,
Ordering[] orderings,
Column[] columns,
Limit limit,
boolean isDistinct)
Creates a query with one or more selectors.
|
Subquery |
subquery(QueryCommand subqueryCommand)
Creates a subquery that can be used as a
StaticOperand in another query. |
ArithmeticOperand |
subtract(DynamicOperand left,
DynamicOperand right)
Create an arithmetic dynamic operand that subtracts the numeric value of the second operand from the numeric value of the
first.
|
SetQuery |
union(QueryCommand left,
QueryCommand right,
Ordering[] orderings,
Limit limit,
boolean all)
Creates a query command that effectively appends the results of the right-hand query to those of the left-hand query.
|
and, bindVariable, childNode, childNodeJoinCondition, column, comparison, createQuery, descendantNode, descendantNodeJoinCondition, equiJoinCondition, fullTextSearch, fullTextSearchScore, join, length, literal, lowerCase, nodeLocalName, nodeName, not, or, propertyExistence, propertyValue, sameNode, sameNodeJoinCondition, selector, upperCase
SetQueryObjectModel createQuery(SetQuery command) throws InvalidQueryException, RepositoryException
command
- set query; non-nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test and the parameters given fail that test. See the individual QOM factory methods for the validity criteria
of each query element.RepositoryException
- if another error occurs.QueryObjectModel createQuery(SelectQuery command) throws InvalidQueryException, RepositoryException
command
- select query; non-nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test and the parameters given fail that test. See the individual QOM factory methods for the validity criteria
of each query element.RepositoryException
- if another error occurs.SelectQuery select(Source source, Constraint constraint, Ordering[] orderings, Column[] columns, Limit limit, boolean isDistinct) throws InvalidQueryException, RepositoryException
source
- the node-tuple source; non-nullconstraint
- the constraint, or null if noneorderings
- zero or more orderings; null is equivalent to a zero-length arraycolumns
- the columns; null is equivalent to a zero-length arraylimit
- the limit; null is equivalent to having no limitisDistinct
- true if the query should return distinct values; or false if no duplicate removal should be performedInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test and the parameters given fail that test. See the individual QOM factory methods for the validity criteria
of each query element.RepositoryException
- if another error occurs.SetQuery union(QueryCommand left, QueryCommand right, Ordering[] orderings, Limit limit, boolean all) throws InvalidQueryException, RepositoryException
left
- the query command that represents left-side of the set operation; non-null and must have columns that are
equivalent and union-able to those of the right-side queryright
- the query command that represents right-side of the set operation; non-null and must have columns that are
equivalent and union-able to those of the left-side queryorderings
- zero or more orderings; null is equivalent to a zero-length arraylimit
- the limit; null is equivalent to having no limitall
- true if duplicate rows in the left- and right-hand side results should be included, or false if duplicate rows
should be eliminatedInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test and the parameters given fail that test. See the individual QOM factory methods for the validity criteria
of each query element.RepositoryException
- if another error occurs.SetQuery intersect(QueryCommand left, QueryCommand right, Ordering[] orderings, Limit limit, boolean all) throws InvalidQueryException, RepositoryException
left
- the query command that represents left-side of the set operation; non-null and must have columns that are
equivalent and union-able to those of the right-side queryright
- the query command that represents right-side of the set operation; non-null and must have columns that are
equivalent and union-able to those of the left-side queryorderings
- zero or more orderings; null is equivalent to a zero-length arraylimit
- the limit; null is equivalent to having no limitall
- true if duplicate rows in the left- and right-hand side results should be included, or false if duplicate rows
should be eliminatedInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test and the parameters given fail that test. See the individual QOM factory methods for the validity criteria
of each query element.RepositoryException
- if another error occurs.SetQuery except(QueryCommand left, QueryCommand right, Ordering[] orderings, Limit limit, boolean all) throws InvalidQueryException, RepositoryException
left
- the query command that represents left-side of the set operation; non-null and must have columns that are
equivalent and union-able to those of the right-side queryright
- the query command that represents right-side of the set operation; non-null and must have columns that are
equivalent and union-able to those of the left-side queryorderings
- zero or more orderings; null is equivalent to a zero-length arraylimit
- the limit; null is equivalent to having no limitall
- true if duplicate rows in the left- and right-hand side results should be included, or false if duplicate rows
should be eliminatedInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test and the parameters given fail that test. See the individual QOM factory methods for the validity criteria
of each query element.RepositoryException
- if another error occurs.ChildCount childCount(String selectorName) throws InvalidQueryException, RepositoryException
LONG
value equal to the number of children for each of the node(s) in the specified selector.
The query is invalid if selector
is not the name of a selector in the query.
selectorName
- the selector name; non-nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsCast cast(DynamicOperand operand, String desiredType) throws InvalidQueryException, RepositoryException
operand
- a DynamicOperand
instance, may not be null.desiredType
- a name of the type instance, may not be null.Cast
operand instanceInvalidQueryException
- if a particular validity test is possible on this method, the implementation chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsNodeDepth nodeDepth(String selectorName) throws InvalidQueryException, RepositoryException
LONG
value equal to the depth of a node in the specified selector.
The query is invalid if selector
is not the name of a selector in the query.
selectorName
- the selector name; non-nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsNodePath nodePath(String selectorName) throws InvalidQueryException, RepositoryException
PATH
value equal to the prefix-qualified path of a node in the specified selector.
The query is invalid if selector
is not the name of a selector in the query.
selectorName
- the selector name; non-nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsLimit limit(int rowLimit, int offset) throws InvalidQueryException, RepositoryException
rowLimit
- the maximum number of rows; must be a positive number, or Integer.MAX_VALUE
if there is to be a
non-zero offset but no limitoffset
- the number of rows to skip before beginning the results; must be 0 or a positive numberInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsBetween between(DynamicOperand operand, StaticOperand lowerBound, StaticOperand upperBound, boolean includeLowerBound, boolean includeUpperBound) throws InvalidQueryException, RepositoryException
operand
- the dynamic operand describing the values that are to be constrainedlowerBound
- the lower bound of the rangeupperBound
- the upper bound of the rangeincludeLowerBound
- true if the lower boundary value is not be includedincludeUpperBound
- true if the upper boundary value is not be includedInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsSetCriteria in(DynamicOperand operand, StaticOperand... values) throws InvalidQueryException, RepositoryException
operand
- the dynamic operand describing the values that are to be constrainedvalues
- the static operand values; may not be null or emptyInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsSubquery subquery(QueryCommand subqueryCommand) throws InvalidQueryException, RepositoryException
StaticOperand
in another query.subqueryCommand
- the query command that is to be used as the subqueryInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsArithmeticOperand add(DynamicOperand left, DynamicOperand right) throws InvalidQueryException, RepositoryException
left
- the left-hand-side operand; not nullright
- the right-hand-side operand; not nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsArithmeticOperand subtract(DynamicOperand left, DynamicOperand right) throws InvalidQueryException, RepositoryException
left
- the left-hand-side operand; not nullright
- the right-hand-side operand; not nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsArithmeticOperand multiply(DynamicOperand left, DynamicOperand right) throws InvalidQueryException, RepositoryException
left
- the left-hand-side operand; not nullright
- the right-hand-side operand; not nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsArithmeticOperand divide(DynamicOperand left, DynamicOperand right) throws InvalidQueryException, RepositoryException
left
- the left-hand-side operand; not nullright
- the right-hand-side operand; not nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsReferenceValue referenceValue(String selectorName) throws InvalidQueryException, RepositoryException
The query is invalid if:
selector
is not the name of a selector in the query, orproperty
is not a syntactically valid JCR name.selectorName
- the selector name; non-nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsReferenceValue referenceValue(String selectorName, String propertyName) throws InvalidQueryException, RepositoryException
The query is invalid if:
selector
is not the name of a selector in the query, orproperty
is not a syntactically valid JCR name.selectorName
- the selector name; non-nullpropertyName
- the reference property name; non-nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsRelike relike(StaticOperand operand1, PropertyValue operand2) throws InvalidQueryException, RepositoryException
operand1
- the first operand; non-nulloperand2
- the second operand; non-nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsOrdering ascending(DynamicOperand operand) throws InvalidQueryException, RepositoryException
operand
does not
evaluate to a scalar value. Null values are returned last; use ascendingNullsFirst(DynamicOperand)
for other
behavior.ascending
in interface QueryObjectModelFactory
operand
- the operand by which to order; non-nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsOrdering descending(DynamicOperand operand) throws InvalidQueryException, RepositoryException
operand
does not
evaluate to a scalar value. Null values are returned first; use descendingNullsLast(DynamicOperand)
for other
behavior.descending
in interface QueryObjectModelFactory
operand
- the operand by which to order; non-nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsOrdering ascendingNullsFirst(DynamicOperand operand) throws InvalidQueryException, RepositoryException
operand
does not
evaluate to a scalar value.operand
- the operand by which to order; non-nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsOrdering descendingNullsLast(DynamicOperand operand) throws InvalidQueryException, RepositoryException
operand
does not
evaluate to a scalar value.operand
- the operand by which to order; non-nullInvalidQueryException
- if a particular validity test is possible on this method, the implemention chooses to perform
that test (and not leave it until later, on createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failsCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.