public class QueryObjectModelFactory extends Object implements QueryObjectModelFactory
QueryObjectModelFactory
. Note that this implementation constructs the query components but
does not validate any of the parameters or the resulting query definition. All validation is performed when the query is
executed
.Modifier and Type | Field and Description |
---|---|
static String |
LANGUAGE |
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
Constructor and Description |
---|
QueryObjectModelFactory(JcrQueryContext context) |
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).
|
And |
and(Constraint constraint1,
Constraint constraint2) |
ArithmeticOperand |
arithmeticOperand(DynamicOperand left,
ArithmeticOperator operator,
DynamicOperand right) |
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.
|
BindVariableValue |
bindVariable(String bindVariableName) |
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. |
ChildNode |
childNode(String selectorName,
String path) |
ChildNodeJoinCondition |
childNodeJoinCondition(String childSelectorName,
String parentSelectorName) |
Column |
column(String selectorName,
String propertyName,
String columnName) |
Comparison |
comparison(DynamicOperand operand1,
String operator,
StaticOperand operand2) |
QueryObjectModel |
createQuery(SelectQuery command)
Creates a query for a select query command.
|
SetQueryObjectModel |
createQuery(SetQuery command)
Creates a set query.
|
QueryObjectModel |
createQuery(Source source,
Constraint constraint,
Ordering[] orderings,
Column[] columns) |
DescendantNode |
descendantNode(String selectorName,
String path) |
DescendantNodeJoinCondition |
descendantNodeJoinCondition(String descendantSelectorName,
String ancestorSelectorName) |
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.
|
EquiJoinCondition |
equiJoinCondition(String selector1Name,
String property1Name,
String selector2Name,
String property2Name) |
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.
|
FullTextSearch |
fullTextSearch(String selectorName,
String propertyName,
StaticOperand fullTextSearchExpression) |
FullTextSearchScore |
fullTextSearchScore(String selectorName) |
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.
|
Join |
join(Source left,
Source right,
String joinType,
JoinCondition joinCondition) |
Length |
length(PropertyValue propertyValue) |
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.
|
LiteralValue |
literal(Value literalValue) |
LowerCase |
lowerCase(DynamicOperand operand) |
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. |
NodeLocalName |
nodeLocalName(String selectorName) |
NodeName |
nodeName(String selectorName) |
NodePath |
nodePath(String selectorName)
Evaluates to a
PATH value equal to the prefix-qualified path of a node in the specified selector. |
Not |
not(Constraint constraint) |
Or |
or(Constraint constraint1,
Constraint constraint2) |
PropertyExistence |
propertyExistence(String selectorName,
String propertyName) |
PropertyValue |
propertyValue(String selectorName,
String propertyName) |
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.
|
SameNode |
sameNode(String selectorName,
String path) |
SameNodeJoinCondition |
sameNodeJoinCondition(String selector1Name,
String selector2Name,
String selector2Path) |
SelectQuery |
select(Source source,
Constraint constraint,
Ordering[] orderings,
Column[] columns,
Limit limit,
boolean distinct)
Creates a query with one or more selectors.
|
NamedSelector |
selector(String nodeTypeName,
String selectorName) |
protected SelectorName |
selectorName(String name) |
SetQuery |
setQuery(QueryCommand left,
SetQuery.Operation operation,
QueryCommand right,
Ordering[] orderings,
Limit limit,
boolean all) |
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.
|
UpperCase |
upperCase(DynamicOperand operand) |
public static final String LANGUAGE
public QueryObjectModelFactory(JcrQueryContext context)
protected SelectorName selectorName(String name)
public QueryObjectModel createQuery(Source source, Constraint constraint, Ordering[] orderings, Column[] columns)
createQuery
in interface QueryObjectModelFactory
public SetQueryObjectModel createQuery(SetQuery command)
QueryObjectModelFactory
command
- set query; non-nullpublic QueryObjectModel createQuery(SelectQuery command)
QueryObjectModelFactory
command
- select query; non-nullpublic SelectQuery select(Source source, Constraint constraint, Ordering[] orderings, Column[] columns, Limit limit, boolean distinct)
QueryObjectModelFactory
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 limitdistinct
- true if the query should return distinct values; or false if no duplicate removal should be performedpublic SetQuery union(QueryCommand left, QueryCommand right, Ordering[] orderings, Limit limit, boolean all)
QueryObjectModelFactory
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 eliminatedpublic SetQuery intersect(QueryCommand left, QueryCommand right, Ordering[] orderings, Limit limit, boolean all)
QueryObjectModelFactory
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 eliminatedpublic SetQuery except(QueryCommand left, QueryCommand right, Ordering[] orderings, Limit limit, boolean all)
QueryObjectModelFactory
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 eliminatedpublic SetQuery setQuery(QueryCommand left, SetQuery.Operation operation, QueryCommand right, Ordering[] orderings, Limit limit, boolean all)
public NamedSelector selector(String nodeTypeName, String selectorName)
selector
in interface QueryObjectModelFactory
public Column column(String selectorName, String propertyName, String columnName)
column
in interface QueryObjectModelFactory
public Ordering ascending(DynamicOperand operand)
QueryObjectModelFactory
operand
does not
evaluate to a scalar value. Null values are returned last; use QueryObjectModelFactory.ascendingNullsFirst(DynamicOperand)
for other
behavior.ascending
in interface QueryObjectModelFactory
operand
- the operand by which to order; non-nullpublic Ordering ascendingNullsFirst(DynamicOperand operand)
QueryObjectModelFactory
operand
does not
evaluate to a scalar value.operand
- the operand by which to order; non-nullpublic Ordering descending(DynamicOperand operand)
QueryObjectModelFactory
operand
does not
evaluate to a scalar value. Null values are returned first; use QueryObjectModelFactory.descendingNullsLast(DynamicOperand)
for other
behavior.descending
in interface QueryObjectModelFactory
operand
- the operand by which to order; non-nullpublic Ordering descendingNullsLast(DynamicOperand operand)
QueryObjectModelFactory
operand
does not
evaluate to a scalar value.operand
- the operand by which to order; non-nullpublic And and(Constraint constraint1, Constraint constraint2)
and
in interface QueryObjectModelFactory
public BindVariableValue bindVariable(String bindVariableName)
bindVariable
in interface QueryObjectModelFactory
public ChildNode childNode(String selectorName, String path)
childNode
in interface QueryObjectModelFactory
public ChildNodeJoinCondition childNodeJoinCondition(String childSelectorName, String parentSelectorName)
childNodeJoinCondition
in interface QueryObjectModelFactory
public Comparison comparison(DynamicOperand operand1, String operator, StaticOperand operand2)
comparison
in interface QueryObjectModelFactory
public DescendantNode descendantNode(String selectorName, String path)
descendantNode
in interface QueryObjectModelFactory
public DescendantNodeJoinCondition descendantNodeJoinCondition(String descendantSelectorName, String ancestorSelectorName)
descendantNodeJoinCondition
in interface QueryObjectModelFactory
public EquiJoinCondition equiJoinCondition(String selector1Name, String property1Name, String selector2Name, String property2Name)
equiJoinCondition
in interface QueryObjectModelFactory
public FullTextSearch fullTextSearch(String selectorName, String propertyName, StaticOperand fullTextSearchExpression) throws RepositoryException
fullTextSearch
in interface QueryObjectModelFactory
RepositoryException
public FullTextSearchScore fullTextSearchScore(String selectorName)
fullTextSearchScore
in interface QueryObjectModelFactory
public Join join(Source left, Source right, String joinType, JoinCondition joinCondition)
join
in interface QueryObjectModelFactory
public Length length(PropertyValue propertyValue)
length
in interface QueryObjectModelFactory
public LiteralValue literal(Value literalValue) throws RepositoryException
literal
in interface QueryObjectModelFactory
RepositoryException
public LowerCase lowerCase(DynamicOperand operand)
lowerCase
in interface QueryObjectModelFactory
public NodeLocalName nodeLocalName(String selectorName)
nodeLocalName
in interface QueryObjectModelFactory
public NodeName nodeName(String selectorName)
nodeName
in interface QueryObjectModelFactory
public Not not(Constraint constraint)
not
in interface QueryObjectModelFactory
public Or or(Constraint constraint1, Constraint constraint2)
or
in interface QueryObjectModelFactory
public PropertyExistence propertyExistence(String selectorName, String propertyName)
propertyExistence
in interface QueryObjectModelFactory
public PropertyValue propertyValue(String selectorName, String propertyName)
propertyValue
in interface QueryObjectModelFactory
public SameNode sameNode(String selectorName, String path)
sameNode
in interface QueryObjectModelFactory
public SameNodeJoinCondition sameNodeJoinCondition(String selector1Name, String selector2Name, String selector2Path)
sameNodeJoinCondition
in interface QueryObjectModelFactory
public UpperCase upperCase(DynamicOperand operand)
upperCase
in interface QueryObjectModelFactory
public NodePath nodePath(String selectorName)
QueryObjectModelFactory
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-nullpublic ChildCount childCount(String selectorName)
QueryObjectModelFactory
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-nullpublic Cast cast(DynamicOperand operand, String desiredType) throws InvalidQueryException, RepositoryException
QueryObjectModelFactory
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 QueryObjectModelFactory.createQuery(org.modeshape.jcr.api.query.qom.SetQuery)
), and the parameters given fail that testRepositoryException
- if the operation otherwise failspublic NodeDepth nodeDepth(String selectorName)
QueryObjectModelFactory
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-nullpublic Limit limit(int rowLimit, int offset)
QueryObjectModelFactory
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 numberpublic Between between(DynamicOperand operand, StaticOperand lowerBound, StaticOperand upperBound, boolean includeLowerBound, boolean includeUpperBound)
QueryObjectModelFactory
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 includedpublic SetCriteria in(DynamicOperand operand, StaticOperand... values)
QueryObjectModelFactory
operand
- the dynamic operand describing the values that are to be constrainedvalues
- the static operand values; may not be null or emptypublic Subquery subquery(QueryCommand subqueryCommand)
QueryObjectModelFactory
StaticOperand
in another query.subqueryCommand
- the query command that is to be used as the subquerypublic ArithmeticOperand add(DynamicOperand left, DynamicOperand right)
QueryObjectModelFactory
left
- the left-hand-side operand; not nullright
- the right-hand-side operand; not nullpublic ArithmeticOperand subtract(DynamicOperand left, DynamicOperand right)
QueryObjectModelFactory
left
- the left-hand-side operand; not nullright
- the right-hand-side operand; not nullpublic ArithmeticOperand multiply(DynamicOperand left, DynamicOperand right)
QueryObjectModelFactory
left
- the left-hand-side operand; not nullright
- the right-hand-side operand; not nullpublic ArithmeticOperand divide(DynamicOperand left, DynamicOperand right)
QueryObjectModelFactory
left
- the left-hand-side operand; not nullright
- the right-hand-side operand; not nullpublic ArithmeticOperand arithmeticOperand(DynamicOperand left, ArithmeticOperator operator, DynamicOperand right)
public ReferenceValue referenceValue(String selectorName)
QueryObjectModelFactory
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-nullpublic ReferenceValue referenceValue(String selectorName, String propertyName)
QueryObjectModelFactory
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-nullpublic Relike relike(StaticOperand operand1, PropertyValue operand2)
QueryObjectModelFactory
operand1
- the first operand; non-nulloperand2
- the second operand; non-nullCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.