You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by mr...@apache.org on 2007/09/05 14:21:47 UTC

svn commit: r572936 [2/2] - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283: ./ qom/

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/QueryObjectModelConstants.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/QueryObjectModelConstants.java?rev=572936&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/QueryObjectModelConstants.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/QueryObjectModelConstants.java Wed Sep  5 05:21:44 2007
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.jsr283.qom;
+
+/**
+ * Defines constants used in the query object model.
+ *
+ * @since JCR 2.0
+ */
+public interface QueryObjectModelConstants {
+    /**
+     * An inner join.
+     */
+    public static final int JOIN_TYPE_INNER = 101;
+
+    /**
+     * A left-outer join.
+     */
+    public static final int JOIN_TYPE_LEFT_OUTER = 102;
+
+    /**
+     * A right-outer join.
+     */
+    public static final int JOIN_TYPE_RIGHT_OUTER = 103;
+
+    /**
+     * The "<code>=</code>" comparison operator.
+     */
+    public static final int OPERATOR_EQUAL_TO = 201;
+
+    /**
+     * The "<code>!=</code>" comparison operator.
+     */
+    public static final int OPERATOR_NOT_EQUAL_TO = 202;
+
+    /**
+     * The "<code>&lt;</code>" comparison operator.
+     */
+    public static final int OPERATOR_LESS_THAN = 203;
+
+    /**
+     * The "<code>&lt;=</code>" comparison operator.
+     */
+    public static final int OPERATOR_LESS_THAN_OR_EQUAL_TO = 204;
+
+    /**
+     * The "<code>&gt;</code>" comparison operator.
+     */
+    public static final int OPERATOR_GREATER_THAN = 205;
+
+    /**
+     * The "<code>&gt;=</code>" comparison operator.
+     */
+    public static final int OPERATOR_GREATER_THAN_OR_EQUAL_TO = 206;
+
+    /**
+     * The "<code>like</code>" comparison operator.
+     */
+    public static final int OPERATOR_LIKE = 207;
+
+    /**
+     * Ascending order.
+     */
+    public static final int ORDER_ASCENDING = 301;
+
+    /**
+     * Descending order.
+     */
+    public static final int ORDER_DESCENDING = 302;
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/QueryObjectModelConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/QueryObjectModelFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/QueryObjectModelFactory.java?rev=572936&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/QueryObjectModelFactory.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/QueryObjectModelFactory.java Wed Sep  5 05:21:44 2007
@@ -0,0 +1,648 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.jsr283.qom;
+
+import javax.jcr.query.InvalidQueryException;
+import javax.jcr.RepositoryException;
+
+/**
+ * A <code>QueryObjectModelFactory</code> creates instances of the JCR query
+ * object model.
+ * <p/>
+ * Refer to {@link org.apache.jackrabbit.core.query.jsr283.qom.QueryObjectModel} for a description of the query object
+ * model.
+ *
+ * @since JCR 2.0
+ */
+public interface QueryObjectModelFactory
+        extends QueryObjectModelConstants {
+    ///
+    /// QUERY
+    ///
+
+    /**
+     * Creates a query with one selector.
+     * <p/>
+     * The specified selector will be the <i>default selector</i> of the query.
+     *
+     * @param selector   the selector; non-null
+     * @param constraint the constraint, or null if none
+     * @param orderings  zero or more orderings; null is equivalent to a
+     *                   zero-length array
+     * @param columns    the columns; null is equivalent to a zero-length
+     *                   array
+     * @return the query; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public QueryObjectModel createQuery
+            (Selector selector,
+             Constraint constraint,
+             Ordering[] orderings,
+             Column[] columns) throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Creates a query with one or more selectors.
+     * <p/>
+     * If <code>source</code> is a selector, that selector is the <i>default
+     * selector</i> of the query.  Otherwise the query does not have a default
+     * selector.
+     *
+     * @param source     the node-tuple source; non-null
+     * @param constraint the constraint, or null if none
+     * @param orderings  zero or more orderings; null is equivalent to a
+     *                   zero-length array
+     * @param columns    the columns; null is equivalent to a zero-length
+     *                   array
+     * @return the query; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public QueryObjectModel createQuery
+            (Source source,
+             Constraint constraint,
+             Ordering[] orderings,
+             Column[] columns) throws InvalidQueryException, RepositoryException;
+
+    ///
+    /// SELECTOR
+    ///
+
+    /**
+     * Selects a subset of the nodes in the repository based on node type.
+     * <p/>
+     * The selector name is the node type name.
+     *
+     * @param nodeTypeName the name of the required node type; non-null
+     * @return the selector; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public Selector selector(String nodeTypeName)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Selects a subset of the nodes in the repository based on node type.
+     *
+     * @param nodeTypeName the name of the required node type; non-null
+     * @param selectorName the selector name; non-null
+     * @return the selector; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public Selector selector(String nodeTypeName, String selectorName)
+            throws InvalidQueryException, RepositoryException;
+
+    ///
+    /// JOIN
+    ///
+
+    /**
+     * Performs a join between two node-tuple sources.
+     *
+     * @param left          the left node-tuple source; non-null
+     * @param right         the right node-tuple source; non-null
+     * @param joinType      either
+     *                      <ul>
+     *                      <li>{@link org.apache.jackrabbit.core.query.jsr283.qom.QueryObjectModelConstants#JOIN_TYPE_INNER},</li>
+     *                      <li>{@link org.apache.jackrabbit.core.query.jsr283.qom.QueryObjectModelConstants#JOIN_TYPE_LEFT_OUTER},</li>
+     *                      <li>{@link org.apache.jackrabbit.core.query.jsr283.qom.QueryObjectModelConstants#JOIN_TYPE_RIGHT_OUTER}</li>
+     *                      </ul>
+     * @param joinCondition the join condition; non-null
+     * @return the join; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public Join join
+            (Source left,
+             Source right,
+             int joinType,
+             JoinCondition joinCondition) throws InvalidQueryException, RepositoryException;
+
+    ///
+    /// JOINCONDITION
+    ///
+
+    /**
+     * Tests whether the value of a property in a first selector is equal to the
+     * value of a property in a second selector.
+     *
+     * @param selector1Name the name of the first selector; non-null
+     * @param property1Name the property name in the first selector; non-null
+     * @param selector2Name the name of the second selector; non-null
+     * @param property2Name the property name in the second selector; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public EquiJoinCondition equiJoinCondition
+            (String selector1Name,
+             String property1Name,
+             String selector2Name,
+             String property2Name) throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Tests whether a first selector's node is the same as a second selector's
+     * node.
+     *
+     * @param selector1Name the name of the first selector; non-null
+     * @param selector2Name the name of the second selector; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public SameNodeJoinCondition sameNodeJoinCondition
+            (String selector1Name,
+             String selector2Name) 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.
+     *
+     * @param selector1Name the name of the first selector; non-null
+     * @param selector2Name the name of the second selector; non-null
+     * @param selector2Path the path relative to the second selector; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public SameNodeJoinCondition sameNodeJoinCondition
+            (String selector1Name,
+             String selector2Name,
+             String selector2Path) throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Tests whether a first selector's node is a child of a second selector's
+     * node.
+     *
+     * @param childSelectorName  the name of the child selector; non-null
+     * @param parentSelectorName the name of the parent selector; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public ChildNodeJoinCondition childNodeJoinCondition
+            (String childSelectorName,
+             String parentSelectorName) throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Tests whether a first selector's node is a descendant of a second
+     * selector's node.
+     *
+     * @param descendantSelectorName the name of the descendant selector; non-null
+     * @param ancestorSelectorName   the name of the ancestor selector; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public DescendantNodeJoinCondition descendantNodeJoinCondition
+            (String descendantSelectorName,
+             String ancestorSelectorName) throws InvalidQueryException, RepositoryException;
+
+    ///
+    /// CONSTRAINT
+    ///
+
+    /**
+     * Performs a logical conjunction of two other constraints.
+     *
+     * @param constraint1 the first constraint; non-null
+     * @param constraint2 the second constraint; non-null
+     * @return the <code>And</code> constraint; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public And and(Constraint constraint1, Constraint constraint2)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Performs a logical disjunction of two other constraints.
+     *
+     * @param constraint1 the first constraint; non-null
+     * @param constraint2 the second constraint; non-null
+     * @return the <code>Or</code> constraint; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public Or or(Constraint constraint1, Constraint constraint2)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Performs a logical negation of another constraint.
+     *
+     * @param constraint the constraint to be negated; non-null
+     * @return the <code>Not</code> constraint; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public Not not(Constraint constraint)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Filters node-tuples based on the outcome of a binary operation.
+     *
+     * @param operand1 the first operand; non-null
+     * @param operator the operator; either
+     *                 <ul>
+     *                 <li>{@link #OPERATOR_EQUAL_TO},</li>
+     *                 <li>{@link #OPERATOR_NOT_EQUAL_TO},</li>
+     *                 <li>{@link #OPERATOR_LESS_THAN},</li>
+     *                 <li>{@link #OPERATOR_LESS_THAN_OR_EQUAL_TO},</li>
+     *                 <li>{@link #OPERATOR_GREATER_THAN},</li>
+     *                 <li>{@link #OPERATOR_GREATER_THAN_OR_EQUAL_TO}, or</li>
+     *                 <li>{@link #OPERATOR_LIKE}</li>
+     *                 </ul>
+     * @param operand2 the second operand; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public Comparison comparison
+            (DynamicOperand operand1,
+             int operator,
+             StaticOperand operand2) throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Tests the existence of a property in the default selector.
+     *
+     * @param propertyName the property name; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query has no default selector
+     *                               or is otherwise invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public PropertyExistence propertyExistence(String propertyName)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Tests the existence of a property in the specified selector.
+     *
+     * @param selectorName the selector name; non-null
+     * @param propertyName the property name; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public PropertyExistence propertyExistence
+            (String selectorName,
+             String propertyName) throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Performs a full-text search against the default selector.
+     *
+     * @param propertyName             the property name, or null to search all
+     *                                 full-text indexed properties of the node
+     *                                 (or node subtree, in some implementations)
+     * @param fullTextSearchExpression the full-text search expression; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query has no default selector
+     *                               or is otherwise invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public FullTextSearch fullTextSearch
+            (String propertyName,
+             String fullTextSearchExpression) throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Performs a full-text search against the specified selector.
+     *
+     * @param selectorName             the selector name; non-null
+     * @param propertyName             the property name, or null to search all
+     *                                 full-text indexed properties of the node
+     *                                 (or node subtree, in some implementations)
+     * @param fullTextSearchExpression the full-text search expression; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public FullTextSearch fullTextSearch
+            (String selectorName,
+             String propertyName,
+             String fullTextSearchExpression) throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Tests whether a node in the default selector is reachable by a specified
+     * absolute path.
+     *
+     * @param path an absolute path; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query has no default selector
+     *                               or is otherwise invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public SameNode sameNode(String path)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Tests whether a node in the specified selector is reachable by a specified
+     * absolute path.
+     *
+     * @param selectorName the selector name; non-null
+     * @param path         an absolute path; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public SameNode sameNode(String selectorName, 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.
+     *
+     * @param path an absolute path; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query has no default selector
+     *                               or is otherwise invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public ChildNode childNode(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.
+     *
+     * @param selectorName the selector name; non-null
+     * @param path         an absolute path; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public ChildNode childNode(String selectorName, 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.
+     *
+     * @param path an absolute path; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query has no default selector
+     *                               or is otherwise invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public DescendantNode descendantNode(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.
+     *
+     * @param selectorName the selector name; non-null
+     * @param path         an absolute path; non-null
+     * @return the constraint; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public DescendantNode descendantNode(String selectorName, String path)
+            throws InvalidQueryException, RepositoryException;
+
+    ///
+    /// OPERAND
+    ///
+
+    /**
+     * Evaluates to the value (or values, if multi-valued) of a property of
+     * the default selector.
+     *
+     * @param propertyName the property name; non-null
+     * @return the operand; non-null
+     * @throws InvalidQueryException if the query has no default selector
+     *                               or is otherwise invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public PropertyValue propertyValue(String propertyName)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Evaluates to the value (or values, if multi-valued) of a property in the
+     * specified selector.
+     *
+     * @param selectorName the selector name; non-null
+     * @param propertyName the property name; non-null
+     * @return the operand; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public PropertyValue propertyValue(String selectorName, String propertyName)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Evaluates to the length (or lengths, if multi-valued) of a property.
+     *
+     * @param propertyValue the property value for which to compute the length;
+     *                      non-null
+     * @return the operand; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public Length length(PropertyValue propertyValue)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Evaluates to a <code>NAME</code> value equal to the prefix-qualified name
+     * of a node in the default selector.
+     *
+     * @return the operand; non-null
+     * @throws InvalidQueryException if the query has no default selector
+     *                               or is otherwise invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public NodeName nodeName()
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Evaluates to a <code>NAME</code> value equal to the prefix-qualified name
+     * of a node in the specified selector.
+     *
+     * @param selectorName the selector name; non-null
+     * @return the operand; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public NodeName nodeName(String selectorName)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Evaluates to a <code>NAME</code> value equal to the local (unprefixed)
+     * name of a node in the default selector.
+     *
+     * @return the operand; non-null
+     * @throws InvalidQueryException if the query has no default selector
+     *                               or is otherwise invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public NodeLocalName nodeLocalName()
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Evaluates to a <code>NAME</code> value equal to the local (unprefixed)
+     * name of a node in the specified selector.
+     *
+     * @param selectorName the selector name; non-null
+     * @return the operand; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public NodeLocalName nodeLocalName(String selectorName)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Evaluates to a <code>DOUBLE</code> value equal to the full-text search
+     * score of a node in the default selector.
+     *
+     * @return the operand; non-null
+     * @throws InvalidQueryException if the query has no default selector
+     *                               or is otherwise invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public FullTextSearchScore fullTextSearchScore()
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Evaluates to a <code>DOUBLE</code> value equal to the full-text search
+     * score of a node in the specified selector.
+     *
+     * @param selectorName the selector name; non-null
+     * @return the operand; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public FullTextSearchScore fullTextSearchScore(String selectorName)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Evaluates to the lower-case string value (or values, if multi-valued)
+     * of an operand.
+     *
+     * @param operand the operand whose value is converted to a
+     *                lower-case string; non-null
+     * @return the operand; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public LowerCase lowerCase(DynamicOperand operand)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Evaluates to the upper-case string value (or values, if multi-valued)
+     * of an operand.
+     *
+     * @param operand the operand whose value is converted to a
+     *                upper-case string; non-null
+     * @return the operand; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public UpperCase upperCase(DynamicOperand operand)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Evaluates to the value of a bind variable.
+     *
+     * @param bindVariableName the bind variable name; non-null
+     * @return the operand; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public BindVariableValue bindVariable(String bindVariableName)
+            throws InvalidQueryException, RepositoryException;
+
+    ///
+    /// ORDERING
+    ///
+
+    /**
+     * Orders by the value of the specified operand, in ascending order.
+     *
+     * @param operand the operand by which to order; non-null
+     * @return the ordering
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public Ordering ascending(DynamicOperand operand)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Orders by the value of the specified operand, in descending order.
+     *
+     * @param operand the operand by which to order; non-null
+     * @return the ordering
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public Ordering descending(DynamicOperand operand)
+            throws InvalidQueryException, RepositoryException;
+
+    ///
+    /// COLUMN
+    ///
+
+    /**
+     * Identifies a property in the default selector to include in the tabular
+     * view of query results.
+     * <p/>
+     * The column name is the property name.
+     *
+     * @param propertyName the property name, or null to include a column
+     *                     for each single-value non-residual property of
+     *                     the selector's node type
+     * @return the column; non-null
+     * @throws InvalidQueryException if the query has no default selector
+     *                               or is otherwise invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public Column column(String propertyName)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Identifies a property in the default selector to include in the tabular
+     * view of query results.
+     *
+     * @param propertyName the property name, or null to include a column
+     *                     for each single-value non-residual property of
+     *                     the selector's node type
+     * @param columnName   the column name; must be null if
+     *                     <code>propertyName</code> is null
+     * @return the column; non-null
+     * @throws InvalidQueryException if the query has no default selector
+     *                               or is otherwise invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public Column column(String propertyName, String columnName)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Identifies a property in the specified selector to include in the tabular
+     * view of query results.
+     *
+     * @param selectorName the selector name; non-null
+     * @param propertyName the property name, or null to include a column
+     *                     for each single-value non-residual property of
+     *                     the selector's node type
+     * @param columnName   the column name; if null, defaults to
+     *                     <code>propertyName</code>; must be null if
+     *                     <code>propertyName</code> is null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public Column column
+            (String selectorName,
+             String propertyName,
+             String columnName) throws InvalidQueryException, RepositoryException;
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/QueryObjectModelFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/SameNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/SameNode.java?rev=572936&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/SameNode.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/SameNode.java Wed Sep  5 05:21:44 2007
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.jsr283.qom;
+
+/**
+ * Tests whether the {@link #getSelectorName selector} node is reachable by
+ * absolute path {@link #getPath path}.
+ * <p/>
+ * A node-tuple satisfies the constraint only if:
+ * <pre>  selectorNode.isSame(session.getNode(path))</pre>
+ * would return true, where <code>selectorNode</code> is the node for the
+ * specified selector.
+ * <p/>
+ * The query is invalid if:
+ * <ul>
+ * <li>{@link #getSelectorName selector} is not the name of a selector in the
+ * query, or</li>
+ * <li>{@link #getPath path} is not a syntactically valid absolute path.  Note,
+ * however, that if the path is syntactically valid but does not identify a
+ * node in the repository (or the node is not visible to this session,
+ * because of access control constraints), the query is valid but the
+ * constraint is not satisfied.</li>
+ * </ul>
+ *
+ * @since JCR 2.0
+ */
+public interface SameNode
+        extends Constraint {
+    /**
+     * Gets the name of the selector against which to apply this constraint.
+     *
+     * @return the selector name; non-null
+     */
+    public String getSelectorName();
+
+    /**
+     * Gets the absolute path.
+     *
+     * @return the path; non-null
+     */
+    public String getPath();
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/SameNode.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/SameNodeJoinCondition.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/SameNodeJoinCondition.java?rev=572936&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/SameNodeJoinCondition.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/SameNodeJoinCondition.java Wed Sep  5 05:21:44 2007
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.jsr283.qom;
+
+/**
+ * Tests whether two nodes are "the same" according to the <code>isSame</code>
+ * method of <code>javax.jcr.Item</code>.
+ * <p/>
+ * If {@link #getSelector2Path selector2Path} is omitted:
+ * <ul><li>Tests whether the {@link #getSelector1Name selector1} node is the
+ * same as the {@link #getSelector2Name selector2} node.  A node-tuple
+ * satisfies the constraint only if:
+ * <pre>  selector1Node.isSame(selector2Node)</pre>
+ * would return true, where <code>selector1Node</code> is the node
+ * for {@link #getSelector1Name selector1} and <code>selector2Node</code>
+ * is the node for {@link #getSelector2Name selector2}.</li></ul>
+ * Otherwise, if {@link #getSelector2Path selector2Path} is specified:
+ * <ul><li>Tests whether the {@link #getSelector1Name selector1} node is the
+ * same as a node identified by relative path from the
+ * {@link #getSelector2Name selector2} node.  A node-tuple satisfies
+ * the constraint only if:
+ * <pre>  selector1Node.isSame(selector2Node.getNode(selector2Path))</pre>
+ * would return true, where <code>selector1Node</code> is the node for
+ * {@link #getSelector1Name selector1} and <code>selector2Node</code>
+ * is the node for {@link #getSelector2Name selector2}.</li></ul>
+ * <p/>
+ * The query is invalid if:
+ * <ul>
+ * <li>{@link #getSelector1Name selector1} is not the name of a selector in the
+ * query, or</li>
+ * <li>{@link #getSelector2Name selector2} is not the name of a selector in the
+ * query, or</li>
+ * <li>{@link #getSelector1Name selector1} is the same as
+ * {@link #getSelector2Name selector2}, or</li>
+ * <li>{@link #getSelector2Path selector2Path} is not a syntactically valid
+ * relative path.  Note, however, that if the path is syntactically valid
+ * but does not identify a node in the repository (or the node is not
+ * visible to this session, because of access control constraints), the
+ * query is valid but the constraint is not satisfied.</li>
+ * </ul>
+ *
+ * @since JCR 2.0
+ */
+public interface SameNodeJoinCondition
+        extends JoinCondition {
+    /**
+     * Gets the name of the first selector.
+     *
+     * @return the selector name; non-null
+     */
+    public String getSelector1Name();
+
+    /**
+     * Gets the name of the second selector.
+     *
+     * @return the selector name; non-null
+     */
+    public String getSelector2Name();
+
+    /**
+     * Gets the path relative to the second selector.
+     *
+     * @return the relative path, or null for none
+     */
+    public String getSelector2Path();
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/SameNodeJoinCondition.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Selector.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Selector.java?rev=572936&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Selector.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Selector.java Wed Sep  5 05:21:44 2007
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.jsr283.qom;
+
+/**
+ * Selects a subset of the nodes in the repository based on node type.
+ * <p/>
+ * A selector selects every node in the repository, subject to access control
+ * constraints, that satisfies at least one of the following conditions:
+ * <ul>
+ * <li>the node's primary node type is {@link #getNodeTypeName nodeType},
+ * or</li>
+ * <li>the node's primary node type is a subtype of
+ * {@link #getNodeTypeName nodeType}, or</li>
+ * <li>the node has a mixin node type that is
+ * {@link #getNodeTypeName nodeType}, or</li>
+ * <li>the node has a mixin node type that is a subtype of
+ * {@link #getNodeTypeName nodeType}.</li>
+ * </ul>
+ * <p/>
+ * The query is invalid if {@link #getNodeTypeName nodeType} or
+ * {@link #getSelectorName selectorName} is not a syntactically valid JCR name.
+ * <p/>
+ * The query is invalid if {@link #getSelectorName selectorName} is identical
+ * to the {@link #getSelectorName selectorName} of another selector in the
+ * query.
+ * <p/>
+ * If {@link #getNodeTypeName nodeType} is a valid JCR name but not the name
+ * of a node type available in the repository, the query is valid but the
+ * selector selects no nodes.
+ *
+ * @since JCR 2.0
+ */
+public interface Selector
+        extends Source {
+    /**
+     * Gets the name of the required node type.
+     *
+     * @return the node type name; non-null
+     */
+    public String getNodeTypeName();
+
+    /**
+     * Gets the selector name.
+     * <p/>
+     * A selector's name can be used elsewhere in the query to identify the
+     * selector.
+     *
+     * @return the selector name; non-null
+     */
+    public String getSelectorName();
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Selector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Source.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Source.java?rev=572936&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Source.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Source.java Wed Sep  5 05:21:44 2007
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.jsr283.qom;
+
+/**
+ * Evaluates to a set of node-tuples.
+ *
+ * @since JCR 2.0
+ */
+public interface Source {
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Source.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/StaticOperand.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/StaticOperand.java?rev=572936&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/StaticOperand.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/StaticOperand.java Wed Sep  5 05:21:44 2007
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.jsr283.qom;
+
+/**
+ * An operand whose value can be determined from static analysis of the query,
+ * prior to its evaluation.
+ *
+ * @since JCR 2.0
+ */
+public interface StaticOperand
+        extends Operand {
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/StaticOperand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/UpperCase.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/UpperCase.java?rev=572936&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/UpperCase.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/UpperCase.java Wed Sep  5 05:21:44 2007
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.jsr283.qom;
+
+/**
+ * Evaluates to the upper-case string value (or values, if multi-valued) of
+ * {@link #getOperand operand}.
+ * <p/>
+ * If {@link #getOperand operand} does not evaluate to a string value, its
+ * value is first converted to a string.  The upper-case string value is
+ * computed as though the <code>toUpperCase()</code> method of
+ * <code>java.lang.String</code> were called.
+ * <p/>
+ * If {@link #getOperand operand} evaluates to null, the <code>UpperCase</code>
+ * operand also evaluates to null.
+ *
+ * @since JCR 2.0
+ */
+public interface UpperCase
+        extends DynamicOperand {
+    /**
+     * Gets the operand whose value is converted to a upper-case string.
+     *
+     * @return the operand; non-null
+     */
+    public DynamicOperand getOperand();
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/UpperCase.java
------------------------------------------------------------------------------
    svn:eol-style = native