org.apache.jackrabbit.core.query.jsr283.qom
Interface QueryObjectModelFactory

All Superinterfaces:
QueryObjectModelConstants
All Known Implementing Classes:
QueryObjectModelFactoryImpl

public interface QueryObjectModelFactory
extends QueryObjectModelConstants

A QueryObjectModelFactory creates instances of the JCR query object model.

Refer to QueryObjectModel for a description of the query object model.

Since:
JCR 2.0

Field Summary
 
Fields inherited from interface org.apache.jackrabbit.core.query.jsr283.qom.QueryObjectModelConstants
JOIN_TYPE_INNER, JOIN_TYPE_LEFT_OUTER, JOIN_TYPE_RIGHT_OUTER, OPERATOR_EQUAL_TO, OPERATOR_GREATER_THAN, OPERATOR_GREATER_THAN_OR_EQUAL_TO, OPERATOR_LESS_THAN, OPERATOR_LESS_THAN_OR_EQUAL_TO, OPERATOR_LIKE, OPERATOR_NOT_EQUAL_TO, ORDER_ASCENDING, ORDER_DESCENDING
 
Method Summary
 And and(Constraint constraint1, Constraint constraint2)
          Performs a logical conjunction of two other constraints.
 Ordering ascending(DynamicOperand operand)
          Orders by the value of the specified operand, in ascending order.
 BindVariableValue bindVariable(String bindVariableName)
          Evaluates to the value of a bind variable.
 ChildNode childNode(String path)
          Tests whether a node in the default selector is a child of a node reachable by a specified absolute path.
 ChildNode childNode(String selectorName, String path)
          Tests whether a node in the specified selector is a child of a node reachable by a specified absolute path.
 ChildNodeJoinCondition childNodeJoinCondition(String childSelectorName, String parentSelectorName)
          Tests whether a first selector's node is a child of a second selector's node.
 Column column(String propertyName)
          Identifies a property in the default selector to include in the tabular view of query results.
 Column column(String propertyName, String columnName)
          Identifies a property in the default selector to include in the tabular view of query results.
 Column column(String selectorName, String propertyName, String columnName)
          Identifies a property in the specified selector to include in the tabular view of query results.
 Comparison comparison(DynamicOperand operand1, int operator, StaticOperand operand2)
          Filters node-tuples based on the outcome of a binary operation.
 QueryObjectModel createQuery(Selector selector, Constraint constraint, Ordering[] orderings, Column[] columns)
          Creates a query with one selector.
 QueryObjectModel createQuery(Source source, Constraint constraint, Ordering[] orderings, Column[] columns)
          Creates a query with one or more selectors.
 DescendantNode descendantNode(String path)
          Tests whether a node in the default selector is a descendant of a node reachable by a specified absolute path.
 DescendantNode descendantNode(String selectorName, String path)
          Tests whether a node in the specified selector is a descendant of a node reachable by a specified absolute path.
 DescendantNodeJoinCondition descendantNodeJoinCondition(String descendantSelectorName, String ancestorSelectorName)
          Tests whether a first selector's node is a descendant of a second selector's node.
 Ordering descending(DynamicOperand operand)
          Orders by the value of the specified operand, in descending order.
 EquiJoinCondition equiJoinCondition(String selector1Name, String property1Name, String selector2Name, String property2Name)
          Tests whether the value of a property in a first selector is equal to the value of a property in a second selector.
 FullTextSearch fullTextSearch(String propertyName, String fullTextSearchExpression)
          Performs a full-text search against the default selector.
 FullTextSearch fullTextSearch(String selectorName, String propertyName, String fullTextSearchExpression)
          Performs a full-text search against the specified selector.
 FullTextSearchScore fullTextSearchScore()
          Evaluates to a DOUBLE value equal to the full-text search score of a node in the default selector.
 FullTextSearchScore fullTextSearchScore(String selectorName)
          Evaluates to a DOUBLE value equal to the full-text search score of a node in the specified selector.
 Join join(Source left, Source right, int joinType, JoinCondition joinCondition)
          Performs a join between two node-tuple sources.
 Length length(PropertyValue propertyValue)
          Evaluates to the length (or lengths, if multi-valued) of a property.
 Literal literal(Value value)
          Evaluates to a literal value.
 LowerCase lowerCase(DynamicOperand operand)
          Evaluates to the lower-case string value (or values, if multi-valued) of an operand.
 NodeLocalName nodeLocalName()
          Evaluates to a NAME value equal to the local (unprefixed) name of a node in the default selector.
 NodeLocalName nodeLocalName(String selectorName)
          Evaluates to a NAME value equal to the local (unprefixed) name of a node in the specified selector.
 NodeName nodeName()
          Evaluates to a NAME value equal to the prefix-qualified name of a node in the default selector.
 NodeName nodeName(String selectorName)
          Evaluates to a NAME value equal to the prefix-qualified name of a node in the specified selector.
 Not not(Constraint constraint)
          Performs a logical negation of another constraint.
 Or or(Constraint constraint1, Constraint constraint2)
          Performs a logical disjunction of two other constraints.
 PropertyExistence propertyExistence(String propertyName)
          Tests the existence of a property in the default selector.
 PropertyExistence propertyExistence(String selectorName, String propertyName)
          Tests the existence of a property in the specified selector.
 PropertyValue propertyValue(String propertyName)
          Evaluates to the value (or values, if multi-valued) of a property of the default selector.
 PropertyValue propertyValue(String selectorName, String propertyName)
          Evaluates to the value (or values, if multi-valued) of a property in the specified selector.
 SameNode sameNode(String path)
          Tests whether a node in the default selector is reachable by a specified absolute path.
 SameNode sameNode(String selectorName, String path)
          Tests whether a node in the specified selector is reachable by a specified absolute path.
 SameNodeJoinCondition sameNodeJoinCondition(String selector1Name, String selector2Name)
          Tests whether a first selector's node is the same as a second selector's node.
 SameNodeJoinCondition sameNodeJoinCondition(String selector1Name, String selector2Name, String selector2Path)
          Tests whether a first selector's node is the same as a node identified by relative path from a second selector's node.
 Selector selector(String nodeTypeName)
          Selects a subset of the nodes in the repository based on node type.
 Selector selector(String nodeTypeName, String selectorName)
          Selects a subset of the nodes in the repository based on node type.
 UpperCase upperCase(DynamicOperand operand)
          Evaluates to the upper-case string value (or values, if multi-valued) of an operand.
 

