You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by pp...@apache.org on 2009/03/20 20:47:29 UTC
svn commit: r756730 [1/2] - in /openjpa/trunk:
openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/
openjpa-persistence/src/main/java/org/apache/openjpa/persistence/
openjpa-persistence/src/main/java/org/apache/openjpa/persis...
Author: ppoddar
Date: Fri Mar 20 19:47:26 2009
New Revision: 756730
URL: http://svn.apache.org/viewvc?rev=756730&view=rev
Log:
OPENJPA-995: Refactor OpenJPA Criteria query implementation as 'dynamic query' extension.
Added:
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/Aggregate.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/CaseExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/DomainObject.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/Expression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/FetchJoinObject.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/OrderBy.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/OrderByItem.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/PathExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/Predicate.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/PredicateOperand.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryBuilder.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryDefinition.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/SelectItem.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/Subquery.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/TrimSpec.java
Modified:
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestCriteria.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAEntityManager.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAEntityManagerFactory.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AbstractDomainObject.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AbstractPath.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AliasContext.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AllExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AndPredicate.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AnyExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/BetweenExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/BinaryExpressionPredicate.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/BinaryOperatorExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/CaseExpressionImpl.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/CountExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/DistinctExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/DividedByExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ElseExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/EqualExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ExpressionImpl.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/FetchPath.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/GreaterEqualExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/GreaterThanExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/InExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/IndexExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/IsEmptyExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/IsNullExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/JoinPath.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LengthExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LessEqualExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LessThanExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LikeExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LocateExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LogicalPredicate.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LowerExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/MaxExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/MemberOfExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/MinExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/MinusExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/NavigationPath.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/NewInstance.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/NotEqualExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/OpenJPAQueryBuilder.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/OrPredicate.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/OrderableItem.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/PlusExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryBuilderImpl.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryDefinitionImpl.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/RangeExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/RootPath.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/SizeExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/SomeExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/SquareRootExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/SubStringExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/SumExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/TimesExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/TrimExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/TypeExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/UnaryExpressionPredicate.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/UnaryMinusExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/UnaryOperatorExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/UpperExpression.java
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/VarArgsExpression.java
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestCriteria.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestCriteria.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestCriteria.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestCriteria.java Fri Mar 20 19:47:26 2009
@@ -21,16 +21,16 @@
import java.util.List;
-import javax.persistence.DomainObject;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Expression;
import javax.persistence.Query;
-import javax.persistence.QueryDefinition;
-import javax.persistence.SelectItem;
+import org.apache.openjpa.persistence.OpenJPAEntityManager;
+import org.apache.openjpa.persistence.OpenJPAEntityManagerFactory;
+import org.apache.openjpa.persistence.query.DomainObject;
+import org.apache.openjpa.persistence.query.Expression;
import org.apache.openjpa.persistence.query.OpenJPAQueryBuilder;
import org.apache.openjpa.persistence.query.QueryBuilderImpl;
+import org.apache.openjpa.persistence.query.QueryDefinition;
+import org.apache.openjpa.persistence.query.SelectItem;
import org.apache.openjpa.persistence.test.SingleEMFTestCase;
@@ -53,7 +53,7 @@
*/
public class TestCriteria extends SingleEMFTestCase {
protected OpenJPAQueryBuilder qb;
- private static EntityManagerFactory emf = null;
+ private static OpenJPAEntityManagerFactory emf = null;
protected StringComparison comparator = new StringComparison();
public void setUp() {
@@ -82,7 +82,7 @@
VideoStore.class);
emf = super.emf;
}
- qb = (QueryBuilderImpl)emf.getQueryBuilder();
+ qb = (QueryBuilderImpl)emf.getDynamicQueryBuilder();
emf.createEntityManager();
}
@@ -540,14 +540,14 @@
* their results.
*/
private void executeActually(String jpql, QueryDefinition q, Object...p) {
- EntityManager em = emf.createEntityManager();
+ OpenJPAEntityManager em = emf.createEntityManager();
List<?> criteriaResult = null;
List<?> jpqlResult = null;
Throwable criteriaError = null;
Throwable jpqlError = null;
try {
- Query cq = em.createQuery(q);
+ Query cq = em.createDynamicQuery(q);
setParameters(cq, p);
criteriaResult = cq.getResultList();
} catch (Exception e) {
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java Fri Mar 20 19:47:26 2009
@@ -30,6 +30,8 @@
import javax.persistence.Cache;
import javax.persistence.EntityManagerFactory;
+import javax.persistence.QueryBuilder;
+
import org.apache.openjpa.conf.OpenJPAConfiguration;
import org.apache.openjpa.enhance.Reflection;
import org.apache.openjpa.kernel.AutoDetach;
@@ -350,8 +352,12 @@
return getStoreCache();
}
- public OpenJPAQueryBuilder getQueryBuilder() {
- return new QueryBuilderImpl(this);
+ public QueryBuilder getQueryBuilder() {
+ return null;
+ }
+
+ public OpenJPAQueryBuilder getDynamicQueryBuilder() {
+ return new QueryBuilderImpl(this);
}
public Set<String> getSupportedProperties() {
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java Fri Mar 20 19:47:26 2009
@@ -41,6 +41,7 @@
import javax.persistence.FlushModeType;
import javax.persistence.LockModeType;
import javax.persistence.Query;
+import javax.persistence.QueryBuilder;
import javax.persistence.QueryDefinition;
import org.apache.commons.lang.StringUtils;
@@ -1482,7 +1483,12 @@
}
public Query createQuery(QueryDefinition qdef) {
- String jpql = getQueryBuilder().toJPQL(qdef);
+ return null;
+ }
+
+ public OpenJPAQuery createDynamicQuery(
+ org.apache.openjpa.persistence.query.QueryDefinition qdef) {
+ String jpql = _emf.getDynamicQueryBuilder().toJPQL(qdef);
return createQuery(jpql);
}
@@ -1501,8 +1507,8 @@
return finalMap;
}
- public OpenJPAQueryBuilder getQueryBuilder() {
- return new QueryBuilderImpl(_emf);
+ public QueryBuilder getQueryBuilder() {
+ return null;
}
public Set<String> getSupportedProperties() {
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAEntityManager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAEntityManager.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAEntityManager.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAEntityManager.java Fri Mar 20 19:47:26 2009
@@ -31,6 +31,7 @@
import org.apache.openjpa.kernel.ConnectionRetainModes;
import org.apache.openjpa.kernel.DetachState;
import org.apache.openjpa.kernel.RestoreState;
+import org.apache.openjpa.persistence.query.QueryDefinition;
/**
* Interface implemented by OpenJPA entity managers.
@@ -660,6 +661,13 @@
* Create a new query in the given language.
*/
public OpenJPAQuery createQuery(String language, String query);
+
+ /**
+ * Create an executable query from a dynamically defined query.
+ *
+ * @since 2.0.0
+ */
+ public OpenJPAQuery createDynamicQuery(QueryDefinition dynamic);
///////////
// Locking
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAEntityManagerFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAEntityManagerFactory.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAEntityManagerFactory.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAEntityManagerFactory.java Fri Mar 20 19:47:26 2009
@@ -20,9 +20,11 @@
import java.io.Serializable;
import java.util.Map;
-import java.util.Properties;
+
import javax.persistence.EntityManagerFactory;
+import org.apache.openjpa.persistence.query.QueryBuilder;
+
/**
* Interface implemented by OpenJPA entity manager factories.
*
@@ -123,4 +125,9 @@
* method pierces the published-API boundary, as does the SPI cast.
*/
public void removeTransactionListener(Object listener);
+
+ /**
+ * Gets a builder for dynamic queries.
+ */
+ public QueryBuilder getDynamicQueryBuilder();
}
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AbstractDomainObject.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AbstractDomainObject.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AbstractDomainObject.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AbstractDomainObject.java Fri Mar 20 19:47:26 2009
@@ -22,17 +22,6 @@
import java.util.Date;
import java.util.List;
-import javax.persistence.CaseExpression;
-import javax.persistence.DomainObject;
-import javax.persistence.Expression;
-import javax.persistence.FetchJoinObject;
-import javax.persistence.OrderByItem;
-import javax.persistence.PathExpression;
-import javax.persistence.Predicate;
-import javax.persistence.QueryDefinition;
-import javax.persistence.SelectItem;
-import javax.persistence.Subquery;
-
/**
* Domain Object is a path expression over which query is evaluated.
* Domain object acts as a proxy for a QueryDefinition via delegation.
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AbstractPath.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AbstractPath.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AbstractPath.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AbstractPath.java Fri Mar 20 19:47:26 2009
@@ -20,11 +20,6 @@
import java.util.LinkedList;
-import javax.persistence.Aggregate;
-import javax.persistence.Expression;
-import javax.persistence.PathExpression;
-import javax.persistence.Predicate;
-
/**
* An abstract path is formed by two parts : the first part is a parent path.
* The second part can be an attribute or an operation (e.g. KEY() or VALUE())
@@ -49,7 +44,8 @@
protected final PathOperator _operator;
protected final QueryDefinitionImpl _owner;
- protected AbstractPath(QueryDefinitionImpl owner, AbstractPath parent, PathOperator op, Object part2) {
+ protected AbstractPath(QueryDefinitionImpl owner, AbstractPath parent,
+ PathOperator op, Object part2) {
_owner = owner;
_parent = parent;
_part2 = part2;
Added: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/Aggregate.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/Aggregate.java?rev=756730&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/Aggregate.java (added)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/Aggregate.java Fri Mar 20 19:47:26 2009
@@ -0,0 +1,30 @@
+/*
+ * 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.openjpa.persistence.query;
+
+/**
+ * Type of the result of an aggregate operation
+ */
+public interface Aggregate extends Expression {
+ /**
+ * Specify that duplicates are to be removed before the aggregate operation
+ * is invoked.
+ */
+ Expression distinct();
+}
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AliasContext.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AliasContext.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AliasContext.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AliasContext.java Fri Mar 20 19:47:26 2009
@@ -22,8 +22,6 @@
import java.util.Map;
import java.util.Stack;
-import javax.persistence.Expression;
-
import org.apache.openjpa.meta.MetaDataRepository;
class AliasContext {
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AllExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AllExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AllExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AllExpression.java Fri Mar 20 19:47:26 2009
@@ -18,10 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.DomainObject;
-import javax.persistence.QueryDefinition;
-import javax.persistence.Subquery;
-
/**
* Denotes All(SubQuery) Expression.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AndPredicate.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AndPredicate.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AndPredicate.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AndPredicate.java Fri Mar 20 19:47:26 2009
@@ -18,7 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Predicate;
import static org.apache.openjpa.persistence.query.ConditionalOperator.*;
/**
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AnyExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AnyExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AnyExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/AnyExpression.java Fri Mar 20 19:47:26 2009
@@ -18,9 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.QueryDefinition;
-import javax.persistence.Subquery;
-
/**
* Denotes ANY(SUbquery) Expression.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/BetweenExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/BetweenExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/BetweenExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/BetweenExpression.java Fri Mar 20 19:47:26 2009
@@ -18,9 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
-
/**
* Denotes e1 BETWEEN(e2 AND e3) Expression.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/BinaryExpressionPredicate.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/BinaryExpressionPredicate.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/BinaryExpressionPredicate.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/BinaryExpressionPredicate.java Fri Mar 20 19:47:26 2009
@@ -18,9 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-import javax.persistence.Predicate;
-
/**
* Binary predicate combines two expressions with an operator.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/BinaryOperatorExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/BinaryOperatorExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/BinaryOperatorExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/BinaryOperatorExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* An expression resulting from a binary operation on two expressions.
*
Added: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/CaseExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/CaseExpression.java?rev=756730&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/CaseExpression.java (added)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/CaseExpression.java Fri Mar 20 19:47:26 2009
@@ -0,0 +1,299 @@
+/*
+ * 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.openjpa.persistence.query;
+
+import java.util.Calendar;
+import java.util.Date;
+
+/**
+ * Interface for the construction of case expressions
+ */
+public interface CaseExpression {
+ /**
+ * Add a when predicate clause to a general case expression. The when
+ * predicate must be followed by the corresponding then case expression that
+ * specifies the result of the specific case. Clauses are evaluated in the
+ * order added.
+ *
+ * @param pred -
+ * corresponds to the evaluation condition for the specific case
+ * @return CaseExpression corresponding to the case with the added when
+ * clause
+ */
+ CaseExpression when(Predicate pred);
+
+ /**
+ * Add a when clause to a simple case expression. The when case expression
+ * must be followed by the corresponding then case expression that specifies
+ * the result of the specific case. Clauses are evaluated in the order added
+ *
+ * @param when -
+ * corresponds to the value against which the case operand of the
+ * simple case is tested
+ * @return CaseExpression corresponding to the case with the added clause
+ */
+ CaseExpression when(Expression when);
+
+ /**
+ * Add a when clause to a simple case expression. The when case expression
+ * must be followed by the corresponding then case expression that specifies
+ * the result of the specific case. Clauses are evaluated in the order added
+ *
+ * @param when -
+ * corresponds to the value against which the case operand of the
+ * simple case is tested
+ * @return CaseExpression corresponding to the case with the added clause
+ */
+ CaseExpression when(Number when);
+
+ /**
+ * Add a when clause to a simple case expression. The when case expression
+ * must be followed by the corresponding then case expression that specifies
+ * the result of the specific case. Clauses are evaluated in the order added
+ *
+ * @param when -
+ * corresponds to the value against which the
+ * case operand of the simple case is tested
+ * @return CaseExpression corresponding to the case with the added clause
+ */
+ CaseExpression when(String when);
+
+ /**
+ * Add a when clause to a simple case expression. The when case expression
+ * must be followed by the corresponding then case expression that specifies
+ * the result of the specific case. Clauses are evaluated in the order added
+ *
+ * @param when -
+ * corresponds to the value against which the case operand of the
+ * simple case is tested
+ * @return CaseExpression corresponding to the case with the added clause
+ */
+ CaseExpression when(Date when);
+
+ /**
+ * Add a when clause to a simple case expression. The when case expression
+ * must be followed by the corresponding then case expression that specifies
+ * the result of the specific case. Clauses are evaluated in the order added
+ *
+ * @param when -
+ * corresponds to the value against which the case operand of the
+ * simple case is tested
+ * @return CaseExpression corresponding to the case with the added clause
+ */
+ CaseExpression when(Calendar when);
+
+ /**
+ * Add a when clause to a simple case expression. The when case expression
+ * must be followed by the corresponding then case expression that specifies
+ * the result of the specific case. Clauses are evaluated in the order added
+ *
+ * @param when -
+ * corresponds to the value against which the case operand of the
+ * simple case is tested
+ * @return CaseExpression corresponding to the case with the added clause
+ */
+ CaseExpression when(Class when);
+
+ /**
+ * Add a when clause to a simple case expression. The when case expression
+ * must be followed by the corresponding then case expression that specifies
+ * the result of the specific case. Clauses are evaluated in the order added
+ *
+ * @param when -
+ * corresponds to the value against which the case operand of the
+ * simple case is tested
+ * @return CaseExpression corresponding to the case with the added clause
+ */
+ CaseExpression when(Enum<?> when);
+
+ /**
+ * Add a then clause to a general or simple case expression. The then clause
+ * specifies the result corresponding to the immediately preceding when.
+ * Clauses are evaluated in the order added.
+ *
+ * @param then -
+ * corresponds to the result of the case expression if the when
+ * is satisfied
+ * @return CaseExpression corresponding to the case with the added then
+ * clause
+ */
+ CaseExpression then(Expression then);
+
+ /**
+ * Add a then clause to a general or simple case expression. The then clause
+ * specifies the result corresponding to the immediately preceding when.
+ * Clauses are evaluated in the order added.
+ *
+ * @param then -
+ * corresponds to the result of the case expression if the when
+ * is satisfied
+ * @return CaseExpression corresponding to the case with the added then
+ * clause
+ */
+ CaseExpression then(Number then);
+
+ /**
+ * Add a then clause to a general or simple case expression. The then clause
+ * specifies the result corresponding to the immediately preceding when.
+ * Clauses are evaluated in the order added.
+ *
+ * @param then -
+ * corresponds to the result of the case expression if the when
+ * is satisfied
+ * @return CaseExpression corresponding to the case with the added then
+ * clause
+ */
+ CaseExpression then(String then);
+
+ /**
+ * Add a then clause to a general or simple case expression. The then clause
+ * specifies the result corresponding to the immediately preceding when.
+ * Clauses are evaluated in the order added.
+ *
+ * @param then -
+ * corresponds to the result of the case expression if the when
+ * is satisfied
+ * @return CaseExpression corresponding to the case with the added then
+ * clause
+ */
+ CaseExpression then(Date then);
+
+ /**
+ * Add a then clause to a general or simple case expression. The then clause
+ * specifies the result corresponding to the immediately preceding when.
+ * Clauses are evaluated in the order added.
+ *
+ * @param then -
+ * corresponds to the result of the case expression if the when
+ * is satisfied
+ * @return CaseExpression corresponding to the case with the added then
+ * clause
+ */
+ CaseExpression then(Calendar then);
+
+ /**
+ * Add a then clause to a general or simple case expression. The then clause
+ * specifies the result corresponding to the immediately preceding when.
+ * Clauses are evaluated in the order added.
+ *
+ * @param then -
+ * corresponds to the result of the case expression if the when
+ * is satisfied
+ * @return CaseExpression corresponding to the case with the added then
+ * clause
+ */
+ CaseExpression then(Class then);
+
+ /**
+ * Add a then clause to a general or simple case expression. The then clause
+ * specifies the result corresponding to the immediately preceding when.
+ * Clauses are evaluated in the order added.
+ *
+ * @param then -
+ * corresponds to the result of the case expression if the when
+ * is satisfied
+ * @return CaseExpression corresponding to the case with the added then
+ * clause
+ */
+ CaseExpression then(Enum<?> then);
+
+ /**
+ * Add else to a case expression. A case expression must have an else
+ * clause.
+ *
+ * @param arg -
+ * corresponds to the result of the case expression if the when
+ * condition is not satisfied
+ * @return Expression corresponding to the case expression with the added
+ * clause
+ */
+ Expression elseCase(Expression arg);
+
+ /**
+ * Add else to a case expression. A case expression must have an else
+ * clause.
+ *
+ * @param arg -
+ * corresponds to the result of the case expression if the when
+ * condition is not satisfied
+ * @return Expression corresponding to the case expression with the added
+ * clause
+ */
+ Expression elseCase(String arg);
+
+ /**
+ * Add else to a case expression. A case expression must have an else
+ * clause.
+ *
+ * @param arg -
+ * corresponds to the result of the case expression if the when
+ * condition is not satisfied
+ * @return Expression corresponding to the case expression with the added
+ * clause
+ */
+ Expression elseCase(Number arg);
+
+ /**
+ * Add else to a case expression. A case expression must have an else
+ * clause.
+ *
+ * @param arg -
+ * corresponds to the result of the case expression if the when
+ * condition is not satisfied
+ * @return Expression corresponding to the case expression with the added
+ * clause
+ */
+ Expression elseCase(Date arg);
+
+ /**
+ * Add else to a case expression. A case expression must have an else
+ * clause.
+ *
+ * @param arg -
+ * corresponds to the result of the case expression if the when
+ * condition is not satisfied
+ * @return Expression corresponding to the case expression with the added
+ * clause
+ */
+ Expression elseCase(Calendar arg);
+
+ /**
+ * Add else to a case expression. A case expression must have an else
+ * clause.
+ *
+ * @param arg -
+ * corresponds to the result of the case expression if the when
+ * condition is not satisfied
+ * @return Expression corresponding to the case expression with the added
+ * clause
+ */
+ Expression elseCase(Class arg);
+
+ /**
+ * Add else to a case expression. A case expression must have an else
+ * clause.
+ *
+ * @param arg -
+ * corresponds to the result of the case expression if the when
+ * condition is not satisfied
+ * @return Expression corresponding to the case expression with the added
+ * clause
+ */
+ Expression elseCase(Enum<?> arg);
+}
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/CaseExpressionImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/CaseExpressionImpl.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/CaseExpressionImpl.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/CaseExpressionImpl.java Fri Mar 20 19:47:26 2009
@@ -22,10 +22,6 @@
import java.util.Date;
import java.util.LinkedList;
-import javax.persistence.CaseExpression;
-import javax.persistence.Expression;
-import javax.persistence.Predicate;
-
public class CaseExpressionImpl implements CaseExpression, Visitable {
private LinkedList<WhenClause> _whens = new LinkedList<WhenClause>();
private final Object _caseOperand;
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/CountExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/CountExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/CountExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/CountExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Denotes COUNT(e) Expression.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/DistinctExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/DistinctExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/DistinctExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/DistinctExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Denotes DISTINCT(e) Expression.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/DividedByExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/DividedByExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/DividedByExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/DividedByExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Denotes e1/e2 Expression.
*
Added: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/DomainObject.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/DomainObject.java?rev=756730&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/DomainObject.java (added)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/DomainObject.java Fri Mar 20 19:47:26 2009
@@ -0,0 +1,123 @@
+/*
+ * 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.openjpa.persistence.query;
+
+/**
+ * Domain objects define the domain over which a query operates. A domain object
+ * plays a role analogous to that of a Java Persistence query language
+ * identification variable.
+ */
+public interface DomainObject extends PathExpression, QueryDefinition {
+ /**
+ * Extend the query domain by joining with a class that can be navigated to
+ * or that is embedded in the class corresponding to the domain object on
+ * which the method is invoked. This method is permitted to be invoked only
+ * when defining the domain of the query. It must not be invoked within the
+ * context of the select, where, groupBy, or having operations. The domain
+ * object must correspond to a class that contains the referenced attribute.
+ * The query definition is modified to include the newly joined domain
+ * object.
+ *
+ * @param attribute -
+ * name of the attribute that references the target of the join
+ * @return the new DomainObject that is added for the target of the join
+ */
+ DomainObject join(String attribute);
+
+ /**
+ * Extend the query domain by left outer joining with a class that can be
+ * navigated to or that is embedded in the class corresponding to the domain
+ * object on which the method is invoked. This method is permitted to be
+ * invoked only when defining the domain of the query. It must not be
+ * invoked within the context of the select, where, groupBy, or having
+ * operations. The domain object must correspond to a class that contains
+ * the referenced attribute. The query definition is modified to include the
+ * newly joined domain object.
+ *
+ * @param attribute -
+ * name of the attribute that references the target of the join
+ * @return the new DomainObject that is added for the target of the join
+ */
+ DomainObject leftJoin(String attribute);
+
+ /**
+ * Specify that the association or element collection that is referenced by
+ * the attribute be eagerly fetched through use of an inner join. The domain
+ * object must correspond to a class that contains the referenced attribute.
+ * The query is modified to include the joined domain object.
+ *
+ * @param attribute -
+ * name of the attribute that references the target of the join
+ * @return the FetchJoinObject that is added for the target of the join
+ */
+ FetchJoinObject joinFetch(String attribute);
+
+ /**
+ * Specify that the association or element collection that is referenced by
+ * the attribute be eagerly fetched through use of a left outer join. The
+ * domain object must correspond to a class that contains the referenced
+ * attribute. The query is modified to include the joined domain object.
+ *
+ * @param attribute -
+ * name of the attribute that references the target of the join
+ * @return the FetchJoinObject that is added for the target of the join
+ */
+ FetchJoinObject leftJoinFetch(String attribute);
+
+ /**
+ * Return a path expression corresponding to the value of a map-valued
+ * association or element collection. This method is only permitted to be
+ * invoked upon a domain object that corresponds to a map-valued association
+ * or element collection.
+ *
+ * @return PathExpression corresponding to the map value
+ */
+ PathExpression value();
+
+ /**
+ * Return a path expression corresponding to the key of a map-valued
+ * association or element collection. This method is only permitted to be
+ * invoked upon a domain object that corresponds to a map-valued association
+ * or element collection.
+ *
+ * @return PathExpression corresponding to the map key
+ */
+ PathExpression key();
+
+ /**
+ * Return a select item corresponding to the map entry of a map-valued
+ * association or element collection. This method is only permitted to be
+ * invoked upon a domain object that corresponds to a map-valued association
+ * or element collection.
+ *
+ * @return SelectItem corresponding to the map entry
+ */
+ SelectItem entry();
+
+ /**
+ * Return an expression that corresponds to the index. of the domain object
+ * in the referenced association or element collection. This method is only
+ * permitted to be invoked upon a domain object that corresponds to a
+ * multi-valued association or element collection for which an order column
+ * has been defined.
+ *
+ * @return Expression denoting the index
+ */
+ Expression index();
+}
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ElseExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ElseExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ElseExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ElseExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Else clause in a Case Statement.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/EqualExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/EqualExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/EqualExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/EqualExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Denotes e1 = e2 Expression.
*
@@ -28,7 +26,10 @@
*/
public class EqualExpression extends BinaryExpressionPredicate {
public EqualExpression(Expression op1, Expression op2) {
- super(op1, BinaryConditionalOperator.EQUAL, BinaryConditionalOperator.EQUAL_NOT, op2);
+ super(op1,
+ BinaryConditionalOperator.EQUAL,
+ BinaryConditionalOperator.EQUAL_NOT,
+ op2);
}
}
Added: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/Expression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/Expression.java?rev=756730&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/Expression.java (added)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/Expression.java Fri Mar 20 19:47:26 2009
@@ -0,0 +1,524 @@
+/*
+ * 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.openjpa.persistence.query;
+
+/**
+ * Instances of this interface can be used either as select list items or as
+ * predicate operands.
+ */
+public interface Expression extends SelectItem, PredicateOperand {
+ /*
+ * Conditional predicates over expression items
+ */
+ /**
+ * Create a predicate for testing whether the expression is a member of the
+ * association or element collection denoted by the path expression. The
+ * argument must correspond to a collection-valued association or element
+ * collection of like type.
+ *
+ * @param arg -
+ * a path expression that specifies a collection-valued
+ * association or an element collection
+ * @return conditional predicate
+ */
+ Predicate member(PathExpression arg);
+
+ /**
+ * Create a predicate for testing whether the value of the expression is
+ * null.
+ *
+ * @return conditional predicate
+ */
+ Predicate isNull();
+
+ /**
+ * Create a predicate for testing whether the expression value is a member
+ * of the argument list.
+ *
+ * @param strings
+ * @return conditional predicate
+ */
+ Predicate in(String... strings);
+
+ /**
+ * Create a predicate for testing whether the expression value is a member
+ * of the argument list.
+ *
+ * @param nums
+ * @return conditional predicate
+ */
+ Predicate in(Number... nums);
+
+ /**
+ * Create a predicate for testing whether the expression value is a member
+ * of the argument list.
+ *
+ * @param enums
+ * @return conditional predicate
+ */
+ Predicate in(Enum<?>... enums);
+
+ /**
+ * Create a predicate for testing whether the expression value is a member
+ * of the argument list.
+ *
+ * @param classes
+ * @return conditional predicate
+ */
+ Predicate in(Class... classes);
+
+ /**
+ * Create a predicate for testing whether the expression value is a member
+ * of the argument list.
+ *
+ * @param params
+ * @return conditional predicate
+ */
+ Predicate in(Expression... params);
+
+ /**
+ * Create a predicate for testing whether the expression value is a member
+ * of a subquery result.
+ *
+ * @param subquery
+ * @return conditional predicate
+ */
+ Predicate in(Subquery subquery);
+
+ /*
+ * Operations on strings
+ */
+ /**
+ * String length This method must be invoked on an expression corresponding
+ * to a string.
+ *
+ * @return expression denoting the length of the string.
+ */
+ Expression length();
+
+ /**
+ * Concatenate a string with other string(s). This method must be invoked on
+ * an expression corresponding to a string.
+ *
+ * @param str -
+ * string(s)
+ * @return expression denoting the concatenation of the strings, starting
+ * with the string corresponding to the expression on which the
+ * method was invoked.
+ */
+ Expression concat(String... str);
+
+ /**
+ * Concatenate a string with other string(s). This method must be invoked on
+ * an expression corresponding to a string.
+ *
+ * @param str -
+ * expression(s) corresponding to string(s)
+ * @return expression denoting the concatenation of the strings, starting
+ * with the string corresponding to the expression on which the
+ * method was invoked.
+ */
+ Expression concat(Expression... str);
+
+ /**
+ * Extract a substring starting at specified position through to the end of
+ * the string. This method must be invoked on an expression corresponding to
+ * a string.
+ *
+ * @param start -
+ * start position (1 indicates first position)
+ * @return expression denoting the extracted substring
+ */
+ Expression substring(int start);
+
+ /**
+ * Extract a substring starting at specified position through to the end of
+ * the string. This method must be invoked on an expression corresponding to
+ * a string.
+ *
+ * @param start -
+ * expression denoting start position (1 indicates first
+ * position)
+ * @return expression denoting the extracted substring
+ */
+ Expression substring(Expression start);
+
+ /**
+ * Extract a substring. This method must be invoked on an expression
+ * corresponding to a string.
+ *
+ * @param start -
+ * start position (1 indicates first position)
+ * @param len -
+ * length of the substring to be returned
+ * @return expression denoting the extracted substring
+ */
+ Expression substring(int start, int len);
+
+ /**
+ * Extract a substring. This method must be invoked on an expression
+ * corresponding to a string.
+ *
+ * @param start -
+ * start position (1 indicates first position)
+ * @param len -
+ * expression denoting length of the substring to return
+ * @return expression denoting the extracted substring
+ */
+ Expression substring(int start, Expression len);
+
+ /**
+ * Extract a substring. This method must be invoked on an expression
+ * corresponding to a string.
+ *
+ * @param start -
+ * expression denoting start position (1 indicates first
+ * position)
+ * @param len -
+ * length of the substring to return
+ * @return expression denoting the extracted substring
+ */
+ Expression substring(Expression start, int len);
+
+ /**
+ * Extract a substring. This method must be invoked on an expression
+ * corresponding to a string.
+ *
+ * @param start -
+ * expression denoting start position (1 indicates first
+ * position)
+ * @param len -
+ * expression denoting length of the substring to return
+ * @return expression denoting the extracted substring
+ */
+ Expression substring(Expression start, Expression len);
+
+ /**
+ * Convert string to lowercase. This method must be invoked on an expression
+ * corresponding to a string.
+ *
+ * @return expression denoting the string in lowercase
+ */
+ Expression lower();
+
+ /**
+ * Convert string to uppercase. This method must be invoked on an expression
+ * corresponding to a string.
+ *
+ * @return expression denoting the string in uppercase
+ */
+ Expression upper();
+
+ /**
+ * Trim leading and trailing blanks. This method must be invoked on an
+ * expression corresponding to a string.
+ *
+ * @return expression denoting trimmed string
+ */
+ Expression trim();
+
+ /**
+ * Trim leading, trailing blanks (or both) as specified by trim spec. This
+ * method must be invoked on an expression corresponding to a string.
+ *
+ * @param spec -
+ * trim specification
+ * @return expression denoting trimmed string
+ */
+ Expression trim(TrimSpec spec);
+
+ /**
+ * Trim leading and trailing occurrences of character from the string. This
+ * method must be invoked on an expression corresponding to a string.
+ *
+ * @param c -
+ * character to be trimmed
+ * @return expression denoting trimmed string
+ */
+ Expression trim(char c);
+
+ /**
+ * Trim occurrences of the character from leading or trailing (or both)
+ * positions of the string, as specified by trim spec. This method must be
+ * invoked on an expression corresponding to a string.
+ *
+ * @param c -
+ * character to be trimmed
+ * @param spec -
+ * trim specification
+ * @return expression denoting trimmed string
+ */
+ Expression trim(char c, TrimSpec spec);
+
+ /**
+ * Trim leading and trailing occurrences of character specified by the
+ * expression argument from the string. This method must be invoked on an
+ * expression corresponding to a string.
+ *
+ * @param expr -
+ * expression corresponding to the character to be trimmed
+ * @return expression denoting trimmed string
+ */
+ Expression trim(Expression expr);
+
+ /**
+ * Trim occurrences of the character specified by the expression argument
+ * from leading or trailing (or both) positions of the string, as specified
+ * by trim spec. This method must be invoked on an expression corresponding
+ * to a string.
+ *
+ * @param expr -
+ * expression corresponding to the character to be trimmed
+ * @param spec -
+ * trim specification
+ * @return expression denoting trimmed string
+ */
+ Expression trim(Expression expr, TrimSpec spec);
+
+ /**
+ * Locate a string contained within the string corresponding to the
+ * expression on which the method was invoked. The search is started at
+ * position 1 (first string position). This method must be invoked on an
+ * expression corresponding to a string.
+ *
+ * @param str -
+ * string to be located
+ * @return expression denoting the first position at which the string was
+ * found or expression denoting 0 if the string was not found
+ */
+ Expression locate(String str);
+
+ /**
+ * Locate a string contained within the string corresponding to the
+ * expression on which the method was invoked. The search is started at
+ * position 1 (first string position). This method must be invoked on an
+ * expression corresponding to a string.
+ *
+ * @param str -
+ * expression corresponding to the string to be located
+ * @return expression denoting the first position at which the string was
+ * found or expression denoting 0 if the string was not found
+ */
+ Expression locate(Expression str);
+
+ /**
+ * Locate a string contained within the string corresponding to the
+ * expression on which the method was invoked, starting at a specified
+ * search position. This method must be invoked on an expression
+ * corresponding to a string.
+ *
+ * @param str -
+ * string to be located
+ * @param position -
+ * position at which to start the search
+ * @return expression denoting the first position at which the string was
+ * found or expression denoting 0 if the string was not found
+ */
+ Expression locate(String str, int position);
+
+ /**
+ * Locate a string contained within the string corresponding to the
+ * expression on which the method was invoked, starting at a specified
+ * search position. This method must be invoked on an expression
+ * corresponding to a string.
+ *
+ * @param str -
+ * string to be located
+ * @param position -
+ * expression corresponding to position at which to start the
+ * search
+ * @return expression denoting the first position at which the string was
+ * found or expression denoting 0 if the string was not found
+ */
+ Expression locate(String str, Expression position);
+
+ /**
+ * Locate a string contained within the string corresponding to the
+ * expression on which the method was invoked, starting at a specified
+ * search position. This method must be invoked on an expression
+ * corresponding to a string.
+ *
+ * @param str -
+ * expression corresponding to the string to be located
+ * @param position -
+ * position at which to start the search
+ * @return expression denoting the first position at which the string was
+ * found or expression denoting 0 if the string was not found
+ */
+ Expression locate(Expression str, int position);
+
+ /**
+ * Locate a string contained within the string corresponding to the
+ * expression on which the method was invoked, starting at a specified
+ * search position. This method must be invoked on an expression
+ * corresponding to a string.
+ *
+ * @param str -
+ * expression corresponding to the string to be located
+ * @param position -
+ * expression corresponding to position at which to start the
+ * search
+ * @return expression denoting the first position at which the string was
+ * found or expression denoting 0 if the string was not found
+ */
+ Expression locate(Expression str, Expression position);
+
+ /*
+ * Arithmetic operations
+ */
+ /**
+ * Addition. This method must be invoked on an expression corresponding to a
+ * number.
+ *
+ * @param num -
+ * number to be added
+ * @return expression denoting the sum
+ */
+ Expression plus(Number num);
+
+ /**
+ * Addition. This method must be invoked on an expression corresponding to a
+ * number.
+ *
+ * @param expr -
+ * expression corresponding to number to be added
+ * @return expression denoting the sum
+ */
+ Expression plus(Expression expr);
+
+ /**
+ * Unary minus. This method must be invoked on an expression corresponding
+ * to a number.
+ *
+ * @return expression denoting the unary minus of the expression
+ */
+ Expression minus();
+
+ /**
+ * Subtraction. This method must be invoked on an expression corresponding
+ * to a number.
+ *
+ * @param num -
+ * subtrahend
+ * @return expression denoting the result of subtracting the argument from
+ * the number corresponding to the expression on which the method
+ * was invoked.
+ */
+ Expression minus(Number num);
+
+ /**
+ * Subtraction. This method must be invoked on an expression corresponding
+ * to a number.
+ *
+ * @param expr -
+ * expression corresponding to subtrahend
+ * @return expression denoting the result of subtracting the number denoted
+ * by the argument from the number corresponding to the expression
+ * on which the method was invoked.
+ */
+ Expression minus(Expression expr);
+
+ /**
+ * Division. This method must be invoked on an expression corresponding to a
+ * number.
+ *
+ * @param num -
+ * divisor
+ * @return expression denoting the result of dividing the number
+ * corresponding to the expression on which the method was invoked
+ * by the argument
+ */
+ Expression dividedBy(Number num);
+
+ /**
+ * Division. This method must be invoked on an expression corresponding to a
+ * number.
+ *
+ * @param expr -
+ * expression corresponding to the divisor
+ * @return expression denoting the result of dividing the number
+ * corresponding to the expression on which the method was invoked
+ * by the number denoted by the argument
+ */
+ Expression dividedBy(Expression expr);
+
+ /**
+ * Multiplication. This method must be invoked on an expression
+ * corresponding to a number.
+ *
+ * @param num -
+ * multiplier
+ * @return expression denoting the result of multiplying the argument with
+ * the number corresponding to the expression on which the method
+ * was invoked.
+ */
+ Expression times(Number num);
+
+ /**
+ * Multiplication. This method must be invoked on an expression
+ * corresponding to a number.
+ *
+ * @param expr -
+ * expression corresponding to the multiplier
+ * @return expression denoting the result of multiplying the number denoted
+ * by the argument with the number corresponding to the expression
+ * on which the method was invoked.
+ */
+ Expression times(Expression expr);
+
+ /**
+ * Absolute value. This method must be invoked on an expression
+ * corresponding to a number.
+ *
+ * @return expression corresponding to the absolute value
+ */
+ Expression abs();
+
+ /**
+ * Square root. This method must be invoked on an expression corresponding
+ * to a number.
+ *
+ * @return expression corresponding to the square root
+ */
+ Expression sqrt();
+
+ /**
+ * Modulo operation. This must be invoked on an expression corresponding to
+ * an integer value
+ *
+ * @param num -
+ * integer divisor
+ * @return expression corresponding to the integer remainder of the division
+ * of the integer corresponding to the expression on which the
+ * method was invoked by the argument.
+ */
+ Expression mod(int num);
+
+ /**
+ * Modulo operation. This must be invoked on an expression corresponding to
+ * an integer value
+ *
+ * @param expr -
+ * expression corresponding to integer divisor
+ * @return expression corresponding to the integer remainder of the division
+ * of the integer corresponding to the expression on which the
+ * method was invoked by the argument.
+ */
+ Expression mod(Expression expr);
+}
\ No newline at end of file
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ExpressionImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ExpressionImpl.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ExpressionImpl.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ExpressionImpl.java Fri Mar 20 19:47:26 2009
@@ -22,14 +22,6 @@
import java.util.Calendar;
import java.util.Date;
-import javax.persistence.Expression;
-import javax.persistence.OrderByItem;
-import javax.persistence.PathExpression;
-import javax.persistence.Predicate;
-import javax.persistence.PredicateOperand;
-import javax.persistence.Subquery;
-import javax.persistence.TrimSpec;
-
/**
* An abstract expression acts as a factory for concrete unary or binary
* expressions such as ABS() or PLUS().
Added: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/FetchJoinObject.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/FetchJoinObject.java?rev=756730&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/FetchJoinObject.java (added)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/FetchJoinObject.java Fri Mar 20 19:47:26 2009
@@ -0,0 +1,26 @@
+/*
+ * 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.openjpa.persistence.query;
+
+/**
+ * Interface used for the result of a fetch join.
+ */
+public interface FetchJoinObject {
+}
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/FetchPath.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/FetchPath.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/FetchPath.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/FetchPath.java Fri Mar 20 19:47:26 2009
@@ -20,8 +20,6 @@
import static org.apache.openjpa.persistence.query.PathOperator.NAVIGATION;
-import javax.persistence.FetchJoinObject;
-
/**
* Denotes a path used in fetch join. Simply wraps a Navigation Path.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/GreaterEqualExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/GreaterEqualExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/GreaterEqualExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/GreaterEqualExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Denotes e1 >= e2 Expression.
*
@@ -28,7 +26,10 @@
*/
public class GreaterEqualExpression extends BinaryExpressionPredicate {
public GreaterEqualExpression(Expression op1, Expression op2) {
- super(op1, BinaryConditionalOperator.GREATEREQUAL, BinaryConditionalOperator.LESS, op2);
+ super(op1,
+ BinaryConditionalOperator.GREATEREQUAL,
+ BinaryConditionalOperator.LESS,
+ op2);
}
}
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/GreaterThanExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/GreaterThanExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/GreaterThanExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/GreaterThanExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Denotes e1 > e2 Expression.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/InExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/InExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/InExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/InExpression.java Fri Mar 20 19:47:26 2009
@@ -1,8 +1,23 @@
+/*
+ * 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.openjpa.persistence.query;
-import javax.persistence.Expression;
-import javax.persistence.Subquery;
-
/**
* Denotes e1 IN (e2) Expression.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/IndexExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/IndexExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/IndexExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/IndexExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Denotes INDEX(e) Expression.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/IsEmptyExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/IsEmptyExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/IsEmptyExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/IsEmptyExpression.java Fri Mar 20 19:47:26 2009
@@ -1,8 +1,23 @@
+/*
+ * 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.openjpa.persistence.query;
-import javax.persistence.Expression;
-
-
public class IsEmptyExpression extends UnaryExpressionPredicate {
public IsEmptyExpression(Expression op) {
super(op, UnaryConditionalOperator.ISEMPTY,
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/IsNullExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/IsNullExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/IsNullExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/IsNullExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Denotes e IS NULL Expression.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/JoinPath.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/JoinPath.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/JoinPath.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/JoinPath.java Fri Mar 20 19:47:26 2009
@@ -18,7 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.DomainObject;
import static org.apache.openjpa.persistence.query.PathOperator.NAVIGATION;
/**
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LengthExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LengthExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LengthExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LengthExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Denotes LENGTH(e) Expression.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LessEqualExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LessEqualExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LessEqualExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LessEqualExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Denotes e1 <= e2 Expression.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LessThanExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LessThanExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LessThanExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LessThanExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Denotes e1 < e2 Expression.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LikeExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LikeExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LikeExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LikeExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Denotes e1 LIKE e2 Expression.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LocateExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LocateExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LocateExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LocateExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Denotes LOCATE(e1, e2, n) Expression.
* e1 : string to be located
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LogicalPredicate.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LogicalPredicate.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LogicalPredicate.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LogicalPredicate.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Predicate;
-
/**
* Logical Predicate combines two predicates with a logical operator.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LowerExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LowerExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LowerExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LowerExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Denotes LOWER(e) Expression.
*
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/MaxExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/MaxExpression.java?rev=756730&r1=756729&r2=756730&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/MaxExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/MaxExpression.java Fri Mar 20 19:47:26 2009
@@ -18,8 +18,6 @@
*/
package org.apache.openjpa.persistence.query;
-import javax.persistence.Expression;
-
/**
* Denotes MAX(e) Expression.
*