Added: jackrabbit/sandbox/jackrabbit-j3/src/main/java/org/apache/jackrabbit/j3/query/qom/QueryObjectModelFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-j3/src/main/java/org/apache/jackrabbit/j3/query/qom/QueryObjectModelFactoryImpl.java?rev=932958&view=auto
==============================================================================
--- jackrabbit/sandbox/jackrabbit-j3/src/main/java/org/apache/jackrabbit/j3/query/qom/QueryObjectModelFactoryImpl.java
(added)
+++ jackrabbit/sandbox/jackrabbit-j3/src/main/java/org/apache/jackrabbit/j3/query/qom/QueryObjectModelFactoryImpl.java
Sun Apr 11 17:51:52 2010
@@ -0,0 +1,677 @@
+/*
+ * 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.j3.query.qom;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.query.InvalidQueryException;
+import javax.jcr.query.qom.And;
+import javax.jcr.query.qom.BindVariableValue;
+import javax.jcr.query.qom.ChildNode;
+import javax.jcr.query.qom.ChildNodeJoinCondition;
+import javax.jcr.query.qom.Column;
+import javax.jcr.query.qom.Comparison;
+import javax.jcr.query.qom.Constraint;
+import javax.jcr.query.qom.DescendantNode;
+import javax.jcr.query.qom.DescendantNodeJoinCondition;
+import javax.jcr.query.qom.DynamicOperand;
+import javax.jcr.query.qom.EquiJoinCondition;
+import javax.jcr.query.qom.FullTextSearch;
+import javax.jcr.query.qom.FullTextSearchScore;
+import javax.jcr.query.qom.Join;
+import javax.jcr.query.qom.JoinCondition;
+import javax.jcr.query.qom.Length;
+import javax.jcr.query.qom.Literal;
+import javax.jcr.query.qom.LowerCase;
+import javax.jcr.query.qom.NodeLocalName;
+import javax.jcr.query.qom.NodeName;
+import javax.jcr.query.qom.Not;
+import javax.jcr.query.qom.Or;
+import javax.jcr.query.qom.Ordering;
+import javax.jcr.query.qom.PropertyExistence;
+import javax.jcr.query.qom.PropertyValue;
+import javax.jcr.query.qom.QueryObjectModel;
+import javax.jcr.query.qom.QueryObjectModelConstants;
+import javax.jcr.query.qom.QueryObjectModelFactory;
+import javax.jcr.query.qom.SameNode;
+import javax.jcr.query.qom.SameNodeJoinCondition;
+import javax.jcr.query.qom.Selector;
+import javax.jcr.query.qom.Source;
+import javax.jcr.query.qom.StaticOperand;
+import javax.jcr.query.qom.UpperCase;
+import org.apache.jackrabbit.j3.util.Log;
+import org.apache.jackrabbit.j3.util.LogObject;
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+public class QueryObjectModelFactoryImpl implements QueryObjectModelFactory, LogObject {
+
+ private final Log log;
+
+ public QueryObjectModelFactoryImpl(Log log) {
+ this.log = log;
+ }
+
+ public AndImpl and(Constraint constraint1, Constraint constraint2) throws InvalidQueryException,
+ RepositoryException {
+ log.code(this, "add", constraint1, constraint2);
+ return new AndImpl(constraint1, constraint2);
+ }
+
+ public OrderingImpl ascending(DynamicOperand operand) throws InvalidQueryException, RepositoryException
{
+ log.code(this, "ascending", operand);
+ return new OrderingImpl(operand, QueryObjectModelConstants.JCR_ORDER_ASCENDING);
+ }
+
+ public BindVariableValueImpl bindVariable(String bindVariableName) throws InvalidQueryException,
+ RepositoryException {
+ log.code(this, "bindVariable", bindVariableName);
+ return new BindVariableValueImpl(bindVariableName);
+ }
+
+ public ChildNode childNode(String selectorName, String path) throws InvalidQueryException,
RepositoryException {
+ log.code(this, "childNode", path);
+ // TODO
+ return null;
+ }
+
+ public ChildNodeJoinCondition childNodeJoinCondition(String childSelectorName, String
parentSelectorName)
+ throws InvalidQueryException, RepositoryException {
+ log.code(this, "childNodeJoinCondition", childSelectorName, parentSelectorName);
+ // TODO
+ return null;
+ }
+
+ public Column column(String selectorName, String propertyName, String columnName) throws
InvalidQueryException,
+ RepositoryException {
+ log.code(this, "column", selectorName, propertyName, columnName);
+ // TODO
+ return null;
+ }
+
+ public Comparison comparison(DynamicOperand operand1, String operator, StaticOperand
operand2)
+ throws InvalidQueryException, RepositoryException {
+ log.code(this, "comparison", operand1, operator, operand2);
+ // TODO
+ return null;
+ }
+
+ public QueryObjectModel createQuery(Source source, Constraint constraint, Ordering[]
orderings, Column[] columns)
+ throws InvalidQueryException, RepositoryException {
+ log.code(this, "createQuery", source, constraint, orderings, columns);
+ // TODO
+ return null;
+ }
+
+ public DescendantNode descendantNode(String selectorName, String path) throws InvalidQueryException,
+ RepositoryException {
+ log.code(this, "descendantNode", path);
+ // TODO
+ return null;
+ }
+
+ public DescendantNodeJoinCondition descendantNodeJoinCondition(String descendantSelectorName,
+ String ancestorSelectorName) throws InvalidQueryException, RepositoryException
{
+ log.code(this, "descendantNodeJoinCondition", ancestorSelectorName);
+ // TODO
+ return null;
+ }
+
+ public Ordering descending(DynamicOperand operand) throws InvalidQueryException, RepositoryException
{
+ log.code(this, "descending", operand);
+ // TODO
+ return null;
+ }
+
+ public EquiJoinCondition equiJoinCondition(String selector1Name, String property1Name,
String selector2Name,
+ String property2Name) throws InvalidQueryException, RepositoryException {
+ log.code(this, "equiJoinCondition", selector1Name, property1Name, selector2Name,
property2Name);
+ // TODO
+ return null;
+ }
+
+ public FullTextSearch fullTextSearch(String selectorName, String propertyName,
+ StaticOperand fullTextSearchExpression) throws InvalidQueryException, RepositoryException
{
+ log.code(this, "fullTextSearch", selectorName, propertyName, fullTextSearchExpression);
+ // TODO
+ return null;
+ }
+
+ public FullTextSearchScore fullTextSearchScore(String selectorName) throws InvalidQueryException,
+ RepositoryException {
+ log.code(this, "fullTextSearchScore", selectorName);
+ // TODO
+ return null;
+ }
+
+ public Join join(Source left, Source right, String joinType, JoinCondition joinCondition)
+ throws InvalidQueryException, RepositoryException {
+ log.code(this, "join", left, right, joinType, joinCondition);
+ // TODO
+ return null;
+ }
+
+ public Length length(PropertyValue propertyValue) throws InvalidQueryException, RepositoryException
{
+ log.code(this, "length", propertyValue);
+ // TODO
+ return null;
+ }
+
+ public Literal literal(Value literalValue) throws InvalidQueryException, RepositoryException
{
+ log.code(this, "literal", literalValue);
+ // TODO
+ return null;
+ }
+
+ public LowerCase lowerCase(DynamicOperand operand) throws InvalidQueryException, RepositoryException
{
+ log.code(this, "lowerCase", operand);
+ // TODO
+ return null;
+ }
+
+ public NodeLocalName nodeLocalName(String selectorName) throws InvalidQueryException,
RepositoryException {
+ log.code(this, "nodeLocalName", selectorName);
+ // TODO
+ return null;
+ }
+
+ public NodeName nodeName(String selectorName) throws InvalidQueryException, RepositoryException
{
+ log.code(this, "nodeName", selectorName);
+ // TODO
+ return null;
+ }
+
+ public Not not(Constraint constraint) throws InvalidQueryException, RepositoryException
{
+ log.code(this, "not", constraint);
+ // TODO
+ return null;
+ }
+
+ public Or or(Constraint constraint1, Constraint constraint2) throws InvalidQueryException,
RepositoryException {
+ log.code(this, "or", constraint1, constraint2);
+ // TODO
+ return null;
+ }
+
+ public PropertyExistence propertyExistence(String selectorName, String propertyName)
throws InvalidQueryException,
+ RepositoryException {
+ log.code(this, "propertyExistence", selectorName, propertyName);
+ // TODO
+ return null;
+ }
+
+ public PropertyValue propertyValue(String selectorName, String propertyName) throws InvalidQueryException,
+ RepositoryException {
+ log.code(this, "propertyValue", selectorName, propertyName);
+ // TODO
+ return null;
+ }
+
+ public SameNode sameNode(String selectorName, String path) throws InvalidQueryException,
RepositoryException {
+ log.code(this, "sameNode", selectorName, path);
+ // TODO
+ return null;
+ }
+
+ public SameNodeJoinCondition sameNodeJoinCondition(String selector1Name, String selector2Name,
String selector2Path)
+ throws InvalidQueryException, RepositoryException {
+ log.code(this, "sameNodeJoinCondition", selector1Name, selector2Name, selector2Path);
+ // TODO
+ return null;
+ }
+
+ public Selector selector(String nodeTypeName, String selectorName) throws InvalidQueryException,
+ RepositoryException {
+ log.code(this, "selector", nodeTypeName, selectorName);
+ // TODO
+ return null;
+ }
+
+ public UpperCase upperCase(DynamicOperand operand) throws InvalidQueryException, RepositoryException
{
+ log.code(this, "upperCase", operand);
+ // TODO
+ return null;
+ }
+
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class AndImpl implements And {
+
+ private final Constraint constraint1, constraint2;
+
+ public AndImpl(Constraint constraint1, Constraint constraint2) {
+ this.constraint1 = constraint1;
+ this.constraint2 = constraint2;
+ }
+
+ public Constraint getConstraint1() {
+ return constraint1;
+ }
+
+ public Constraint getConstraint2() {
+ return constraint2;
+ }
+
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class BindVariableValueImpl implements BindVariableValue {
+
+ private final String bindVariableName;
+
+ public BindVariableValueImpl(String bindVariableName) {
+ this.bindVariableName = bindVariableName;
+ }
+
+ public String getBindVariableName() {
+ return bindVariableName;
+ }
+
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class ChildNodeImpl implements ChildNode {
+
+ public String getParentPath() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getSelectorName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class ChildNodeJoinConditionImpl implements ChildNodeJoinCondition {
+
+ public String getChildSelectorName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getParentSelectorName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class ColumnImpl implements Column {
+
+ public String getColumnName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getPropertyName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getSelectorName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class ComparisonImpl implements Comparison {
+
+ public DynamicOperand getOperand1() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public StaticOperand getOperand2() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getOperator() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class DescendantNodeImpl implements DescendantNode {
+
+ public String getAncestorPath() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getSelectorName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class DescendantNodeJoinConditionImpl implements DescendantNodeJoinCondition {
+
+ public String getAncestorSelectorName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getDescendantSelectorName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class EquiJoinConditionImpl implements EquiJoinCondition {
+
+ public String getProperty1Name() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getProperty2Name() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getSelector1Name() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getSelector2Name() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class FullTextSearchImpl implements FullTextSearch {
+
+ public StaticOperand getFullTextSearchExpression() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getPropertyName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getSelectorName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class FullTextSearchScoreImpl implements FullTextSearchScore {
+
+ public String getSelectorName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class JoinImpl implements Join {
+
+ public JoinCondition getJoinCondition() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getJoinType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Source getLeft() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Source getRight() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class LengthImpl implements Length {
+
+ public PropertyValue getPropertyValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class LiteralImpl implements Literal {
+
+ public Value getLiteralValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class LowerCaseImpl implements LowerCase {
+
+ public DynamicOperand getOperand() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class NodeLocalNameImpl implements NodeLocalName {
+
+ public String getSelectorName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class NodeNameImpl implements NodeName {
+
+ public String getSelectorName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class NotImpl implements Not {
+
+ public Constraint getConstraint() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class OrImpl implements Or {
+
+ public Constraint getConstraint1() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Constraint getConstraint2() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class OrderingImpl implements Ordering {
+
+ private final DynamicOperand operand;
+ private final String order;
+
+ public OrderingImpl(DynamicOperand operand, String order) {
+ this.operand = operand;
+ this.order = order;
+ }
+
+ public DynamicOperand getOperand() {
+ return operand;
+ }
+
+ public String getOrder() {
+ return order;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class PropertyExistenceImpl implements PropertyExistence {
+
+ public String getPropertyName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getSelectorName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class PropertyValueImpl implements PropertyValue {
+
+ public String getPropertyName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getSelectorName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class SameNodeImpl implements SameNode {
+
+ public String getPath() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getSelectorName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class SameNodeJoinConditionImpl implements SameNodeJoinCondition {
+
+ public String getSelector1Name() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getSelector2Name() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getSelector2Path() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class SelectorImpl implements Selector {
+
+ public String getNodeTypeName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getSelectorName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+class UpperCaseImpl implements UpperCase {
+
+ public DynamicOperand getOperand() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
Added: jackrabbit/sandbox/jackrabbit-j3/src/main/java/org/apache/jackrabbit/j3/query/qom/QueryObjectModelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-j3/src/main/java/org/apache/jackrabbit/j3/query/qom/QueryObjectModelImpl.java?rev=932958&view=auto
==============================================================================
--- jackrabbit/sandbox/jackrabbit-j3/src/main/java/org/apache/jackrabbit/j3/query/qom/QueryObjectModelImpl.java
(added)
+++ jackrabbit/sandbox/jackrabbit-j3/src/main/java/org/apache/jackrabbit/j3/query/qom/QueryObjectModelImpl.java
Sun Apr 11 17:51:52 2010
@@ -0,0 +1,129 @@
+/*
+ * 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.j3.query.qom;
+
+import javax.jcr.ItemExistsException;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.RepositoryException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.Value;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.query.InvalidQueryException;
+import javax.jcr.query.QueryResult;
+import javax.jcr.query.qom.Column;
+import javax.jcr.query.qom.Constraint;
+import javax.jcr.query.qom.Ordering;
+import javax.jcr.query.qom.QueryObjectModel;
+import javax.jcr.query.qom.Source;
+import javax.jcr.version.VersionException;
+import org.apache.jackrabbit.j3.util.Log;
+import org.apache.jackrabbit.j3.util.LogObject;
+
+/**
+ * The implementation of the corresponding JCR interface.
+ */
+public class QueryObjectModelImpl implements QueryObjectModel, LogObject {
+
+ private final Log log;
+
+ QueryObjectModelImpl(Log log) {
+ this.log = log;
+ }
+
+ public Column[] getColumns() {
+ log.code(this, "getColumns");
+ // TODO
+ return null;
+ }
+
+ public Constraint getConstraint() {
+ log.code(this, "getConstraint");
+ // TODO
+ return null;
+ }
+
+ public Ordering[] getOrderings() {
+ log.code(this, "getOrderings");
+ // TODO
+ return null;
+ }
+
+ public Source getSource() {
+ log.code(this, "getSource");
+ // TODO
+ return null;
+ }
+
+ public void bindValue(String varName, Value value) throws IllegalArgumentException, RepositoryException
{
+ log.code(this, "bindValue", varName, value);
+ // TODO
+
+ }
+
+ public QueryResult execute() throws InvalidQueryException, RepositoryException {
+ log.code(this, "execute");
+ // TODO
+ return null;
+ }
+
+ public String[] getBindVariableNames() throws RepositoryException {
+ log.code(this, "getBindVariableNames");
+ // TODO
+ return null;
+ }
+
+ public String getLanguage() {
+ log.code(this, "getLanguage");
+ // TODO
+ return null;
+ }
+
+ public String getStatement() {
+ log.code(this, "getStatement");
+ // TODO
+ return null;
+ }
+
+ public String getStoredQueryPath() throws ItemNotFoundException, RepositoryException
{
+ log.code(this, "getStoredQueryPath");
+ // TODO
+ return null;
+ }
+
+ public void setLimit(long limit) {
+ log.code(this, "setLimit", limit);
+ // TODO
+
+ }
+
+ public void setOffset(long offset) {
+ log.code(this, "setOffset", offset);
+ // TODO
+
+ }
+
+ public Node storeAsNode(String absPath) throws ItemExistsException, PathNotFoundException,
VersionException,
+ ConstraintViolationException, LockException, UnsupportedRepositoryOperationException,
RepositoryException {
+ log.code(this, "storeAsNode", absPath);
+ // TODO
+ return null;
+ }
+
+}
|