Method Detail

createQuery

QueryObjectModel createQuery(Selector selector,
                             Constraint constraint,
                             Ordering[] orderings,
                             Column[] columns)
                             throws InvalidQueryException,
                                    RepositoryException
Creates a query with one selector.

The specified selector will be the default selector of the query.

Parameters:
selector - the selector; non-null
constraint - the constraint, or null if none
orderings - zero or more orderings; null is equivalent to a zero-length array
columns - the columns; null is equivalent to a zero-length array
Returns:
the query; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

createQuery

QueryObjectModel createQuery(Source source,
                             Constraint constraint,
                             Ordering[] orderings,
                             Column[] columns)
                             throws InvalidQueryException,
                                    RepositoryException
Creates a query with one or more selectors.

If source is a selector, that selector is the default selector of the query. Otherwise the query does not have a default selector.

Parameters:
source - the node-tuple source; non-null
constraint - the constraint, or null if none
orderings - zero or more orderings; null is equivalent to a zero-length array
columns - the columns; null is equivalent to a zero-length array
Returns:
the query; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

selector

Selector selector(String nodeTypeName)
                  throws InvalidQueryException,
                         RepositoryException
Selects a subset of the nodes in the repository based on node type.

The selector name is the node type name.

Parameters:
nodeTypeName - the name of the required node type; non-null
Returns:
the selector; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

selector

Selector selector(String nodeTypeName,
                  String selectorName)
                  throws InvalidQueryException,
                         RepositoryException
Selects a subset of the nodes in the repository based on node type.

Parameters:
nodeTypeName - the name of the required node type; non-null
selectorName - the selector name; non-null
Returns:
the selector; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

join

Join join(Source left,
          Source right,
          int joinType,
          JoinCondition joinCondition)
          throws InvalidQueryException,
                 RepositoryException
Performs a join between two node-tuple sources.

