From c8016a49e0ada10a846aabfc6aa3ddc167957ede Mon Sep 17 00:00:00 2001 From: Heath Thomann Date: Tue, 11 Jun 2013 19:23:05 +0000 Subject: [PATCH] OPENJPA-2373: Made updates to the test created for this JIRA. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1491915 13f79535-47bb-0310-9956-ffa450edef68 --- .../persistence/common/apps/PartPK.java | 4 ++-- .../TestMapsIdWithAutoGeneratedKey.java | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/PartPK.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/PartPK.java index abaed8b7d..5b733d053 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/PartPK.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/PartPK.java @@ -26,11 +26,11 @@ import javax.persistence.Embeddable; public class PartPK implements Serializable { /*Textile Id*/ - @Column(name="ID_TXE", length=4) + @Column(name="ID_TXE") private Integer textileId; /*Part Number*/ - @Column(name="NU_PT", length=4) + @Column(name="NU_PT") private Integer partNumber; public PartPK() { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/jointable/onetomany/TestMapsIdWithAutoGeneratedKey.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/jointable/onetomany/TestMapsIdWithAutoGeneratedKey.java index c14225693..4f876d858 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/jointable/onetomany/TestMapsIdWithAutoGeneratedKey.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/jointable/onetomany/TestMapsIdWithAutoGeneratedKey.java @@ -19,10 +19,13 @@ package org.apache.openjpa.persistence.inheritance.jointable.onetomany; -import javax.naming.NamingException; import javax.persistence.EntityManager; import javax.persistence.EntityTransaction; +import org.apache.openjpa.jdbc.conf.JDBCConfiguration; +import org.apache.openjpa.jdbc.sql.DB2Dictionary; +import org.apache.openjpa.jdbc.sql.DBDictionary; +import org.apache.openjpa.jdbc.sql.DerbyDictionary; import org.apache.openjpa.persistence.common.apps.Part; import org.apache.openjpa.persistence.common.apps.PartPK; import org.apache.openjpa.persistence.common.apps.Shirt; @@ -62,15 +65,26 @@ import org.apache.openjpa.persistence.test.SingleEMFTestCase; * */ public class TestMapsIdWithAutoGeneratedKey extends SingleEMFTestCase { + boolean disabled = true; + public void setUp() { super.setUp(DROP_TABLES, Textile.class, TextilePK.class, Shirt.class, Trousers.class, Part.class, PartPK.class); + + DBDictionary dic = ((JDBCConfiguration)emf.getConfiguration()).getDBDictionaryInstance(); + if (dic.supportsAutoAssign && (dic instanceof DB2Dictionary || dic instanceof DerbyDictionary)) { + disabled = false; + } } - public void testPersistShirtWithPart() throws NamingException { + public void testPersistShirtWithPart() { + if (disabled) { + return; + } + EntityManager em = emf.createEntityManager(); EntityTransaction tx = em.getTransaction(); int nPart = 3;