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
This commit is contained in:
Heath Thomann 2013-06-11 19:23:05 +00:00
parent 2df7cd6950
commit c8016a49e0
2 changed files with 18 additions and 4 deletions

View File

@ -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() {

View File

@ -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;