Parameters:
left - the left node-tuple source; non-null
right - the right node-tuple source; non-null
joinType - either
joinCondition - the join condition; non-null
Returns:
the join; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

equiJoinCondition

EquiJoinCondition equiJoinCondition(String selector1Name,
                                    String property1Name,
                                    String selector2Name,
                                    String property2Name)
                                    throws InvalidQueryException,
                                           RepositoryException
Tests whether the value of a property in a first selector is equal to the value of a property in a second selector.

Parameters:
selector1Name - the name of the first selector; non-null
property1Name - the property name in the first selector; non-null
selector2Name - the name of the second selector; non-null
property2Name - the property name in the second selector; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

sameNodeJoinCondition

SameNodeJoinCondition sameNodeJoinCondition(String selector1Name,
                                            String selector2Name)
                                            throws InvalidQueryException,
                                                   RepositoryException
Tests whether a first selector's node is the same as a second selector's node.

Parameters:
selector1Name - the name of the first selector; non-null
selector2Name - the name of the second selector; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

sameNodeJoinCondition

SameNodeJoinCondition sameNodeJoinCondition(String selector1Name,
                                            String selector2Name,
                                            String selector2Path)
                                            throws InvalidQueryException,
                                                   RepositoryException
Tests whether a first selector's node is the same as a node identified by relative path from a second selector's node.

Parameters:
selector1Name - the name of the first selector; non-null
selector2Name - the name of the second selector; non-null
selector2Path - the path relative to the second selector; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

childNodeJoinCondition

ChildNodeJoinCondition childNodeJoinCondition(String childSelectorName,
                                              String parentSelectorName)
                                              throws InvalidQueryException,
                                                     RepositoryException
Tests whether a first selector's node is a child of a second selector's node.

Parameters:
childSelectorName - the name of the child selector; non-null
parentSelectorName - the name of the parent selector; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

descendantNodeJoinCondition

DescendantNodeJoinCondition descendantNodeJoinCondition(String descendantSelectorName,
                                                        String ancestorSelectorName)
                                                        throws InvalidQueryException,
                                                               RepositoryException
Tests whether a first selector's node is a descendant of a second selector's node.

Parameters:
descendantSelectorName - the name of the descendant selector; non-null
ancestorSelectorName - the name of the ancestor selector; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

and

And and(Constraint constraint1,
        Constraint constraint2)
        throws InvalidQueryException,
               RepositoryException
Performs a logical conjunction of two other constraints.

Parameters:
constraint1 - the first constraint; non-null
constraint2 - the second constraint; non-null
Returns:
the And constraint; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

or

Or or(Constraint constraint1,
      Constraint constraint2)
      throws InvalidQueryException,
             RepositoryException
Performs a logical disjunction of two other constraints.

Parameters:
constraint1 - the first constraint; non-null
constraint2 - the second constraint; non-null
Returns:
the Or constraint; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

not

Not not(Constraint constraint)
        throws InvalidQueryException,
               RepositoryException
Performs a logical negation of another constraint.

Parameters:
constraint - the constraint to be negated; non-null
Returns:
the Not constraint; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

comparison

Comparison comparison(DynamicOperand operand1,
                      int operator,
                      StaticOperand operand2)
                      throws InvalidQueryException,
                             RepositoryException
Filters node-tuples based on the outcome of a binary operation.

Parameters:
operand1 - the first operand; non-null
operator - the operator; either
operand2 - the second operand; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

propertyExistence

PropertyExistence propertyExistence(String propertyName)
                                    throws InvalidQueryException,
                                           RepositoryException
Tests the existence of a property in the default selector.

Parameters:
propertyName - the property name; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query has no default selector or is otherwise invalid
RepositoryException - if the operation otherwise fails

propertyExistence

PropertyExistence propertyExistence(String selectorName,
                                    String propertyName)
                                    throws InvalidQueryException,
                                           RepositoryException
Tests the existence of a property in the specified selector.

Parameters:
selectorName - the selector name; non-null
propertyName - the property name; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

fullTextSearch

FullTextSearch fullTextSearch(String propertyName,
                              String fullTextSearchExpression)
                              throws InvalidQueryException,
                                     RepositoryException
Performs a full-text search against the default selector.

Parameters:
propertyName - the property name, or null to search all full-text indexed properties of the node (or node subtree, in some implementations)
fullTextSearchExpression - the full-text search expression; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query has no default selector or is otherwise invalid
RepositoryException - if the operation otherwise fails

fullTextSearch

FullTextSearch fullTextSearch(String selectorName,
                              String propertyName,
                              String fullTextSearchExpression)
                              throws InvalidQueryException,
                                     RepositoryException
Performs a full-text search against the specified selector.

Parameters:
selectorName - the selector name; non-null
propertyName - the property name, or null to search all full-text indexed properties of the node (or node subtree, in some implementations)
fullTextSearchExpression - the full-text search expression; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

sameNode

SameNode sameNode(String path)
                  throws InvalidQueryException,
                         RepositoryException
Tests whether a node in the default selector is reachable by a specified absolute path.

Parameters:
path - an absolute path; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query has no default selector or is otherwise invalid
RepositoryException - if the operation otherwise fails

sameNode

SameNode sameNode(String selectorName,
                  String path)
                  throws InvalidQueryException,
                         RepositoryException
Tests whether a node in the specified selector is reachable by a specified absolute path.

Parameters:
selectorName - the selector name; non-null
path - an absolute path; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

childNode

ChildNode childNode(String path)
                    throws InvalidQueryException,
                           RepositoryException
Tests whether a node in the default selector is a child of a node reachable by a specified absolute path.

Parameters:
path - an absolute path; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query has no default selector or is otherwise invalid
RepositoryException - if the operation otherwise fails

childNode

ChildNode childNode(String selectorName,
                    String path)
                    throws InvalidQueryException,
                           RepositoryException
Tests whether a node in the specified selector is a child of a node reachable by a specified absolute path.

Parameters:
selectorName - the selector name; non-null
path - an absolute path; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

descendantNode

DescendantNode descendantNode(String path)
                              throws InvalidQueryException,
                                     RepositoryException
Tests whether a node in the default selector is a descendant of a node reachable by a specified absolute path.

Parameters:
path - an absolute path; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query has no default selector or is otherwise invalid
RepositoryException - if the operation otherwise fails

descendantNode

DescendantNode descendantNode(String selectorName,
                              String path)
                              throws InvalidQueryException,
                                     RepositoryException
Tests whether a node in the specified selector is a descendant of a node reachable by a specified absolute path.

Parameters:
selectorName - the selector name; non-null
path - an absolute path; non-null
Returns:
the constraint; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

propertyValue

PropertyValue propertyValue(String propertyName)
                            throws InvalidQueryException,
                                   RepositoryException
Evaluates to the value (or values, if multi-valued) of a property of the default selector.

Parameters:
propertyName - the property name; non-null
Returns:
the operand; non-null
Throws:
InvalidQueryException - if the query has no default selector or is otherwise invalid
RepositoryException - if the operation otherwise fails

propertyValue

PropertyValue propertyValue(String selectorName,
                            String propertyName)
                            throws InvalidQueryException,
                                   RepositoryException
Evaluates to the value (or values, if multi-valued) of a property in the specified selector.

Parameters:
selectorName - the selector name; non-null
propertyName - the property name; non-null
Returns:
the operand; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

length

Length length(PropertyValue propertyValue)
              throws InvalidQueryException,
                     RepositoryException
Evaluates to the length (or lengths, if multi-valued) of a property.

Parameters:
propertyValue - the property value for which to compute the length; non-null
Returns:
the operand; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

nodeName

NodeName nodeName()
                  throws InvalidQueryException,
                         RepositoryException
Evaluates to a NAME value equal to the prefix-qualified name of a node in the default selector.

Returns:
the operand; non-null
Throws:
InvalidQueryException - if the query has no default selector or is otherwise invalid
RepositoryException - if the operation otherwise fails

nodeName

NodeName nodeName(String selectorName)
                  throws InvalidQueryException,
                         RepositoryException
Evaluates to a NAME value equal to the prefix-qualified name of a node in the specified selector.

Parameters:
selectorName - the selector name; non-null
Returns:
the operand; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

nodeLocalName

NodeLocalName nodeLocalName()
                            throws InvalidQueryException,
                                   RepositoryException
