OPENJPA-1442 JPA2 java.sql.Date, java.math.BigDecimal, or java.math.BigInteger types as derived primary keys are not Enhanced correctly

Fix testcase to avoid inserting duplicate keys.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@893794 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Catalina Wei 2009-12-24 18:04:17 +00:00
parent a0e001e40a
commit 5607a959ab
1 changed files with 2 additions and 2 deletions

View File

@ -43,14 +43,14 @@ public class TestDerivedIdentity extends SQLListenerTestCase {
EntityManager em = emf.createEntityManager(); EntityManager em = emf.createEntityManager();
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
long time = (long) (System.currentTimeMillis() / 1000)+i; long time = (long) (System.currentTimeMillis() / 1000)+i*1317;
BigDecimal did = new BigDecimal(time); BigDecimal did = new BigDecimal(time);
EBigDecimalID e1 = new EBigDecimalID(did); EBigDecimalID e1 = new EBigDecimalID(did);
EDBigDecimalID e2 = new EDBigDecimalID(e1); EDBigDecimalID e2 = new EDBigDecimalID(e1);
em.persist(e1); em.persist(e1);
em.persist(e2); em.persist(e2);
int time2 = (int) (System.currentTimeMillis() / 1000)+i; int time2 = (int) (System.currentTimeMillis() / 1000)+i*7131;
BigInteger iid = new BigInteger(Integer.toString(time2)); BigInteger iid = new BigInteger(Integer.toString(time2));
EBigIntegerID e3 = new EBigIntegerID(iid); EBigIntegerID e3 = new EBigIntegerID(iid);
EDBigIntegerID e4 = new EDBigIntegerID(e3); EDBigIntegerID e4 = new EDBigIntegerID(e3);