aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Jungmann2014-05-13 06:28:01 (EDT)
committerTomas Kraus2014-05-22 08:47:25 (EDT)
commit6b1b2b958066ffd90e4db05501064aa62e97f142 (patch)
tree4cf0fa27f0bdc205bef0e6cf3fddf34a6111c32b
parent127e81ae35a77b42c148f9912cd648f8dc225754 (diff)
downloadeclipselink.runtime-6b1b2b958066ffd90e4db05501064aa62e97f142.zip
eclipselink.runtime-6b1b2b958066ffd90e4db05501064aa62e97f142.tar.gz
eclipselink.runtime-6b1b2b958066ffd90e4db05501064aa62e97f142.tar.bz2
Bug 434719 - [JPA 21] Short numeric expression in the select clause doesn't return integer
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
-rw-r--r--foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/NumericTypeComparator.java6
-rw-r--r--jpa/org.eclipse.persistence.jpa.jpql/src/org/eclipse/persistence/jpa/jpql/tools/NumericTypeComparator.java25
2 files changed, 20 insertions, 11 deletions
diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/NumericTypeComparator.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/NumericTypeComparator.java
index efb1125..d24a09d 100644
--- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/NumericTypeComparator.java
+++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/NumericTypeComparator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -82,6 +82,10 @@ final class NumericTypeComparator implements Comparator<Class<?>> {
if (type1 == Long.TYPE || type1 == Long.class) return -1;
if (type2 == Long.TYPE || type2 == Long.class) return 1;
+ // Integer
+ if (type1 == Integer.TYPE || type1 == Integer.class) return -1;
+ if (type2 == Integer.TYPE || type2 == Integer.class) return 1;
+
return 1;
}
} \ No newline at end of file
diff --git a/jpa/org.eclipse.persistence.jpa.jpql/src/org/eclipse/persistence/jpa/jpql/tools/NumericTypeComparator.java b/jpa/org.eclipse.persistence.jpa.jpql/src/org/eclipse/persistence/jpa/jpql/tools/NumericTypeComparator.java
index c632ac4..2c9f0a2 100644
--- a/jpa/org.eclipse.persistence.jpa.jpql/src/org/eclipse/persistence/jpa/jpql/tools/NumericTypeComparator.java
+++ b/jpa/org.eclipse.persistence.jpa.jpql/src/org/eclipse/persistence/jpa/jpql/tools/NumericTypeComparator.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 2006, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
@@ -77,9 +77,14 @@ public final class NumericTypeComparator implements Comparator<IType> {
// Long
type = typeHelper.longType();
- if (type1.equals(type)) return -1;
- if (type2.equals(type)) return 1;
-
- return 1;
- }
+ if (type1.equals(type)) return -1;
+ if (type2.equals(type)) return 1;
+
+ // Integer
+ type = typeHelper.integerType();
+ if (type1.equals(type)) return -1;
+ if (type2.equals(type)) return 1;
+
+ return 1;
+ }
} \ No newline at end of file