Evaluates to a NAME value equal to the local (unprefixed) name of a node in the default selector.

Returns:
the operand; non-null
Throws:
InvalidQueryException - if the query has no default selector or is otherwise invalid
RepositoryException - if the operation otherwise fails

nodeLocalName

NodeLocalName nodeLocalName(String selectorName)
                            throws InvalidQueryException,
                                   RepositoryException
Evaluates to a NAME value equal to the local (unprefixed) name of a node in the specified selector.

Parameters:
selectorName - the selector name; non-null
Returns:
the operand; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

fullTextSearchScore

FullTextSearchScore fullTextSearchScore()
                                        throws InvalidQueryException,
                                               RepositoryException
Evaluates to a DOUBLE value equal to the full-text search score of a node in the default selector.

Returns:
the operand; non-null
Throws:
InvalidQueryException - if the query has no default selector or is otherwise invalid
RepositoryException - if the operation otherwise fails

fullTextSearchScore

FullTextSearchScore fullTextSearchScore(String selectorName)
                                        throws InvalidQueryException,
                                               RepositoryException
Evaluates to a DOUBLE value equal to the full-text search score of a node in the specified selector.

Parameters:
selectorName - the selector name; non-null
Returns:
the operand; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

lowerCase

LowerCase lowerCase(DynamicOperand operand)
                    throws InvalidQueryException,
                           RepositoryException
Evaluates to the lower-case string value (or values, if multi-valued) of an operand.

Parameters:
operand - the operand whose value is converted to a lower-case string; non-null
Returns:
the operand; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

upperCase

UpperCase upperCase(DynamicOperand operand)
                    throws InvalidQueryException,
                           RepositoryException
Evaluates to the upper-case string value (or values, if multi-valued) of an operand.

Parameters:
operand - the operand whose value is converted to a upper-case string; non-null
Returns:
the operand; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

bindVariable

BindVariableValue bindVariable(String bindVariableName)
                               throws InvalidQueryException,
                                      RepositoryException
Evaluates to the value of a bind variable.

Parameters:
bindVariableName - the bind variable name; non-null
Returns:
the operand; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

literal

Literal literal(Value value)
                throws InvalidQueryException,
                       RepositoryException
Evaluates to a literal value.

Parameters:
value - a JCR value; non-null
Returns:
the operand; non-null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

ascending

Ordering ascending(DynamicOperand operand)
                   throws InvalidQueryException,
                          RepositoryException
Orders by the value of the specified operand, in ascending order.

Parameters:
operand - the operand by which to order; non-null
Returns:
the ordering
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

descending

Ordering descending(DynamicOperand operand)
                    throws InvalidQueryException,
                           RepositoryException
Orders by the value of the specified operand, in descending order.

Parameters:
operand - the operand by which to order; non-null
Returns:
the ordering
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails

column

Column column(String propertyName)
              throws InvalidQueryException,
                     RepositoryException
Identifies a property in the default selector to include in the tabular view of query results.

The column name is the property name.

Parameters:
propertyName - the property name, or null to include a column for each single-value non-residual property of the selector's node type
Returns:
the column; non-null
Throws:
InvalidQueryException - if the query has no default selector or is otherwise invalid
RepositoryException - if the operation otherwise fails

column

Column column(String propertyName,
              String columnName)
              throws InvalidQueryException,
                     RepositoryException
Identifies a property in the default selector to include in the tabular view of query results.

Parameters:
propertyName - the property name, or null to include a column for each single-value non-residual property of the selector's node type
columnName - the column name; must be null if propertyName is null
Returns:
the column; non-null
Throws:
InvalidQueryException - if the query has no default selector or is otherwise invalid
RepositoryException - if the operation otherwise fails

column

Column column(String selectorName,
              String propertyName,
              String columnName)
              throws InvalidQueryException,
                     RepositoryException
Identifies a property in the specified selector to include in the tabular view of query results.

Parameters:
selectorName - the selector name; non-null
propertyName - the property name, or null to include a column for each single-value non-residual property of the selector's node type
columnName - the column name; if null, defaults to propertyName; must be null if propertyName is null
Throws:
InvalidQueryException - if the query is invalid
RepositoryException - if the operation otherwise fails


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.