You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by dw...@apache.org on 2010/03/25 15:58:57 UTC
svn commit: r927434 [1/2] - in
/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test:
java/org/apache/openjpa/persistence/proxy/
java/org/apache/openjpa/persistence/proxy/entities/ resources/META-INF/
resources/org/apache/openjpa/persistence/proxy/
Author: dwoods
Date: Thu Mar 25 14:58:56 2010
New Revision: 927434
URL: http://svn.apache.org/viewvc?rev=927434&view=rev
Log:
OPENJPA-1597 New tests to verify expected behavior for proposed Compatibility fix.
Added:
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/TestDetachMerge.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Address.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Annuity.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityHolder.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityHolderCategory.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityPersistebleObject.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityType.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Configrable.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Contact.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/ContactType.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/EquityAnnuity.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/FixedAnnuity.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAddress.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuity.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuityHolder.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuityObject.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IContact.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IEquityAnnuity.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IFixedAnnuity.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IPayor.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IPayout.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IPersisteble.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IPerson.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IRider.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Identifiable.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/JPAPersisteble.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Parameterizable.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Payor.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Payout.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Person.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Rider.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/RiderType.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/StringParameterizable.java (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/proxy/
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/proxy/persistence1.xml (with props)
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/proxy/persistence2.xml (with props)
Modified:
openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/TestDetachMerge.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/TestDetachMerge.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/TestDetachMerge.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/TestDetachMerge.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,780 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy;
+
+import java.math.BigDecimal;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+
+import javax.persistence.EntityManager;
+import org.apache.openjpa.conf.Compatibility;
+import org.apache.openjpa.lib.log.Log;
+import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
+import org.apache.openjpa.persistence.OpenJPAPersistence;
+import org.apache.openjpa.persistence.test.AllowFailure;
+import org.apache.openjpa.persistence.test.SingleEMFTestCase;
+
+import org.apache.openjpa.persistence.proxy.entities.Address;
+import org.apache.openjpa.persistence.proxy.entities.AnnuityHolderCategory;
+import org.apache.openjpa.persistence.proxy.entities.AnnuityPersistebleObject;
+import org.apache.openjpa.persistence.proxy.entities.ContactType;
+import org.apache.openjpa.persistence.proxy.entities.IAnnuity;
+import org.apache.openjpa.persistence.proxy.entities.IAnnuityHolder;
+import org.apache.openjpa.persistence.proxy.entities.IContact;
+import org.apache.openjpa.persistence.proxy.entities.IEquityAnnuity;
+import org.apache.openjpa.persistence.proxy.entities.IFixedAnnuity;
+import org.apache.openjpa.persistence.proxy.entities.IPayor;
+import org.apache.openjpa.persistence.proxy.entities.IPayout;
+import org.apache.openjpa.persistence.proxy.entities.IRider;
+import org.apache.openjpa.persistence.proxy.entities.Person;
+import org.apache.openjpa.persistence.proxy.entities.RiderType;
+import org.apache.openjpa.persistence.proxy.entities.Annuity;
+import org.apache.openjpa.persistence.proxy.entities.AnnuityHolder;
+import org.apache.openjpa.persistence.proxy.entities.Contact;
+import org.apache.openjpa.persistence.proxy.entities.EquityAnnuity;
+import org.apache.openjpa.persistence.proxy.entities.FixedAnnuity;
+import org.apache.openjpa.persistence.proxy.entities.Payor;
+import org.apache.openjpa.persistence.proxy.entities.Payout;
+import org.apache.openjpa.persistence.proxy.entities.Rider;
+import org.apache.openjpa.persistence.proxy.entities.AnnuityType;
+
+
+/*
+ * Test the complicated interaction between Detached entities, Proxy classes
+ * and Merging changes made in ProxyCollections back into entities.
+ *
+ * This code is based on AcmeTest2, which was originally written by
+ * Mohammad at IBM and contributed under ASL 2.0.
+ */
+public class TestDetachMerge extends SingleEMFTestCase {
+
+ public void setUp() {
+ setUp(DROP_TABLES, Address.class, Annuity.class, AnnuityHolder.class, AnnuityPersistebleObject.class,
+ Contact.class, EquityAnnuity.class, FixedAnnuity.class, Payor.class, Payout.class,
+ Person.class, Rider.class);
+ }
+
+ /*
+ * Test default 1.0 compatibility behavior, which should pass AS-IS
+ */
+ @AllowFailure(message="Will fail until OPENJPA-1597 is fixed")
+ public void testAnnuity1Compat() throws Exception {
+ OpenJPAEntityManagerFactorySPI emf1 =
+ (OpenJPAEntityManagerFactorySPI) OpenJPAPersistence.createEntityManagerFactory(
+ "Annuity1Compat", "org/apache/openjpa/persistence/proxy/persistence1.xml");
+ assertNotNull(emf1);
+
+ Log log = emf1.getConfiguration().getLog("test");
+
+ if (log.isTraceEnabled()) {
+ Compatibility compat = emf1.getConfiguration().getCompatibilityInstance();
+ assertNotNull(compat);
+ log.trace("started testAnnuity1Compat()");
+ log.trace("FlushBeforeDetach=" + compat.getFlushBeforeDetach());
+ log.trace("CopyOnDetach=" + compat.getCopyOnDetach());
+ log.trace("CascadeWithDetach=" + compat.getCascadeWithDetach());
+ }
+
+ try {
+ execute(emf1);
+ } catch (RuntimeException e) {
+ fail("testAnuity1Compat() should not have caused an execption!" + e);
+ } finally {
+ emf1.close();
+ }
+ }
+
+ /*
+ * Test 2.0 behavior with Compatibility flag and DetachedStateField=true, which should PASS
+ */
+ @AllowFailure(message="Will fail until OPENJPA-1597 is fixed")
+ public void testAnnuity2Compat() throws Exception {
+ OpenJPAEntityManagerFactorySPI emf2 =
+ (OpenJPAEntityManagerFactorySPI) OpenJPAPersistence.createEntityManagerFactory(
+ "Annuity2Compat", "org/apache/openjpa/persistence/proxy/persistence2.xml");
+ assertNotNull(emf2);
+
+ Log log = emf2.getConfiguration().getLog("test");
+
+ if (log.isTraceEnabled()) {
+ Compatibility compat = emf2.getConfiguration().getCompatibilityInstance();
+ assertNotNull(compat);
+ log.trace("started testAnnuity2Compat()");
+ log.trace("FlushBeforeDetach=" + compat.getFlushBeforeDetach());
+ log.trace("CopyOnDetach=" + compat.getCopyOnDetach());
+ log.trace("CascadeWithDetach=" + compat.getCascadeWithDetach());
+ }
+
+ try {
+ execute(emf2);
+ } catch (RuntimeException e) {
+ fail("testAnuity2Compat() should not have caused an execption!" + e);
+ } finally {
+ emf2.close();
+ }
+ }
+
+ /*
+ * Test 2.0 behavior with DetachedStateField=true, which should FAIL
+ */
+ public void testAnnuity2Fail() throws Exception {
+ OpenJPAEntityManagerFactorySPI emf2 =
+ (OpenJPAEntityManagerFactorySPI) OpenJPAPersistence.createEntityManagerFactory(
+ "Annuity2Fail", "org/apache/openjpa/persistence/proxy/persistence2.xml");
+ assertNotNull(emf2);
+
+ Log log = emf2.getConfiguration().getLog("test");
+
+ if (log.isTraceEnabled()) {
+ Compatibility compat = emf2.getConfiguration().getCompatibilityInstance();
+ assertNotNull(compat);
+ log.trace("started testAnnuity2Fail()");
+ log.trace("FlushBeforeDetach=" + compat.getFlushBeforeDetach());
+ log.trace("CopyOnDetach=" + compat.getCopyOnDetach());
+ log.trace("CascadeWithDetach=" + compat.getCascadeWithDetach());
+ }
+
+ try {
+ execute(emf2);
+ fail("testAnuity2Fail() should have caused an execption!");
+ } catch (RuntimeException e) {
+ if (e.getMessage().startsWith("Annuity:")) {
+ // no-op caught our expected exception
+ } else {
+ fail("testAnuity2Fail() caught an unexpected execption!" + e);
+ }
+ } finally {
+ emf2.close();
+ }
+ }
+
+ /*
+ * Test default 2.0 behavior with DetachedStateField=transient, which should PASS
+ */
+ public void testAnnuity2New() throws Exception {
+ OpenJPAEntityManagerFactorySPI emf2 =
+ (OpenJPAEntityManagerFactorySPI) OpenJPAPersistence.createEntityManagerFactory(
+ "Annuity2New", "org/apache/openjpa/persistence/proxy/persistence2.xml");
+ assertNotNull(emf2);
+
+ Log log = emf2.getConfiguration().getLog("test");
+
+ if (log.isTraceEnabled()) {
+ Compatibility compat = emf2.getConfiguration().getCompatibilityInstance();
+ assertNotNull(compat);
+ log.trace("started testAnnuity2New()");
+ log.trace("FlushBeforeDetach=" + compat.getFlushBeforeDetach());
+ log.trace("CopyOnDetach=" + compat.getCopyOnDetach());
+ log.trace("CascadeWithDetach=" + compat.getCascadeWithDetach());
+ }
+
+ try {
+ execute(emf2);
+ } catch (RuntimeException e) {
+ fail("testAnuity2New() should not have caused an execption!" + e);
+ } finally {
+ emf2.close();
+ }
+ }
+
+ private void execute(OpenJPAEntityManagerFactorySPI myEMF) throws Exception {
+ Log log = myEMF.getConfiguration().getLog("test");
+ //EntityManager em = myEMF.createEntityManager();
+ IContact contact = null;
+
+ try {
+ if (log.isTraceEnabled())
+ log.trace("creating contact");
+ try {
+ contact = createContact(myEMF);
+ } catch (Exception e) {
+ log.error("Create Contact failed.", e);
+ throw e;
+ }
+
+ try {
+ verifyContactValues(myEMF, contact);
+ } catch (Exception e) {
+ log.error("Create Contact verification failed.", e);
+ throw e;
+ // do not return, as this might be a small bug that we can bypass
+ }
+
+ if (log.isTraceEnabled())
+ log.trace("creating annuity holder");
+ IAnnuityHolder annuityHolder = null;
+ try {
+ annuityHolder = createAnnuityHolder(myEMF, contact);
+ } catch (Exception e) {
+ log.error("failed to create Annuity Holder Successfully.", e);
+ throw e;
+ }
+
+ try {
+ verifyAnnuityHolderValues(myEMF, annuityHolder);
+ } catch (Exception e) {
+ log.info("failed to verify create annuity holder successfuly.", e);
+ throw e;
+ }
+
+ if (log.isTraceEnabled())
+ log.trace("creating payor");
+ IPayor payor = null;
+ try {
+ payor = createPayor(myEMF);
+ } catch(Exception e) {
+ log.error("failed to create payor successfuly.", e);
+ throw e;
+ }
+
+ try {
+ verifyPayorValues(myEMF, payor);
+ } catch (Exception e) {
+ log.error("failed to verify create payor successfuly.", e);
+ throw e;
+ }
+
+ if (log.isTraceEnabled())
+ log.trace("creating annuity");
+ IAnnuity annuity =null;
+ AnnuityType annuityType = AnnuityType.FIXED;
+ try {
+ annuity = createAnnuityWithRider(myEMF, annuityType);
+ } catch (Exception e) {
+ log.error("failed to create annuity successfuly.", e);
+ throw e;
+ }
+
+ try {
+ log.trace("verify annuity with rider");
+ verifyAnnuityValues(myEMF, annuity, annuityType);
+ } catch (Exception e) {
+ log.error("failed to verify create annuity successfuly.", e);
+ throw e;
+ }
+
+ if (log.isTraceEnabled())
+ log.trace("upating annuity");
+ try {
+ log.trace("create annuity with payout");
+ annuity = createAnnuityPayout(myEMF, annuity);
+ } catch (Exception e) {
+ log.error("failed to create annuity successfuly.", e);
+ throw e;
+ }
+
+ try {
+ verifyAnnuityValues(myEMF, annuity, annuityType);
+ } catch (Exception e) {
+ log.error("failed to verify create annuity successfuly.", e);
+ throw e;
+ }
+
+ if (log.isTraceEnabled())
+ log.trace("upating annuity");
+ try {
+ EntityManager em = createEM(myEMF);
+ em.getTransaction().begin();
+ annuity.getPayors().add(payor);
+ annuity.setAnnuityHolderId(annuityHolder.getId());
+ annuity = em.merge(annuity);
+ em.getTransaction().commit();
+ closeEM(em);
+ } catch (Exception e) {
+ log.error("failed to update annuity successfuly.", e);
+ throw e;
+ }
+
+ try {
+ verifyAnnuityValues(myEMF, annuity, annuityType);
+ } catch (Exception e) {
+ log.error("failed to verify annuity update successfuly.", e);
+ throw e;
+ }
+ } finally {
+ log.error("scenario: failed.");
+ }
+
+ if (log.isTraceEnabled())
+ log.trace("scenario: completed.");
+ }
+
+ private IAnnuity createAnnuityPayout(OpenJPAEntityManagerFactorySPI myEMF, IAnnuity annuity) {
+ EntityManager em = createEM(myEMF);
+ em.getTransaction().begin();
+ IPayout payout = new Payout();
+ payout.setAnnuity(annuity);
+ payout.setTaxableAmount(new BigDecimal(100.00));
+ payout.setStartDate(Calendar.getInstance());
+ payout.setEndDate(Calendar.getInstance());
+ payout.setId(getId());
+ em.persist(payout);
+ em.getTransaction().commit();
+ em.getTransaction().begin();
+ annuity.getPayouts().add(payout);
+ em.getTransaction().commit();
+ closeEM(em);
+ return annuity;
+ }
+
+ private IAnnuity createAnnuityWithRider(OpenJPAEntityManagerFactorySPI myEMF, AnnuityType annuityType) {
+ EntityManager em = createEM(myEMF);
+ em.getTransaction().begin();
+ IAnnuity annuity = createAnnuity(annuityType);
+ IRider rider1 = getRider();
+ IRider rider2 = getRider();
+ IRider rider3 = getRider();
+ annuity.getRiders().add(rider1);
+ annuity.getRiders().add(rider2);
+ annuity.getRiders().add(rider3);
+ em.persist(annuity);
+ em.getTransaction().commit();
+ closeEM(em);
+ return annuity;
+ }
+
+ private IAnnuity createAnnuity(AnnuityType annuityType) {
+ if (AnnuityType.BASIC.equals(annuityType)) {
+ Annuity annuity = new Annuity();
+ annuity.setId(getId());
+ annuity.setAmount(500.00);
+ annuity.setAccountNumber("123456");
+ return annuity;
+ }
+ if (AnnuityType.EQUITY.equals(annuityType)) {
+ EquityAnnuity annuity = new EquityAnnuity();
+ annuity.setId(getId());
+ annuity.setAmount(500.00);
+ annuity.setAccountNumber("123456");
+ annuity.setFundNames("Something nothing wrong");
+ annuity.setIndexRate(10.99);
+ annuity.setLastPaidAmt(100.00);
+ return annuity;
+ }
+ if (AnnuityType.FIXED.equals(annuityType)) {
+ FixedAnnuity annuity = new FixedAnnuity();
+ ((FixedAnnuity)annuity).setRate(10.0);
+ annuity.setId(getId());
+ annuity.setAmount(500.00);
+ annuity.setAccountNumber("123456");
+ return annuity;
+ }
+ return null;
+ }
+
+ private IRider getRider() {
+ IRider rider = new Rider();
+ rider.setId(getId());
+ rider.setRule("Pay");
+ rider.setType(RiderType.REPLACE);
+ rider.setEffectiveDate(new Date());
+ return rider;
+ }
+
+ private void verifyAnnuityValues(OpenJPAEntityManagerFactorySPI myEMF, IAnnuity annuity, AnnuityType annuityType)
+ throws Exception {
+ IAnnuity results = findAnnuityById(myEMF, Annuity.class, annuity.getId());
+ if (annuity instanceof IFixedAnnuity) {
+ assertEqual((IFixedAnnuity)annuity, (IFixedAnnuity)results,
+ "Fixed Annuity from Client is not equal to DB value", "Mismacth was found.");
+ } else if (annuity instanceof IEquityAnnuity) {
+ assertEqual((IEquityAnnuity)annuity, (IEquityAnnuity)results,
+ "Equity Annuity from Client is not equal to DB value", "Mismacth was found.");
+ } else {
+ assertEqual(annuity, results,
+ "Basic Annuity from Client is not equal to DB value", "Mismacth was found.");
+ }
+
+ assertEqual(annuity.getPayouts(), results.getPayouts(),
+ "Annuity payouts from Client is not equal to DB value", "Mismacth was found in number of payouts");
+ boolean found = false;
+ if (annuity.getPayouts() != null) {
+ IPayout clientPayout = null;
+ for (int i=0; i<annuity.getPayouts().size(); i++) {
+ found = false; // reset
+ clientPayout = annuity.getPayouts().get(i);
+ for (IPayout resultPayout: results.getPayouts()) {
+ if (clientPayout.getId().equals(resultPayout.getId())){
+ found = true;
+ assertEqual(clientPayout, resultPayout,
+ "Annuity Payout from Client is not equal to DB value at location: " +i , "Mismacth was found");
+ }else{
+ continue;
+ }
+ }
+ if (!(found) && clientPayout != null) {
+ throw new RuntimeException("Annuity: Payout from client is not equal to DB. " +
+ "Found Payout with id: " + clientPayout.getId() +
+ " on the client side, but not in the database for annuity id:" + annuity.getId());
+
+ }
+ }
+ }
+
+ assertRidersEqual(annuity.getRiders(), results.getRiders(),
+ "Annuity rider from Client is not equal to DB value", "Mismacth was found in number of rider");
+ if (annuity.getRiders() != null) {
+ IRider clientRider = null;
+ for (int i=0; i<annuity.getRiders().size(); i++) {
+ found = false; // reset
+ clientRider = annuity.getRiders().get(i);
+ for (IRider resultRider : results.getRiders()) {
+ if (clientRider.getId().equals(resultRider.getId())){
+ found = true;
+ assertEqual(clientRider, resultRider,
+ "Annuity rider from Client is not equal to DB value at location: " +i , "Mismacth was found");
+ }else{
+ continue;
+ }
+ }
+ if (!(found) && clientRider != null) {
+ throw new RuntimeException("Annuity: Rider from client is not equal to DB. " +
+ "Found rider with id: " + clientRider.getId() +
+ " on the client side, but not in the database for annuity id:" + annuity.getId());
+
+ }
+ }
+ }
+
+ assertPayorsEqual(annuity.getPayors(), results.getPayors(),
+ "Annuity Payor from Client is not equal to DB value", "Mismacth was found.");
+ if (annuity.getPayors() != null) {
+ IPayor clientPayor = null;
+ for (int i=0; i<annuity.getPayors().size(); i++) {
+ found = false; // reset
+ clientPayor = annuity.getPayors().get(i);
+ for (IPayor resultPayor : results.getPayors()) {
+ if (clientPayor.getId().equals(resultPayor.getId())){
+ found = true;
+ assertEqual(annuity.getPayors().get(i), resultPayor,
+ "Annuity payor from Client is not equal to DB value at location: " +i , "Mismacth was found");
+ }else{
+ continue;
+ }
+ }
+ if (!(found) && clientPayor != null) {
+ throw new RuntimeException("Annuity: Payor from client is not equal to DB. " +
+ "Found payor with id: " + clientPayor.getId() +
+ " on the client side, but not in the database for annuity id:" + annuity.getId());
+
+ }
+ }
+ }
+ }
+
+ private void assertEqual(IAnnuity annuity, IAnnuity results, String string, String string2) throws Exception {
+ if(annuity == null && results == null)
+ return;
+ if (annuity == null)
+ throw new RuntimeException("Annuity: Annuities ! equal (Annuity was null).");
+ if (!annuity.getId().equals(results.getId())) {
+ throw new RuntimeException("Annuity: Annuities ! equal (Annuity ids not the same).");
+ }
+ assertPayorsEqual(annuity.getPayors(), results.getPayors(), string, string2);
+ assertRidersEqual(annuity.getRiders(), results.getRiders(), string, string2);
+ assertEqual(annuity.getPayouts(),results.getPayouts(), string, string2);
+ }
+
+ private void assertEqual(IEquityAnnuity annuity, IEquityAnnuity results, String string, String string2)
+ throws Exception {
+ if(annuity == null && results == null)
+ return;
+ if (annuity == null)
+ throw new RuntimeException("Annuity: Annuities ! equal (EquityAnnuity was null).");
+ if (!annuity.getId().equals(results.getId())) {
+ throw new RuntimeException("Annuity: Annuities ! equal (EquityAnnuity ids not the same).");
+ }
+
+ assertPayorsEqual(annuity.getPayors(), results.getPayors(), string, string2);
+ assertRidersEqual(annuity.getRiders(), results.getRiders(), string, string2);
+ assertEqual(annuity.getPayouts(),results.getPayouts(), string, string2);
+ }
+
+ private void assertEqual(IFixedAnnuity annuity, IFixedAnnuity results, String string, String string2)
+ throws Exception {
+ if(annuity == null && results == null)
+ return;
+ if (annuity == null)
+ throw new RuntimeException("Annuity: Annuities ! equal (FixedAnnuity was null).");
+ if (!annuity.getId().equals(results.getId())) {
+ throw new RuntimeException("Annuity: Annuities ! equal (FixedAnnuity ids not the same).");
+ }
+ assertPayorsEqual(annuity.getPayors(), results.getPayors(), string, string2);
+ assertRidersEqual(annuity.getRiders(), results.getRiders(), string, string2);
+ assertEqual(annuity.getPayouts(),results.getPayouts(), string, string2);
+ }
+
+ private IAnnuity findAnnuityById(OpenJPAEntityManagerFactorySPI myEMF, Class<Annuity> class1, String id) {
+ EntityManager em = createEM(myEMF);
+ IAnnuity ann = em.find(class1, id);
+ closeEM(em);
+ return ann;
+ }
+
+ private void assertEqual(List<IPayout> payouts, List<IPayout> payouts2, String string, String string2)
+ throws Exception {
+ if (payouts == null && payouts2 == null)
+ return;
+ if (payouts == null)
+ throw new RuntimeException("Annuity: IPayout list not the same (payouts was null)!");
+ if (payouts.size() != payouts2.size())
+ throw new RuntimeException("Annuity: IPayout list not the same (payouts size not the same)!");
+ for (int i = 0; i < payouts.size(); i++) {
+ IPayout payout = payouts.get(i);
+ boolean found = false;
+ for (int j = 0; i < payouts2.size(); j++) {
+ try {
+ assertEqual(payout, payouts2.get(j), string, string2);
+ found = true;
+ break;
+ } catch (Exception e) {
+ continue;
+ }
+ }
+ if (!found) {
+ throw new RuntimeException("Annuity: IPayout list not the same (no match found)!");
+ }
+ }
+ }
+
+ private void assertEqual(IPayout clientPayout, IPayout resultPayout, String string, String string2)
+ throws Exception {
+ if (clientPayout == null && resultPayout == null)
+ return;
+ if (clientPayout == null)
+ throw new RuntimeException("Annuity: IPayout not the same (clientPayout was null)! " +
+ string + " " + string2);
+ if (clientPayout.getId().equals(resultPayout.getId()))
+ return;
+ throw new RuntimeException("Annuity: IPayout not the same (clientPayout ids not the same)! " +
+ string + " " + string2);
+ }
+
+ private void assertRidersEqual(List<IRider> riders, List<IRider> riders2, String string, String string2)
+ throws Exception {
+ if (riders == null && riders2 == null)
+ return;
+ if (riders == null)
+ throw new RuntimeException("Annuity: IRider list not the same (riders was null)!");
+ if (riders.size() != riders2.size())
+ throw new RuntimeException("Annuity: IRider list not the same (riders size not the same)!");
+ for (int i = 0; i < riders.size(); i++) {
+ IRider rider = riders.get(i);
+ boolean found = false;
+ for (int j = 0; i < riders2.size(); j++) {
+ try {
+ assertEqual(rider, riders2.get(j), string, string2);
+ found = true;
+ break;
+ } catch (Exception e) {
+ continue;
+ }
+ }
+ if (!found) {
+ throw new RuntimeException("Annuity: IRider list not the same (match not found)!");
+ }
+ }
+ }
+
+ private void assertEqual(IRider clientRider, IRider resultRider, String string, String string2) throws Exception {
+ if (clientRider == null && resultRider == null)
+ return;
+ if (clientRider == null)
+ throw new RuntimeException("Annuity: IRider not the same (clientRider was null)! " +
+ string + " " + string2);
+ if (clientRider.getId().equals(resultRider.getId()))
+ return;
+ throw new RuntimeException("Annuity: IRider not the same (no match found)! " +
+ string + " " + string2);
+ }
+
+ private void assertPayorsEqual(List<IPayor> payors, List<IPayor> payors2, String string, String string2)
+ throws Exception {
+ if (payors == null && payors2 == null)
+ return;
+ if (payors == null)
+ throw new RuntimeException("Annuity: IPayor list not the same (payors was null)!");
+ if (payors.size() != payors2.size())
+ throw new RuntimeException("Annuity: IPayor list not the same (payors size not the same)!");
+ for (int i = 0; i < payors.size(); i++) {
+ IPayor payor = payors.get(i);
+ boolean found = false;
+ for (int j = 0; i < payors2.size(); j++) {
+ try {
+ assertEqual(payor, payors2.get(j), string, string2);
+ found = true;
+ break;
+ } catch (Exception e) {
+ continue;
+ }
+ }
+ if (!found) {
+ throw new RuntimeException("Annuity: IPayor list not the same (no match found)!");
+ }
+ }
+ }
+
+ private void verifyPayorValues(OpenJPAEntityManagerFactorySPI myEMF, IPayor payor) throws Exception {
+ IPayor results = null;
+ results = findPayorById(myEMF, Payor.class, payor.getId());
+ assertEqual(payor, results,
+ "Payor from Client is not equal to DB value.", "Mismacth was found.");
+ }
+
+ private IPayor findPayorById(OpenJPAEntityManagerFactorySPI myEMF, Class<Payor> class1, String id) {
+ EntityManager em = createEM(myEMF);
+ IPayor ip = em.find(class1, id);
+ closeEM(em);
+ return ip;
+ }
+
+ private void assertEqual(IPayor payor, IPayor results, String string, String string2) throws Exception {
+ if (payor == null && results == null)
+ return;
+ if (payor == null)
+ throw new RuntimeException("Annuity: IPayor not the same (payor was null)! " +
+ string + " " + string2);
+ if (payor.getId().equals(results.getId()))
+ return;
+ throw new RuntimeException("Annuity: IPayor not the same (no match found)! " +
+ string + " " + string2);
+ }
+
+ private IPayor createPayor(OpenJPAEntityManagerFactorySPI myEMF) {
+ EntityManager em = createEM(myEMF);
+ em.getTransaction().begin();
+ IPayor payor = new Payor();
+ payor.setId(getId());
+ payor.setName("Payor");
+ em.persist(payor);
+ em.getTransaction().commit();
+ closeEM(em);
+ return payor;
+ }
+
+ private void verifyAnnuityHolderValues(OpenJPAEntityManagerFactorySPI myEMF, IAnnuityHolder annuityHolder)
+ throws Exception {
+ IAnnuityHolder result = null;
+ result = findHolderById(myEMF, AnnuityHolder.class, annuityHolder.getId());
+ assertEqual(annuityHolder, result,
+ "Annuity Holder from Client is not equal to DB value.", "Mismacth was found.");
+ assertEqual(annuityHolder.getContact(), result.getContact(),
+ "Annuity Holder Contact from Client is not equal to DB value.", "Mismacth was found.");
+ }
+
+ private IAnnuityHolder findHolderById(OpenJPAEntityManagerFactorySPI myEMF, Class<AnnuityHolder> class1, String id)
+ {
+ EntityManager em = createEM(myEMF);
+ IAnnuityHolder result = em.find(class1, id);
+ closeEM(em);
+ return result;
+ }
+
+ private EntityManager createEM(OpenJPAEntityManagerFactorySPI myEMF) {
+ return myEMF.createEntityManager();
+ }
+
+ private void closeEM(EntityManager em) {
+ if (em != null) {
+ em.close();
+ em = null;
+ }
+ }
+
+ private void assertEqual(IAnnuityHolder annuityHolder, IAnnuityHolder results, String string, String string2)
+ throws Exception {
+ if (annuityHolder == null && results == null)
+ return;
+ if (annuityHolder == null)
+ throw new RuntimeException("Annuity: IAnnuityHolder not the same (annuityHolder was null)! " +
+ string + " " + string2);
+ if (annuityHolder.getId().equals(results.getId()))
+ return;
+ throw new RuntimeException("Annuity: IAnnuityHolder not the same (no match found)! " +
+ string + " " + string2);
+ }
+
+ private void assertEqual(IContact contact, IContact contact2, String string, String string2) throws Exception {
+ if (contact == null && contact2 == null)
+ return;
+ if (contact == null)
+ throw new RuntimeException("Annuity: Contacts not the same (contact was null)! " +
+ string + " " + string2);
+ if (contact.getId().equals(contact2.getId()))
+ return;
+ throw new RuntimeException("Annuity: Contacts not the same (no match found)! " +
+ string + " " + string2);
+ }
+
+ private IAnnuityHolder createAnnuityHolder(OpenJPAEntityManagerFactorySPI myEMF, IContact contact) {
+ EntityManager em = createEM(myEMF);
+ em.getTransaction().begin();
+ IAnnuityHolder annuityHolder = new AnnuityHolder();
+ annuityHolder.setCategory(AnnuityHolderCategory.METAL);
+ annuityHolder.setContact(contact);
+ annuityHolder.setId(getId());
+ annuityHolder.setFirstName("bob");
+ annuityHolder.setDateOfBirth(new Date());
+ annuityHolder.setGovernmentId("US");
+ annuityHolder.setLastName("dog");
+ annuityHolder.setTimeOfBirth(new Date());
+ em.persist(annuityHolder);
+ em.getTransaction().commit();
+ closeEM(em);
+ return annuityHolder;
+ }
+
+ private void verifyContactValues(OpenJPAEntityManagerFactorySPI myEMF, IContact contact) throws Exception {
+ // read the contact with id.
+ IContact results = null;
+ results = findContactById(myEMF, Contact.class, contact.getId());
+ assertEqual(contact, results,
+ "Contact from Client is not equal to DB value.", "Mismacth was found.");
+ }
+
+ private IContact findContactById(OpenJPAEntityManagerFactorySPI myEMF, Class<Contact> class1, String id) {
+ EntityManager em = createEM(myEMF);
+ IContact ic = em.find(class1, id);
+ closeEM(em);
+ return ic;
+ }
+
+ private IContact createContact(OpenJPAEntityManagerFactorySPI myEMF) {
+ EntityManager em = createEM(myEMF);
+ em.getTransaction().begin();
+ IContact contact = null;
+ contact = new Contact();
+ contact.setContactType(ContactType.BUSINESS);
+ contact.setId(getId());
+ contact.setEmail("here@there");
+ contact.setPhone("555-5555");
+ em.persist(contact);
+ em.getTransaction().commit();
+ closeEM(em);
+ return contact;
+ }
+
+ private String getId() {
+ UUID uid = UUID.randomUUID();
+ return uid.toString();
+ }
+
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/TestDetachMerge.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Address.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Address.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Address.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Address.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
+import javax.persistence.Entity;
+
+@Entity
+@Embeddable
+public class Address implements IAddress {
+ private static final long serialVersionUID = -2017682230659955349L;
+ private String line1;
+ private String line2;
+ private String city;
+ private String state;
+ private String zipCode;
+ private String country;
+
+ @Column(name="CITY")
+ public String getCity() {
+ return city;
+ }
+ public void setCity(String city) {
+ this.city = city;
+ }
+ @Column(name="COUNTRY")
+ public String getCountry() {
+ return country;
+ }
+ public void setCountry(String country) {
+ this.country = country;
+ }
+ @Column(name="LINE1")
+ public String getLine1() {
+ return line1;
+ }
+ public void setLine1(String line1) {
+ this.line1 = line1;
+ }
+ @Column(name="LINE2")
+ public String getLine2() {
+ return line2;
+ }
+ public void setLine2(String line2) {
+ this.line2 = line2;
+ }
+ @Column(name="STATE")
+ public String getState() {
+ return state;
+ }
+ public void setState(String state) {
+ this.state = state;
+ }
+ @Column(name="ZIP_CODE")
+ public String getZipCode() {
+ return zipCode;
+ }
+ public void setZipCode(String zipCode) {
+ this.zipCode = zipCode;
+ }
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Address.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Annuity.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Annuity.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Annuity.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Annuity.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.AttributeOverride;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorColumn;
+import javax.persistence.DiscriminatorType;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.OneToMany;
+
+
+@SuppressWarnings("serial")
+@Entity
+@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
+@DiscriminatorColumn(name="DTYPE", discriminatorType=DiscriminatorType.STRING)
+@DiscriminatorValue(value="ANNUITY")
+@AttributeOverride(name="lastUpdateDate", column=@Column(name="LAST_UPDATE_TS"))
+public class Annuity extends AnnuityPersistebleObject implements IAnnuity {
+
+ private Double lastPaidAmt;
+ private String AccountNumber;
+ private Double amount;
+ private String annuityHolderId;
+ private List<IPayout> payouts = new ArrayList<IPayout>();
+ private List<IRider> riders = new ArrayList<IRider>();
+ private List<IPayor> payors = new ArrayList<IPayor>();
+
+ public Annuity(){
+ }
+
+ @Column(name="LAST_PAID_AMT")
+ public Double getLastPaidAmt() {
+ return lastPaidAmt;
+ }
+ public void setLastPaidAmt(Double lastPaidAmt) {
+ this.lastPaidAmt = lastPaidAmt;
+ if (this.lastPaidAmt != null) {
+ DecimalFormat df = new DecimalFormat("#.##");
+ this.lastPaidAmt= new Double(df.format(lastPaidAmt));
+ }
+ }
+
+ @Column(name="ACCOUNT_NUMBER")
+ public String getAccountNumber() {
+ return AccountNumber;
+ }
+ public void setAccountNumber(String accountNumber) {
+ AccountNumber = accountNumber;
+ }
+
+ @Column(name="AMOUNT")
+ public Double getAmount() {
+ return amount;
+ }
+ public void setAmount(Double amount) {
+ this.amount = amount;
+ if (this.amount != null) {
+ DecimalFormat df = new DecimalFormat("#.##");
+ this.amount = new Double(df.format(amount));
+ }
+ }
+
+ @Column(name="FK_ANNUITY_HOLDER_ID")
+ public String getAnnuityHolderId() {
+ return this.annuityHolderId;
+ }
+ public void setAnnuityHolderId(String annuityHolderId) {
+ this.annuityHolderId = annuityHolderId;
+
+ }
+
+ @ManyToMany(targetEntity=Payor.class,
+ fetch=FetchType.EAGER)
+ @JoinTable(name="ANNUITY_PAYOR",
+ joinColumns={@JoinColumn(name="FK_ANNUITY_ID")},
+ inverseJoinColumns={@JoinColumn(name="FK_PAYOR_ID")})
+ public List<IPayor> getPayors() {
+ return this.payors;
+ }
+ public void setPayors(List<IPayor> payors) {
+ this.payors = payors;
+
+ }
+
+ @OneToMany(targetEntity=Payout.class,
+ mappedBy="annuity",
+ fetch=FetchType.EAGER)
+ public List<IPayout> getPayouts() {
+ return this.payouts;
+ }
+ public void setPayouts(List<IPayout> payouts) {
+ this.payouts = payouts;
+ }
+
+ @OneToMany(cascade={CascadeType.ALL},
+ targetEntity=Rider.class,
+ fetch=FetchType.EAGER)
+ @JoinTable(name="ANNUITY_RIDER",
+ joinColumns={@JoinColumn(name="FK_ANNUITY_ID")},
+ inverseJoinColumns={@JoinColumn(name="FK_RIDER_ID")})
+ public List<IRider> getRiders() {
+ return this.riders;
+ }
+ public void setRiders(List<IRider> riders) {
+ this.riders = riders;
+ }
+
+
+
+
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Annuity.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityHolder.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityHolder.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityHolder.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityHolder.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+import javax.persistence.AttributeOverride;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.PrimaryKeyJoinColumn;
+import javax.persistence.Table;
+
+@Entity
+@PrimaryKeyJoinColumn(name="ID")
+@Table(name="ANNUITY_HOLDER")
+@AttributeOverride(name="lastUpdateDate", column=@Column(name="LAST_UPDATE_TS"))
+public class AnnuityHolder extends Person implements IAnnuityHolder{
+ private static final long serialVersionUID = 3307367871936336517L;
+ private AnnuityHolderCategory category;
+
+ @Column(name="CATEGORY")
+ @Enumerated(EnumType.ORDINAL)
+ public AnnuityHolderCategory getCategory() {
+ return this.category;
+ }
+
+ public void setCategory(AnnuityHolderCategory category) {
+ this.category = category;
+ }
+
+
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityHolder.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityHolderCategory.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityHolderCategory.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityHolderCategory.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityHolderCategory.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+public enum AnnuityHolderCategory {
+ METAL, BRONZE, SILVER, GOLD;
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityHolderCategory.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityPersistebleObject.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityPersistebleObject.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityPersistebleObject.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityPersistebleObject.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+import java.util.Date;
+
+import javax.persistence.MappedSuperclass;
+import javax.persistence.PrePersist;
+import javax.persistence.PreUpdate;
+import javax.persistence.Transient;
+import javax.persistence.Version;
+
+@MappedSuperclass
+public class AnnuityPersistebleObject implements JPAPersisteble {
+ private static final long serialVersionUID = -1752164352355128830L;
+ private String id;
+ private Date lastUpdateDate;
+ private Parameterizable<String, String> config = new StringParameterizable();
+ private int version;
+
+ @Version
+ public int getVersion() {
+ return version;
+ }
+
+ public void setVersion(int version) {
+ this.version = version;
+ }
+
+ @javax.persistence.Id
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Date getLastUpdateDate() {
+ return lastUpdateDate;
+ }
+
+ public void setLastUpdateDate(Date lastUpdateDate) {
+ this.lastUpdateDate = lastUpdateDate;
+ }
+
+ @Transient
+ public Parameterizable<String, String> getConfiguration() {
+ return this.config;
+ }
+ @Transient
+ public void setConfiguration(Parameterizable<String, String> config) {
+ this.config = config;
+ }
+
+ @SuppressWarnings("unused")
+ @PrePersist
+ @PreUpdate
+ private void fixLastUpdateDate(){
+ setLastUpdateDate(new Date());
+ }
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityPersistebleObject.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityType.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityType.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityType.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityType.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+public enum AnnuityType {
+ BASIC, EQUITY, FIXED;
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/AnnuityType.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Configrable.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Configrable.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Configrable.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Configrable.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+import java.io.Serializable;
+
+public interface Configrable<K, V> extends Serializable{
+ public Parameterizable<K, V> getConfiguration();
+ public void setConfiguration(Parameterizable<K, V> config);
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Configrable.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Contact.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Contact.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Contact.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Contact.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+import javax.persistence.AttributeOverride;
+import javax.persistence.Column;
+import javax.persistence.Embedded;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+
+@Entity
+@Table(name="CONTACT")
+@AttributeOverride(name="lastUpdateDate", column=@Column(name="LAST_UPDATE_TS"))
+public class Contact extends AnnuityPersistebleObject implements IContact {
+ private static final long serialVersionUID = 4015672780551057807L;
+ private Address theAddress;
+ private String email;
+ private String phone;
+ private ContactType contactType;
+
+ @Transient
+ public IAddress getAddress() {
+ return (IAddress) this.getTheAddress();
+ }
+ public void setAddress(IAddress address) {
+ if (address instanceof Address){
+ this.setTheAddress((Address)address);
+ }else if(address == null) {
+ this.setTheAddress(null);
+ }
+ else{
+ throw new ClassCastException("Invalid Implementaion of IAddress. " +
+ "Class must be instance of com.ibm.wssvt.acme.annuity.common.bean.jpa.Address");
+ }
+ }
+
+ @Embedded
+ private Address getTheAddress() {
+ return theAddress;
+ }
+ private void setTheAddress(Address address) {
+ this.theAddress = address;
+ }
+
+ @Column(name="EMAIL")
+ public String getEmail() {
+ return email;
+ }
+ public void setEmail(String email) {
+ this.email = email;
+ }
+ @Column(name="PHONE")
+ public String getPhone() {
+ return phone;
+ }
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+ @Column(name="TYPE")
+ @Enumerated(EnumType.STRING)
+ public ContactType getContactType() {
+ return contactType;
+ }
+ public void setContactType(ContactType contactType) {
+ this.contactType = contactType;
+ }
+
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/Contact.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/ContactType.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/ContactType.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/ContactType.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/ContactType.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+public enum ContactType {
+ HOME, BUSINESS, OTHER;
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/ContactType.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/EquityAnnuity.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/EquityAnnuity.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/EquityAnnuity.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/EquityAnnuity.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+import java.text.DecimalFormat;
+
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+@Entity
+@DiscriminatorValue(value = "EQUITY")
+public class EquityAnnuity extends Annuity implements IEquityAnnuity {
+
+ private static final long serialVersionUID = -7227462924769151013L;
+
+ private String fundNames;
+
+ private Double indexRate;
+
+ @Column(name="FUND_NAMES")
+ public String getFundNames() {
+ return fundNames;
+ }
+
+ public void setFundNames(String fundNames) {
+ this.fundNames = fundNames;
+ }
+
+ @Column(name="INDEX_RATE")
+ public Double getIndexRate() {
+ return indexRate;
+ }
+
+ public void setIndexRate(Double indexRate) {
+ this.indexRate = indexRate;
+ if (this.indexRate != null) {
+ DecimalFormat df = new DecimalFormat("#.##");
+ this.indexRate= new Double(df.format(indexRate));
+ }
+ }
+
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/EquityAnnuity.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/FixedAnnuity.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/FixedAnnuity.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/FixedAnnuity.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/FixedAnnuity.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+import java.text.DecimalFormat;
+
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+@Entity
+@DiscriminatorValue(value = "FIXED")
+public class FixedAnnuity extends Annuity implements IFixedAnnuity {
+
+ private static final long serialVersionUID = 1527245835840605452L;
+
+ private Double rate;
+
+ @Column(name="FIXED_RATE")
+ public Double getRate() {
+ return rate;
+ }
+
+ public void setRate(Double rate) {
+ this.rate = rate;
+ if (this.rate != null) {
+ DecimalFormat df = new DecimalFormat("#.##");
+ this.rate= new Double(df.format(rate));
+ }
+ }
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/FixedAnnuity.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAddress.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAddress.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAddress.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAddress.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+import java.io.Serializable;
+
+public interface IAddress extends Serializable {
+
+ public String getCity();
+
+ public void setCity(String city);
+
+ public String getCountry();
+
+ public void setCountry(String country);
+
+ public String getLine1();
+
+ public void setLine1(String line1);
+
+ public String getLine2();
+
+ public void setLine2(String line2);
+
+ public String getState();
+
+ public void setState(String state);
+
+ public String getZipCode();
+
+ public void setZipCode(String zipCode);
+
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAddress.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuity.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuity.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuity.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuity.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+import java.util.List;
+
+public interface IAnnuity extends IAnnuityObject {
+
+ public abstract Double getLastPaidAmt();
+
+ public abstract void setLastPaidAmt(Double lastPaidAmt);
+
+ public abstract String getAccountNumber();
+
+ public abstract void setAccountNumber(String accountNumber);
+
+ public abstract Double getAmount();
+
+ public abstract void setAmount(Double amount);
+
+ public abstract List<IPayout> getPayouts();
+ public abstract void setPayouts(List<IPayout> payout);
+
+ public abstract List<IRider> getRiders();
+ public abstract void setRiders(List<IRider> riders);
+
+ public abstract String getAnnuityHolderId();
+ public abstract void setAnnuityHolderId(String annuityHolderId);
+
+ public abstract List<IPayor> getPayors();
+ public abstract void setPayors(List<IPayor> payors);
+
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuity.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuityHolder.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuityHolder.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuityHolder.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuityHolder.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+public interface IAnnuityHolder extends IPerson {
+
+ public AnnuityHolderCategory getCategory();
+ public void setCategory(AnnuityHolderCategory category);
+
+
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuityHolder.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuityObject.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuityObject.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuityObject.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuityObject.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+import java.util.Date;
+
+public interface IAnnuityObject extends Identifiable {
+ public void setLastUpdateDate(Date date);
+ public Date getLastUpdateDate();
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IAnnuityObject.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IContact.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IContact.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IContact.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IContact.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+public interface IContact extends IAnnuityObject {
+
+ public IAddress getAddress();
+
+ public void setAddress(IAddress address);
+
+ public String getEmail();
+
+ public void setEmail(String email);
+
+ public String getPhone();
+
+ public void setPhone(String phone);
+
+ public ContactType getContactType();
+
+ public void setContactType(ContactType type);
+
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IContact.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IEquityAnnuity.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IEquityAnnuity.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IEquityAnnuity.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IEquityAnnuity.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+public interface IEquityAnnuity extends IAnnuity{
+
+ public String getFundNames();
+
+ public void setFundNames(String fundNames);
+
+ public Double getIndexRate();
+
+ public void setIndexRate(Double indexRate);
+
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IEquityAnnuity.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IFixedAnnuity.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IFixedAnnuity.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IFixedAnnuity.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IFixedAnnuity.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+public interface IFixedAnnuity extends IAnnuity {
+
+ public Double getRate();
+
+ public void setRate(Double rate);
+
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IFixedAnnuity.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IPayor.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IPayor.java?rev=927434&view=auto
==============================================================================
--- openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IPayor.java (added)
+++ openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IPayor.java Thu Mar 25 14:58:56 2010
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.proxy.entities;
+
+public interface IPayor extends IAnnuityObject{
+ public String getName();
+ public void setName(String name);
+
+}
Propchange: openjpa/branches/2.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/proxy/entities/IPayor.java
------------------------------------------------------------------------------
svn:eol-style = native