openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r801045 [2/2] - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/datacache/ openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/ openjpa-kernel/src/test/java/...
Date Wed, 05 Aug 2009 02:07:55 GMT
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Expressions.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Expressions.java?rev=801045&r1=801044&r2=801045&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Expressions.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/Expressions.java
Wed Aug  5 02:07:54 2009
@@ -934,8 +934,7 @@
     
     public static class Coalesce<T> extends ExpressionImpl<T> 
         implements QueryBuilder.Coalesce<T> {
-        private List<Expression<? extends T>> values = 
-            new ArrayList<Expression<? extends T>>();
+        private List<Expression<? extends T>> values = new ArrayList<Expression<?
extends T>>();
         
         public Coalesce() {
             super(null);
@@ -1115,8 +1114,7 @@
             super(cls);
         }
 
-        public Case<T> when(Expression<Boolean> when, 
-            Expression<? extends T> then) {
+        public Case<T> when(Expression<Boolean> when, Expression<? extends
T> then) {
             whens.add(when);
             thens.add(then);
             return this;
@@ -1124,8 +1122,7 @@
 
         public Case<T> when(Expression<Boolean> when, T then) {
             whens.add(when);
-            Expression<? extends T> thenExpr = 
-                new Expressions.Constant<T>(then);
+            Expression<? extends T> thenExpr = new Expressions.Constant<T>(then);
             thens.add(thenExpr);
             return this;
         }
@@ -1136,8 +1133,7 @@
         }
 
         public Case<T> otherwise(T otherwise) {
-            this.otherwise = new Expressions.Constant<T>(otherwise);
-            return this;
+            return otherwise(new Expressions.Constant<T>(otherwise));
         }
 
         @Override
@@ -1202,11 +1198,7 @@
         }
 
         public SimpleCase<C,R> when(C when, R then) {
-            whens.add(new Constant<C>(when));
-            Expression<? extends R> thenExpr = 
-                new Expressions.Constant<R>(then);
-            thens.add(thenExpr);
-            return this;
+            return when(when, new Expressions.Constant<R>(then));
         }
 
         public SimpleCase<C,R> otherwise(Expression<? extends R> otherwise) {
@@ -1215,8 +1207,7 @@
         }
 
         public SimpleCase<C,R> otherwise(R otherwise) {
-            this.otherwise = new Expressions.Constant<R>(otherwise);
-            return this;
+            return otherwise(new Expressions.Constant<R>(otherwise));
         }
 
         @Override

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/OrderImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/OrderImpl.java?rev=801045&r1=801044&r2=801045&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/OrderImpl.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/OrderImpl.java
Wed Aug  5 02:07:54 2009
@@ -29,10 +29,10 @@
  */
 public class OrderImpl implements Order {
 	private boolean _ascending;
-	private final Expression<?> e;
+	private final ExpressionImpl<?> e;
 	
 	public OrderImpl(Expression<?> e, boolean asc) {
-		this.e = e;
+		this.e = (ExpressionImpl<?>) e;
 		_ascending = asc;
 	}
 	
@@ -40,7 +40,7 @@
 		this(e, true);
 	}
 	
-	public Expression<?> getExpression() {
+	public ExpressionImpl<?> getExpression() {
 		return e;
 	}
 	

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/SelectionImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/SelectionImpl.java?rev=801045&r1=801044&r2=801045&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/SelectionImpl.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/SelectionImpl.java
Wed Aug  5 02:07:54 2009
@@ -43,8 +43,8 @@
         return this;
     }
 
-    public final List<Selection<?>> getCompoundSelectionItems() {
-        return null;
+    public List<Selection<?>> getCompoundSelectionItems() {
+        throw new IllegalStateException(this + " is not a compound selection");
     }
 
     public boolean isCompoundSelection() {



Mime
View raw message