From 2980c1901e31114fcd53d204b0786cf1d6ea3494 Mon Sep 17 00:00:00 2001 From: "Richard G. Curtis" Date: Wed, 31 Oct 2012 19:45:06 +0000 Subject: [PATCH] OPENJPA-2280: Reverting previous commits. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1404317 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/openjpa/jdbc/sql/AbstractDB2Dictionary.java | 8 +------- .../persistence/criteria/AbstractCriteriaTestCase.java | 3 +-- .../openjpa/persistence/identity/TestSQLBigDecimalId.java | 3 ++- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractDB2Dictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractDB2Dictionary.java index 2782bc466..6d51da451 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractDB2Dictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractDB2Dictionary.java @@ -29,10 +29,7 @@ public abstract class AbstractDB2Dictionary public int varcharCastLength = 1000; public AbstractDB2Dictionary() { - // http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.apdv.java.doc - // /doc/rjvjdata.htm - // http://db.apache.org/derby/docs/10.3/ref/rrefsqlj12362.html - numericTypeName = "DECIMAL"; + numericTypeName = "DOUBLE"; bitTypeName = "SMALLINT"; smallintTypeName = "SMALLINT"; tinyintTypeName = "SMALLINT"; @@ -72,9 +69,6 @@ public abstract class AbstractDB2Dictionary // the equivalent "X JOIN Y ON 1 = 1" crossJoinClause = "JOIN"; requiresConditionForCrossJoin = true; - - // DB2 / Derby allows precision to be set on a DECIMAL column. - fixedSizeTypeNameSet.remove("DECIMAL"); } public void indexOf(SQLBuffer buf, FilterValue str, FilterValue find, diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/AbstractCriteriaTestCase.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/AbstractCriteriaTestCase.java index a4149902d..77dd8dba7 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/AbstractCriteriaTestCase.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/AbstractCriteriaTestCase.java @@ -34,7 +34,6 @@ import javax.persistence.criteria.CriteriaQuery; import junit.framework.TestCase; import org.apache.openjpa.jdbc.conf.JDBCConfiguration; -import org.apache.openjpa.jdbc.sql.AbstractDB2Dictionary; import org.apache.openjpa.jdbc.sql.DBDictionary; import org.apache.openjpa.jdbc.sql.DerbyDictionary; import org.apache.openjpa.jdbc.sql.HSQLDictionary; @@ -105,7 +104,7 @@ public abstract class AbstractCriteriaTestCase extends TestCase { void setDictionary() { JDBCConfiguration conf = (JDBCConfiguration) getEntityManagerFactory().getConfiguration(); dict = conf.getDBDictionaryInstance(); - if (dict instanceof AbstractDB2Dictionary || dict instanceof HSQLDictionary) { + if (dict instanceof DerbyDictionary || dict instanceof HSQLDictionary) { dict.requiresCastForComparisons = false; dict.requiresCastForMathFunctions = false; } else if (dict instanceof OracleDictionary) { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/identity/TestSQLBigDecimalId.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/identity/TestSQLBigDecimalId.java index 88396f13c..0d7d59755 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/identity/TestSQLBigDecimalId.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/identity/TestSQLBigDecimalId.java @@ -59,6 +59,8 @@ public class TestSQLBigDecimalId } + @AllowFailure + // This test currently allows failure because DB2 and Derby don't handle BigDecimals properly quite yet. public void testQuery() { int data = 156; BigDecimal decimal = new BigDecimal(1234); @@ -75,7 +77,6 @@ public class TestSQLBigDecimalId (SQLBigDecimalIdEntity) em.createQuery("SELECT a FROM SQLBigDecimalIdEntity a WHERE a.data=" + data) .getSingleResult(); - // This would fail prior to OPENJPA-1224. assertEquals(e, e2); em.close();