mirror of https://github.com/apache/openjpa.git
OPENJPA-1224: backing out changes while investigating a test regression.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@822288 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
18cd43dfcd
commit
63a3408d7d
|
@ -29,6 +29,7 @@ public abstract class AbstractDB2Dictionary
|
|||
public int varcharCastLength = 1000;
|
||||
|
||||
public AbstractDB2Dictionary() {
|
||||
numericTypeName = "DOUBLE";
|
||||
bitTypeName = "SMALLINT";
|
||||
smallintTypeName = "SMALLINT";
|
||||
tinyintTypeName = "SMALLINT";
|
||||
|
|
|
@ -404,7 +404,7 @@ public class DBDictionary
|
|||
public DBDictionary() {
|
||||
fixedSizeTypeNameSet.addAll(Arrays.asList(new String[]{
|
||||
"BIGINT", "BIT", "BLOB", "CLOB", "DATE", "DECIMAL", "DISTINCT",
|
||||
"DOUBLE", "FLOAT", "INTEGER", "JAVA_OBJECT", "NULL",
|
||||
"DOUBLE", "FLOAT", "INTEGER", "JAVA_OBJECT", "NULL", "NUMERIC",
|
||||
"OTHER", "REAL", "REF", "SMALLINT", "STRUCT", "TIME", "TIMESTAMP",
|
||||
"TINYINT",
|
||||
}));
|
||||
|
|
|
@ -24,6 +24,9 @@ import javax.persistence.EntityManager;
|
|||
|
||||
import junit.textui.TestRunner;
|
||||
|
||||
import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
|
||||
import org.apache.openjpa.jdbc.sql.DBDictionary;
|
||||
import org.apache.openjpa.jdbc.sql.MySQLDictionary;
|
||||
import org.apache.openjpa.persistence.test.SingleEMFTestCase;
|
||||
|
||||
/**
|
||||
|
@ -44,6 +47,18 @@ public class TestSQLBigDecimalId
|
|||
e.setId(decimal);
|
||||
e.setData(1);
|
||||
|
||||
// trigger schema definition
|
||||
JDBCConfiguration jdbccfg = (JDBCConfiguration) emf.getConfiguration();
|
||||
DBDictionary dict = jdbccfg.getDBDictionaryInstance();
|
||||
// currently BigDecimal is mapped to NUMERIC column type. This causes
|
||||
// truncation error from MySQL. Without knowing the implication of changing the
|
||||
// mapping of BigDecimal universally to DOUBLE, I will just change the mapping
|
||||
// for this test case.
|
||||
if (dict instanceof MySQLDictionary) {
|
||||
dict.numericTypeName = "DOUBLE";
|
||||
}
|
||||
|
||||
|
||||
EntityManager em = emf.createEntityManager();
|
||||
em.getTransaction().begin();
|
||||
em.persist(e);
|
||||
|
@ -74,7 +89,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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue