openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r627979 [32/39] - in /openjpa/trunk: openjpa-lib/src/test/java/org/apache/openjpa/lib/test/ openjpa-persistence-jdbc/ openjpa-persistence-jdbc/src/test/java/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/ openjpa-per...
Date Fri, 15 Feb 2008 09:20:40 GMT
Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AllFieldTypesTest.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AllFieldTypesTest.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AllFieldTypesTest.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AllFieldTypesTest.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,303 @@
+/*
+ * 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.kernel.common.apps;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Date;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.apache.openjpa.persistence.common.utils.AbstractTestCase;
+
+/**
+ * Used in testing; should be enhanced.
+ */
+@Entity
+@Table(name = "ALL_FLDTYPETEST")
+public class AllFieldTypesTest {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    private int id;
+
+    private int testint;
+    private long testlong;
+    private short testshort;
+    private float testfloat;
+    private double testdouble;
+    private byte testbyte;
+    private boolean testboolean;
+    private char testchar;
+    private String testString;
+    private String testBigString;
+    @Temporal(TemporalType.DATE)
+    private Date testDate;
+    @Temporal(TemporalType.DATE)
+    private Calendar testCalendar;
+    private Object testObject;
+    private BigInteger testBigInteger;
+    private BigDecimal testBigDecimal;
+
+    public AllFieldTypesTest() {
+        testfloat = 1f;
+        testdouble = 1.0;
+    }
+
+    public Date getTestDate() {
+        return this.testDate;
+    }
+
+    public void setTestDate(Date testDate) {
+        this.testDate = testDate;
+    }
+
+    public void setTestCalendar(Calendar testCalendar) {
+        this.testCalendar = testCalendar;
+    }
+
+    public Calendar getTestCalendar() {
+        return this.testCalendar;
+    }
+
+    public Object getTestObject() {
+        return this.testObject;
+    }
+
+    public void setTestObject(Object testObject) {
+        this.testObject = testObject;
+    }
+
+    public char getTestchar() {
+        return this.testchar;
+    }
+
+    public void setTestchar(char testchar) {
+        this.testchar = testchar;
+    }
+
+    public int getTestint() {
+        return this.testint;
+    }
+
+    public void setTestint(int testint) {
+        this.testint = testint;
+    }
+
+    public short getTestshort() {
+        return this.testshort;
+    }
+
+    public void setTestshort(short testshort) {
+        this.testshort = testshort;
+    }
+
+    public long getTestlong() {
+        return this.testlong;
+    }
+
+    public void setTestlong(long testlong) {
+        this.testlong = testlong;
+    }
+
+    public boolean getTestboolean() {
+        return this.testboolean;
+    }
+
+    public void setTestboolean(boolean testboolean) {
+        this.testboolean = testboolean;
+    }
+
+    public float getTestfloat() {
+        return this.testfloat;
+    }
+
+    public void setTestfloat(float testfloat) {
+        this.testfloat = testfloat;
+    }
+
+    public double getTestdouble() {
+        return this.testdouble;
+    }
+
+    public void setTestdouble(double testdouble) {
+        this.testdouble = testdouble;
+    }
+
+    public String getTestString() {
+        return this.testString;
+    }
+
+    public void setTestString(String testString) {
+        this.testString = testString;
+    }
+
+    public void setTestBigString(String testBigString) {
+        this.testBigString = testBigString;
+    }
+
+    public String getTestBigString() {
+        return this.testBigString;
+    }
+
+    public byte getTestbyte() {
+        return this.testbyte;
+    }
+
+    public void setTestbyte(byte testbyte) {
+        this.testbyte = testbyte;
+    }
+
+    public BigInteger getTestBigInteger() {
+        return this.testBigInteger;
+    }
+
+    public void setTestBigInteger(BigInteger testBigInteger) {
+        this.testBigInteger = testBigInteger;
+    }
+
+    public BigDecimal getTestBigDecimal() {
+        return this.testBigDecimal;
+    }
+
+    public void setTestBigDecimal(BigDecimal testBigDecimal) {
+        this.testBigDecimal = testBigDecimal;
+    }
+
+    public void randomize(boolean objects, boolean blobs) {
+        testint = AbstractTestCase.randomInt().intValue();
+        testlong = AbstractTestCase.randomLong().longValue();
+        testshort = AbstractTestCase.randomShort().shortValue();
+        testfloat = AbstractTestCase.randomFloat().floatValue();
+        testdouble = AbstractTestCase.randomDouble().doubleValue();
+        testbyte = AbstractTestCase.randomByte().byteValue();
+        testboolean = AbstractTestCase.randomBoolean().booleanValue();
+        testchar = AbstractTestCase.randomChar().charValue();
+
+        if (objects) {
+            testString = AbstractTestCase.randomString();
+            testDate = AbstractTestCase.randomDate();
+
+            testCalendar = Calendar.getInstance();
+            testCalendar.setTime(AbstractTestCase.randomDate());
+
+            testBigInteger = AbstractTestCase.randomBigInteger();
+            testBigDecimal = AbstractTestCase.randomBigDecimal();
+        }
+
+        if (blobs && objects) {
+            testObject = AbstractTestCase.randomBlob();
+            testBigString = AbstractTestCase.randomClob();
+        }
+    }
+
+    public String toString() {
+        return "\n{"
+            + "testint=" + testint + ";"
+            + "testlong=" + testlong + ";"
+            + "testshort=" + testshort + ";"
+            + "testfloat=" + testfloat + ";"
+            + "testdouble=" + testdouble + ";"
+            + "testbyte=" + testbyte + ";"
+            + "testboolean=" + testboolean + ";"
+            + "testchar=" + testchar + ";"
+            + "testString=" + testString + ";"
+            + "testBigString=" + testBigString + ";"
+            + "testDate=" + testDate + ";"
+            + "testCalendar=" + testCalendar + ";"
+            + "testObject=" + testObject
+            + "(" + ((testObject instanceof byte[]) ?
+            "(byte[])" + ((byte[]) testObject).length + "" :
+            (testObject == null ? "null" :
+                testObject.getClass().getName())) + ")"
+            + ";"
+            + "testBigInteger=" + testBigInteger + ";"
+            + "testBigDecimal=" + testBigDecimal + ";"
+            + "}";
+    }
+
+    public int hashCode() {
+        return (int) ((
+            testint
+                + testlong
+                + testshort
+                + testfloat
+                + testdouble
+                + testbyte
+                + (testboolean ? 1 : 0)
+                + testchar
+                + (testString == null ? 0 : testString.hashCode())
+                + (testBigString == null ? 0 : testBigString.hashCode())
+                + (testDate == null ? 0 : testDate.hashCode())
+                + (testCalendar == null ? 0 : testCalendar.hashCode())
+                + (testObject == null ? 0 : testObject.hashCode())
+                + (testBigInteger == null ? 0 : testBigInteger.hashCode())
+                + (testBigDecimal == null ? 0 : testBigDecimal.hashCode())))
+            % Integer.MAX_VALUE;
+    }
+
+    public boolean equals(Object other) {
+        if (other == null && !(other instanceof AllFieldTypesTest))
+            return false;
+
+        AllFieldTypesTest o = (AllFieldTypesTest) other;
+
+        return
+            o.testint == testint &&
+                o.testlong == testlong &&
+                o.testshort == testshort &&
+                o.testfloat == testfloat &&
+                o.testdouble == testdouble &&
+                o.testbyte == testbyte &&
+                o.testboolean == testboolean &&
+                o.testchar == testchar &&
+                eq(o.testString, testString) &&
+                eq(o.testBigString, testBigString) &&
+                eq(o.testDate, testDate) &&
+                eq(o.testCalendar, testCalendar) &&
+                eq(o.testObject, testObject) &&
+                eq(o.testBigInteger, o.testBigInteger) &&
+                eq(o.testBigDecimal, o.testBigDecimal);
+    }
+
+    private boolean eq(Object a, Object b) {
+        if (a == b)
+            return true;
+        if (a == null && b != null)
+            return false;
+        if (a != null && b == null)
+            return false;
+
+        // OK, this is stupid, but we want to special-case blobs
+        // thay are byte arrays, since new byte [] { 1, 2} does not
+        // equals inew byte [] { 1, 2}
+        if (a instanceof byte[] && b instanceof byte[])
+            return Arrays.equals((byte[]) a, (byte[]) b);
+
+        return a.equals(b);
+    }
+}
+

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AllFieldsTypeTest.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AllFieldsTypeTest.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AllFieldsTypeTest.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AllFieldsTypeTest.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,269 @@
+/*
+ * 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.kernel.common.apps;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Date;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * Used in testing; should be enhanced.
+ */
+@Entity
+@Table(name = "afieldstt")
+public class AllFieldsTypeTest {
+
+    @Id
+    private int id;
+    private int testint;
+    private long testlong;
+    private short testshort;
+    private float testfloat;
+    private double testdouble;
+    private byte testbyte;
+    private boolean testboolean;
+    private char testchar;
+    private String testString;
+    private String testBigString;
+    private Date testDate;
+    private Calendar testCalendar;
+    private Object testObject;
+    private BigInteger testBigInteger;
+    private BigDecimal testBigDecimal;
+
+    public Date getTestDate() {
+        return this.testDate;
+    }
+
+    public void setTestDate(Date testDate) {
+        this.testDate = testDate;
+    }
+
+    public void setTestCalendar(Calendar testCalendar) {
+        this.testCalendar = testCalendar;
+    }
+
+    public Calendar getTestCalendar() {
+        return this.testCalendar;
+    }
+
+    public Object getTestObject() {
+        return this.testObject;
+    }
+
+    public void setTestObject(Object testObject) {
+        this.testObject = testObject;
+    }
+
+    public char getTestchar() {
+        return this.testchar;
+    }
+
+    public void setTestchar(char testchar) {
+        this.testchar = testchar;
+    }
+
+    public int getTestint() {
+        return this.testint;
+    }
+
+    public void setTestint(int testint) {
+        this.testint = testint;
+    }
+
+    public short getTestshort() {
+        return this.testshort;
+    }
+
+    public void setTestshort(short testshort) {
+        this.testshort = testshort;
+    }
+
+    public long getTestlong() {
+        return this.testlong;
+    }
+
+    public void setTestlong(long testlong) {
+        this.testlong = testlong;
+    }
+
+    public boolean getTestboolean() {
+        return this.testboolean;
+    }
+
+    public void setTestboolean(boolean testboolean) {
+        this.testboolean = testboolean;
+    }
+
+    public float getTestfloat() {
+        return this.testfloat;
+    }
+
+    public void setTestfloat(float testfloat) {
+        this.testfloat = testfloat;
+    }
+
+    public double getTestdouble() {
+        return this.testdouble;
+    }
+
+    public void setTestdouble(double testdouble) {
+        this.testdouble = testdouble;
+    }
+
+    public String getTestString() {
+        return this.testString;
+    }
+
+    public void setTestString(String testString) {
+        this.testString = testString;
+    }
+
+    public void setTestBigString(String testBigString) {
+        this.testBigString = testBigString;
+    }
+
+    public String getTestBigString() {
+        return this.testBigString;
+    }
+
+    public byte getTestbyte() {
+        return this.testbyte;
+    }
+
+    public void setTestbyte(byte testbyte) {
+        this.testbyte = testbyte;
+    }
+
+    public BigInteger getTestBigInteger() {
+        return this.testBigInteger;
+    }
+
+    public void setTestBigInteger(BigInteger testBigInteger) {
+        this.testBigInteger = testBigInteger;
+    }
+
+    public BigDecimal getTestBigDecimal() {
+        return this.testBigDecimal;
+    }
+
+    public void setTestBigDecimal(BigDecimal testBigDecimal) {
+        this.testBigDecimal = testBigDecimal;
+    }
+
+    public String toString() {
+        return "\n{"
+            + "testint=" + testint + ";"
+            + "testlong=" + testlong + ";"
+            + "testshort=" + testshort + ";"
+            + "testfloat=" + testfloat + ";"
+            + "testdouble=" + testdouble + ";"
+            + "testbyte=" + testbyte + ";"
+            + "testboolean=" + testboolean + ";"
+            + "testchar=" + testchar + ";"
+            + "testString=" + testString + ";"
+            + "testBigString=" + testBigString + ";"
+            + "testDate=" + testDate + ";"
+            + "testCalendar=" + testCalendar + ";"
+            + "testObject=" + testObject
+            + "(" + ((testObject instanceof byte[]) ?
+            "(byte[])" + ((byte[]) testObject).length + "" :
+            (testObject == null ? "null" :
+                testObject.getClass().getName())) + ")"
+            + ";"
+            + "testBigInteger=" + testBigInteger + ";"
+            + "testBigDecimal=" + testBigDecimal + ";"
+            + "}";
+    }
+
+    public int hashCode() {
+        return (int) ((
+            testint
+                + testlong
+                + testshort
+                + testfloat
+                + testdouble
+                + testbyte
+                + (testboolean ? 1 : 0)
+                + testchar
+                + (testString == null ? 0 : testString.hashCode())
+                + (testBigString == null ? 0 : testBigString.hashCode())
+                + (testDate == null ? 0 : testDate.hashCode())
+                + (testCalendar == null ? 0 : testCalendar.hashCode())
+                + (testObject == null ? 0 : testObject.hashCode())
+                + (testBigInteger == null ? 0 : testBigInteger.hashCode())
+                + (testBigDecimal == null ? 0 : testBigDecimal.hashCode())))
+            % Integer.MAX_VALUE;
+    }
+
+    public boolean equals(Object other) {
+        if (other == null && !(other instanceof AllFieldsTypeTest))
+            return false;
+
+        AllFieldsTypeTest o = (AllFieldsTypeTest) other;
+
+        return
+            o.testint == testint &&
+                o.testlong == testlong &&
+                o.testshort == testshort &&
+                o.testfloat == testfloat &&
+                o.testdouble == testdouble &&
+                o.testbyte == testbyte &&
+                o.testboolean == testboolean &&
+                o.testchar == testchar &&
+                eq(o.testString, testString) &&
+                eq(o.testBigString, testBigString) &&
+                eq(o.testDate, testDate) &&
+                eq(o.testCalendar, testCalendar) &&
+                eq(o.testObject, testObject) &&
+                eq(o.testBigInteger, o.testBigInteger) &&
+                eq(o.testBigDecimal, o.testBigDecimal);
+    }
+
+    private boolean eq(Object a, Object b) {
+        if (a == b)
+            return true;
+        if (a == null && b != null)
+            return false;
+        if (a != null && b == null)
+            return false;
+
+        // OK, this is stupid, but we want to special-case blobs
+        // thay are byte arrays, since new byte [] { 1, 2} does not
+        // equals inew byte [] { 1, 2}
+        if (a instanceof byte[] && b instanceof byte[])
+            return Arrays.equals((byte[]) a, (byte[]) b);
+
+        return a.equals(b);
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+}
+

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdClassString.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdClassString.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdClassString.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdClassString.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,72 @@
+/*
+ * 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.kernel.common.apps;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+
+//import java.lang.annotation.Annotation;
+
+@Entity
+@Table(name = "APP_IDCS")
+@IdClass(AppIdClassString.Idkey.class)
+public class AppIdClassString {
+
+    @Id
+    private int pk;
+
+    public AppIdClassString(int pk) {
+        this.pk = pk;
+    }
+
+    public int getPk() {
+        return pk;
+    }
+
+    public static class Idkey implements java.io.Serializable {
+
+        public int pk;
+
+        public Idkey() {
+        }
+
+        public Idkey(String pk) {
+            if (pk != null)
+                this.pk = Integer.parseInt(pk);
+        }
+
+        @Override
+        public int hashCode() {
+            return pk;
+        }
+
+        public String toString() {
+            return pk + "";
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (o == null || !(o instanceof Id))
+                return false;
+            return pk == ((Idkey) o).pk;
+        }
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdHolder.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdHolder.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdHolder.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdHolder.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,179 @@
+/*
+ * 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.kernel.common.apps;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import javax.persistence.Entity;
+
+/**
+ * Holder for one-one and one-many relations to app id hierarchy classes.
+ *
+ * @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
+ */
+@Entity
+public class AppIdHolder {
+
+    private int id = Math.abs((int) (Math.random() * (Integer.MAX_VALUE)));
+
+    private String someField;
+
+    // one-to-one relations
+    private AppIdSuper appIdSuper;
+    private AppIdSubA appIdSubA;
+    private AppIdSubB appIdSubB;
+    private AppIdSubC appIdSubC;
+    private AppIdSubD appIdSubD;
+    private AppIdSubE appIdSubE;
+    private AppIdSubF appIdSubF;
+
+    // one-to-many relations
+    private Set appIdSupers;
+    private Collection appIdSubAs;
+    private List appIdSubBs;
+    private Set appIdSubCs;
+    private LinkedList appIdSubDs;
+    private HashSet appIdSubEs;
+    private ArrayList appIdSubFs;
+
+    public void setSomeField(String someField) {
+        this.someField = someField;
+    }
+
+    public String getSomeField() {
+        return this.someField;
+    }
+
+    public void setAppIdSuper(AppIdSuper appIdSuper) {
+        this.appIdSuper = appIdSuper;
+    }
+
+    public AppIdSuper getAppIdSuper() {
+        return this.appIdSuper;
+    }
+
+    public void setAppIdSubA(AppIdSubA appIdSubA) {
+        this.appIdSubA = appIdSubA;
+    }
+
+    public AppIdSubA getAppIdSubA() {
+        return this.appIdSubA;
+    }
+
+    public void setAppIdSubB(AppIdSubB appIdSubB) {
+        this.appIdSubB = appIdSubB;
+    }
+
+    public AppIdSubB getAppIdSubB() {
+        return this.appIdSubB;
+    }
+
+    public void setAppIdSubC(AppIdSubC appIdSubC) {
+        this.appIdSubC = appIdSubC;
+    }
+
+    public AppIdSubC getAppIdSubC() {
+        return this.appIdSubC;
+    }
+
+    public void setAppIdSubD(AppIdSubD appIdSubD) {
+        this.appIdSubD = appIdSubD;
+    }
+
+    public AppIdSubD getAppIdSubD() {
+        return this.appIdSubD;
+    }
+
+    public void setAppIdSubE(AppIdSubE appIdSubE) {
+        this.appIdSubE = appIdSubE;
+    }
+
+    public AppIdSubE getAppIdSubE() {
+        return this.appIdSubE;
+    }
+
+    public void setAppIdSubF(AppIdSubF appIdSubF) {
+        this.appIdSubF = appIdSubF;
+    }
+
+    public AppIdSubF getAppIdSubF() {
+        return this.appIdSubF;
+    }
+
+    public void setAppIdSubAs(Collection appIdSubAs) {
+        this.appIdSubAs = appIdSubAs;
+    }
+
+    public Collection getAppIdSubAs() {
+        return this.appIdSubAs;
+    }
+
+    public void setAppIdSubBs(List appIdSubBs) {
+        this.appIdSubBs = appIdSubBs;
+    }
+
+    public List getAppIdSubBs() {
+        return this.appIdSubBs;
+    }
+
+    public void setAppIdSubCs(Set appIdSubCs) {
+        this.appIdSubCs = appIdSubCs;
+    }
+
+    public Set getAppIdSubCs() {
+        return this.appIdSubCs;
+    }
+
+    public void setAppIdSubDs(LinkedList appIdSubDs) {
+        this.appIdSubDs = appIdSubDs;
+    }
+
+    public LinkedList getAppIdSubDs() {
+        return this.appIdSubDs;
+    }
+
+    public void setAppIdSubEs(HashSet appIdSubEs) {
+        this.appIdSubEs = appIdSubEs;
+    }
+
+    public HashSet getAppIdSubEs() {
+        return this.appIdSubEs;
+    }
+
+    public void setAppIdSubFs(ArrayList appIdSubFs) {
+        this.appIdSubFs = appIdSubFs;
+    }
+
+    public ArrayList getAppIdSubFs() {
+        return this.appIdSubFs;
+    }
+
+    public void setAppIdSupers(Set appIdSupers) {
+        this.appIdSupers = appIdSupers;
+    }
+
+    public Set getAppIdSupers() {
+        return this.appIdSupers;
+    }
+}
+

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubA.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubA.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubA.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubA.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,84 @@
+/*
+ * 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.kernel.common.apps;
+
+import java.util.StringTokenizer;
+
+/**
+ * Abstract subclass that defines one more primary key field than its
+ * abstract superclass.
+ *
+ * @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
+ */
+public abstract class AppIdSubA
+    extends AppIdSuper {
+
+    private int pka;
+    private String stringFieldA;
+
+    public void setPka(int pka) {
+        this.pka = pka;
+    }
+
+    public int getPka() {
+        return this.pka;
+    }
+
+    public void setStringFieldA(String stringFieldA) {
+        this.stringFieldA = stringFieldA;
+    }
+
+    public String getStringFieldA() {
+        return this.stringFieldA;
+    }
+
+    public static abstract class ID
+        extends AppIdSuper.ID {
+
+        public int pka;
+
+        public ID() {
+            super();
+        }
+
+        public ID(String str) {
+            super();
+            fromString(str);
+        }
+
+        public int hashCode() {
+            return (super.hashCode() + pka) % Integer.MAX_VALUE;
+        }
+
+        public boolean equals(Object other) {
+            return super.equals(other)
+                && ((ID) other).pka == pka;
+        }
+
+        public String toString() {
+            return super.toString() + DELIMITER + pka;
+        }
+
+        StringTokenizer fromString(String idString) {
+            StringTokenizer tok = super.fromString(idString);
+            pka = new Integer(tok.nextToken()).intValue();
+            return tok; // return the tokenizer for subclasses to use
+        }
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubB.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubB.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubB.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubB.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,88 @@
+/*
+ * 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.kernel.common.apps;
+
+import java.util.StringTokenizer;
+import javax.persistence.Entity;
+
+/**
+ * Abstract subclass that defines one more primary key field than its
+ * abstract superclass.
+ *
+ * @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
+ */
+@Entity
+public abstract class AppIdSubB
+    extends AppIdSubA {
+
+    private String pkb;
+    private String stringFieldB;
+
+    public void setStringFieldB(String stringFieldB) {
+        this.stringFieldB = stringFieldB;
+    }
+
+    public String getStringFieldB() {
+        return this.stringFieldB;
+    }
+
+    public void setPkb(String pkb) {
+        this.pkb = pkb;
+    }
+
+    public String getPkb() {
+        return this.pkb;
+    }
+
+    public static abstract class ID
+        extends AppIdSubA.ID {
+
+        public String pkb;
+
+        public ID() {
+            super();
+        }
+
+        public ID(String str) {
+            super();
+            fromString(str);
+        }
+
+        public int hashCode() {
+            return (super.hashCode() + (pkb == null ? 0 : pkb.hashCode()))
+                % Integer.MAX_VALUE;
+        }
+
+        public boolean equals(Object other) {
+            return super.equals(other)
+                && ((ID) other).pkb == null ? pkb == null
+                : ((ID) other).pkb.equals(pkb);
+        }
+
+        public String toString() {
+            return super.toString() + DELIMITER + pkb;
+        }
+
+        StringTokenizer fromString(String idString) {
+            StringTokenizer tok = super.fromString(idString);
+            pkb = tok.nextToken();
+            return tok; // return the tokenizer for subclasses to use
+        }
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubC.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubC.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubC.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubC.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,113 @@
+/*
+ * 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.kernel.common.apps;
+
+import javax.persistence.Entity;
+
+/**
+ * Concrete subclass that defines two more primary key fields than its
+ * abstract superclass.
+ *
+ * @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
+ */
+@Entity
+public class AppIdSubC
+    extends AppIdSubB {
+
+    private long pk1c;
+    private String pk2c;
+    private String stringFieldC;
+
+    public void setPk1c(long pk1c) {
+        this.pk1c = pk1c;
+    }
+
+    public long getPk1c() {
+        return this.pk1c;
+    }
+
+    public void setPk2c(String pk2c) {
+        this.pk2c = pk2c;
+    }
+
+    public String getPk2c() {
+        return this.pk2c;
+    }
+
+    public void setStringFieldC(String stringFieldC) {
+        this.stringFieldC = stringFieldC;
+    }
+
+    public String getStringFieldC() {
+        return this.stringFieldC;
+    }
+
+    /*
+     public static class ID
+         extends AppIdSubB.ID
+     {
+         private long pk1c;
+         private String pk2c;
+
+
+         public ID ()
+         {
+             super ();
+         }
+
+
+         public ID (String str)
+         {
+             super ();
+             fromString (str);
+         }
+
+
+         public int hashCode ()
+         {
+             return (int)((super.hashCode () + pk1c
+                 + (pk2c == null ? 0 : pk2c.hashCode ())) % Integer.MAX_VALUE);
+         }
+
+
+         public boolean equals (Object other)
+         {
+             return super.equals (other)
+                 && ((ID)other).pk1c == pk1c
+                 && ((ID)other).pk2c == null ? pk2c == null
+                     : ((ID)other).pk2c.equals (pk2c);
+         }
+
+
+         public String toString ()
+         {
+             return super.toString () + DELIMITER + pk1c + DELIMITER + pk2c;
+         }
+
+
+         StringTokenizer fromString (String idString)
+         {
+             StringTokenizer tok = super.fromString (idString);
+             pk1c = new Long (tok.nextToken ()).longValue ();
+             pk2c = tok.nextToken ();
+             return tok; // return the tokenizer for subclasses to use
+         }
+     }
+     */
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubD.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubD.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubD.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubD.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,99 @@
+/*
+ * 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.kernel.common.apps;
+
+import javax.persistence.Entity;
+
+/**
+ * Concrete subclass that defines one more primary key field than its
+ * abstract superclass.
+ *
+ * @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
+ */
+@Entity
+public class AppIdSubD
+    extends AppIdSubB {
+
+    private double pkd;
+    private String stringFieldD;
+
+    public void setPkd(double pkd) {
+        this.pkd = pkd;
+    }
+
+    public double getPkd() {
+        return this.pkd;
+    }
+
+    public void setStringFieldD(String stringFieldD) {
+        this.stringFieldD = stringFieldD;
+    }
+
+    public String getStringFieldD() {
+        return this.stringFieldD;
+    }
+
+    /*
+     public static class ID
+         extends AppIdSubB.ID
+     {
+         private double pkd;
+
+
+         public ID ()
+         {
+             super ();
+         }
+
+
+         public ID (String str)
+         {
+             super ();
+             fromString (str);
+         }
+
+
+         public int hashCode ()
+         {
+             return (int)((super.hashCode () + pkd) % Integer.MAX_VALUE);
+         }
+
+
+         public boolean equals (Object other)
+         {
+             return super.equals (other)
+                 && ((ID)other).pkd == pkd;
+         }
+
+
+         public String toString ()
+         {
+             return super.toString () + DELIMITER + pkd;
+         }
+
+
+         StringTokenizer fromString (String idString)
+         {
+             StringTokenizer tok = super.fromString (idString);
+             pkd = new Double (tok.nextToken ()).doubleValue ();
+             return tok; // return the tokenizer for subclasses to use
+         }
+     }
+     */
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubE.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubE.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubE.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubE.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,60 @@
+/*
+ * 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.kernel.common.apps;
+
+import javax.persistence.Entity;
+
+/**
+ * Concrete subclass that does not define any more primary key fields
+ * than its concrete superclass.
+ *
+ * @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
+ */
+@Entity
+public class AppIdSubE
+    extends AppIdSubD {
+
+    private String stringFieldE;
+
+    public void setStringFieldE(String stringFieldE) {
+        this.stringFieldE = stringFieldE;
+    }
+
+    public String getStringFieldE() {
+        return this.stringFieldE;
+    }
+
+    /*
+     public static class ID
+         extends AppIdSubD.ID
+     {
+         public ID ()
+         {
+             super ();
+         }
+
+
+         public ID (String str)
+         {
+             super ();
+             fromString (str);
+         }
+     }
+     */
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubF.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubF.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubF.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSubF.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,60 @@
+/*
+ * 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.kernel.common.apps;
+
+import javax.persistence.Entity;
+
+/**
+ * Concrete subclass that does not define any more primary key fields
+ * than its abstract superclass.
+ *
+ * @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
+ */
+@Entity
+public class AppIdSubF
+    extends AppIdSubB {
+
+    private String stringFieldF;
+
+    public void setStringFieldF(String stringFieldF) {
+        this.stringFieldF = stringFieldF;
+    }
+
+    public String getStringFieldF() {
+        return this.stringFieldF;
+    }
+
+    /*
+     public static class ID
+         extends AppIdSubB.ID
+     {
+         public ID ()
+         {
+             super ();
+         }
+
+
+         public ID (String str)
+         {
+             super ();
+             fromString (str);
+         }
+     }
+     */
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSuper.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSuper.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSuper.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AppIdSuper.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,71 @@
+/*
+ * 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.kernel.common.apps;
+
+import java.io.Serializable;
+import java.util.StringTokenizer;
+
+/**
+ * Abstract superclass with no primary key fields defined.
+ *
+ * @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
+ */
+public abstract class AppIdSuper {
+
+    private String superField;
+
+    public void setSuperField(String superField) {
+        this.superField = superField;
+    }
+
+    public String getSuperField() {
+        return this.superField;
+    }
+
+    public static abstract class ID
+        implements Serializable {
+
+        static String DELIMITER = ":";
+
+        public ID() {
+        }
+
+        public ID(String str) {
+            fromString(str);
+        }
+
+        public int hashCode() {
+            // no key codes; all classes are equal
+            return 1;
+        }
+
+        public boolean equals(Object other) {
+            return other != null && other.getClass() == getClass();
+        }
+
+        public String toString() {
+            return "";
+        }
+
+        StringTokenizer fromString(String idString) {
+            return new StringTokenizer(idString, DELIMITER);
+        }
+    }
+}
+

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/ArraysTest.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/ArraysTest.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/ArraysTest.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/ArraysTest.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,277 @@
+/*
+ * 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.kernel.common.apps;
+
+import java.util.Date;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+import org.apache.openjpa.persistence.PersistentCollection;
+
+/**
+ * Used in testing; should be enhanced.
+ */
+@Entity
+public class ArraysTest
+    implements Comparable {
+
+    private static long counter = 0;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    private int id;
+
+    @PersistentCollection
+    private String[] aString;
+
+    @PersistentCollection
+    private Date[] aDate;
+
+    @PersistentCollection
+    private Integer[] aInt;
+
+    @PersistentCollection
+    private Long[] aLong;
+
+    @PersistentCollection
+
+    private Float[] aFloat;
+
+    private Byte[] aByte;
+
+    @PersistentCollection
+    private Double[] aDouble;
+
+    @PersistentCollection
+    private Boolean[] aBoolean;
+
+    @PersistentCollection
+    private Short[] aShort;
+
+    private Character[] aCharacter;
+
+    @PersistentCollection
+    private int[] aIntP;
+
+    @PersistentCollection
+    private long[] aLongP;
+
+    @PersistentCollection
+    private float[] aFloatP;
+
+    private byte[] aByteP;
+
+    @PersistentCollection
+    private double[] aDoubleP;
+
+    @PersistentCollection
+    private boolean[] aBooleanP;
+
+    @PersistentCollection
+    private short[] aShortP;
+
+    private char[] aCharacterP;
+
+    private char[] aCharacterPClob;
+
+    @PersistentCollection
+    private ArraysTest[] aArraysTest;
+
+    public ArraysTest() {
+    }
+
+    public boolean equals(Object other) {
+        return (other instanceof ArraysTest) && id == ((ArraysTest) other).id;
+    }
+
+    public int compareTo(Object other) {
+        ArraysTest t = (ArraysTest) other;
+        if (id < t.id)
+            return -1;
+        if (id == t.id)
+            return 0;
+        return 1;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public String[] getString() {
+        return aString;
+    }
+
+    public Date[] getDate() {
+        return aDate;
+    }
+
+    public Integer[] getInt() {
+        return aInt;
+    }
+
+    public Long[] getLong() {
+        return aLong;
+    }
+
+    public Float[] getFloat() {
+        return aFloat;
+    }
+
+    public Byte[] getByte() {
+        return aByte;
+    }
+
+    public Double[] getDouble() {
+        return aDouble;
+    }
+
+    public Boolean[] getBoolean() {
+        return aBoolean;
+    }
+
+    public Short[] getShort() {
+        return aShort;
+    }
+
+    public Character[] getCharacter() {
+        return aCharacter;
+    }
+
+    public int[] getIntP() {
+        return aIntP;
+    }
+
+    public long[] getLongP() {
+        return aLongP;
+    }
+
+    public float[] getFloatP() {
+        return aFloatP;
+    }
+
+    public byte[] getByteP() {
+        return aByteP;
+    }
+
+    public double[] getDoubleP() {
+        return aDoubleP;
+    }
+
+    public boolean[] getBooleanP() {
+        return aBooleanP;
+    }
+
+    public short[] getShortP() {
+        return aShortP;
+    }
+
+    public char[] getCharacterP() {
+        return aCharacterP;
+    }
+
+    public char[] getCharacterPClob() {
+        return aCharacterPClob;
+    }
+
+    public ArraysTest[] getArraysTest() {
+        return aArraysTest;
+    }
+
+    public void setString(String[] val) {
+        aString = val;
+    }
+
+    public void setDate(Date[] val) {
+        aDate = val;
+    }
+
+    public void setInt(Integer[] val) {
+        aInt = val;
+    }
+
+    public void setLong(Long[] val) {
+        aLong = val;
+    }
+
+    public void setFloat(Float[] val) {
+        aFloat = val;
+    }
+
+    public void setByte(Byte[] val) {
+        aByte = val;
+    }
+
+    public void setDouble(Double[] val) {
+        aDouble = val;
+    }
+
+    public void setBoolean(Boolean[] val) {
+        aBoolean = val;
+    }
+
+    public void setShort(Short[] val) {
+        aShort = val;
+    }
+
+    public void setCharacter(Character[] val) {
+        aCharacter = val;
+    }
+
+    public void setIntP(int[] val) {
+        aIntP = val;
+    }
+
+    public void setLongP(long[] val) {
+        aLongP = val;
+    }
+
+    public void setFloatP(float[] val) {
+        aFloatP = val;
+    }
+
+    public void setByteP(byte[] val) {
+        aByteP = val;
+    }
+
+    public void setDoubleP(double[] val) {
+        aDoubleP = val;
+    }
+
+    public void setBooleanP(boolean[] val) {
+        aBooleanP = val;
+    }
+
+    public void setShortP(short[] val) {
+        aShortP = val;
+    }
+
+    public void setCharacterP(char[] val) {
+        aCharacterP = val;
+    }
+
+    public void setCharacterPClob(char[] val) {
+        aCharacterPClob = val;
+    }
+
+    public void setArraysTest(ArraysTest[] val) {
+        aArraysTest = val;
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachA.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachA.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachA.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachA.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,115 @@
+/*
+ * 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.kernel.common.apps;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Version;
+
+import org.apache.openjpa.persistence.FetchAttribute;
+import org.apache.openjpa.persistence.FetchGroup;
+import org.apache.openjpa.persistence.FetchGroups;
+
+@Entity
+@DiscriminatorValue("ATTACH_A")
+@FetchGroups({
+@FetchGroup(name = "all", attributes = {
+@FetchAttribute(name = "stringArray", recursionDepth = 0),
+@FetchAttribute(name = "attachEArray", recursionDepth = 0)
+    })
+    })
+public class AttachA implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    @Column(name = "A_ID")
+    private int id;
+
+    @Version
+    private int version;
+
+    private String astr;
+    private int aint;
+    private double adbl;
+
+    private String[] stringArray = new String[0];
+    private AttachE[] attachEArray = new AttachE[0];
+
+    public int getId() {
+        return id;
+    }
+
+    public void setAstr(String astr) {
+        this.astr = astr;
+    }
+
+    public String getAstr() {
+        return this.astr;
+    }
+
+    public void setAint(int aint) {
+        this.aint = aint;
+    }
+
+    public int getAint() {
+        return this.aint;
+    }
+
+    public void setAdbl(double adbl) {
+        this.adbl = adbl;
+    }
+
+    public double getAdbl() {
+        return this.adbl;
+    }
+
+    public void setStringArray(String[] stringArray) {
+        this.stringArray = stringArray;
+    }
+
+    public String[] getStringArray() {
+        return this.stringArray;
+    }
+
+    public void setAttachEArray(AttachE[] attachEArray) {
+        this.attachEArray = attachEArray;
+    }
+
+    public AttachE[] getAttachEArray() {
+        return this.attachEArray;
+    }
+
+    private void writeObject(ObjectOutputStream out)
+        throws IOException {
+        out.defaultWriteObject();
+    }
+
+    private void readObject(ObjectInputStream in)
+        throws IOException, ClassNotFoundException {
+        in.defaultReadObject();
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachB.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachB.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachB.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachB.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,100 @@
+/*
+ * 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.kernel.common.apps;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import javax.persistence.CascadeType;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.ManyToMany;
+
+import org.apache.openjpa.persistence.jdbc.KeyColumn;
+import org.apache.openjpa.persistence.FetchAttribute;
+import org.apache.openjpa.persistence.FetchGroup;
+import org.apache.openjpa.persistence.FetchGroups;
+import org.apache.openjpa.persistence.PersistentMap;
+import org.apache.openjpa.persistence.jdbc.KeyColumn;
+
+@Entity
+@DiscriminatorValue("ATTACH_B")
+@FetchGroups({
+@FetchGroup(name = "all", attributes = {
+@FetchAttribute(name = "ds", recursionDepth = 0),
+@FetchAttribute(name = "stringIntMap", recursionDepth = 0)
+    })
+    })
+public class AttachB extends AttachA {
+
+    private String bstr;
+    private int bint;
+    private double bdbl;
+
+    @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+    private Set<AttachD> ds = new HashSet();
+
+    @PersistentMap
+    @KeyColumn(name = "strngmap")
+    private Map<String, Integer> stringIntMap = new TreeMap<String, Integer>();
+
+    public AttachB() {
+    }
+
+    public void setBstr(String bstr) {
+        this.bstr = bstr;
+    }
+
+    public String getBstr() {
+        return this.bstr;
+    }
+
+    public void setBint(int bint) {
+        this.bint = bint;
+    }
+
+    public int getBint() {
+        return this.bint;
+    }
+
+    public void setBdbl(double bdbl) {
+        this.bdbl = bdbl;
+    }
+
+    public double getBdbl() {
+        return this.bdbl;
+    }
+
+    public void setDs(Set ds) {
+        this.ds = ds;
+    }
+
+    public Set getDs() {
+        return this.ds;
+    }
+
+    public void setStringIntMap(Map stringIntMap) {
+        this.stringIntMap = stringIntMap;
+    }
+
+    public Map getStringIntMap() {
+        return this.stringIntMap;
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachC.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachC.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachC.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachC.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,80 @@
+/*
+ * 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.kernel.common.apps;
+
+import java.util.LinkedList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.ManyToMany;
+
+import org.apache.openjpa.persistence.FetchAttribute;
+import org.apache.openjpa.persistence.FetchGroup;
+import org.apache.openjpa.persistence.FetchGroups;
+
+@Entity
+@DiscriminatorValue("ATTACH_C")
+@FetchGroups({
+@FetchGroup(name = "all", attributes = {
+@FetchAttribute(name = "es", recursionDepth = 0)
+    })
+    })
+public class AttachC
+    extends AttachB {
+
+    private String cstr;
+    private int cint;
+    private double cdbl;
+
+    @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+    private List<AttachE> es = new LinkedList(); // non-DFG
+
+    public void setCstr(String cstr) {
+        this.cstr = cstr;
+    }
+
+    public String getCstr() {
+        return this.cstr;
+    }
+
+    public void setCint(int cint) {
+        this.cint = cint;
+    }
+
+    public int getCint() {
+        return this.cint;
+    }
+
+    public void setCdbl(double cdbl) {
+        this.cdbl = cdbl;
+    }
+
+    public double getCdbl() {
+        return this.cdbl;
+    }
+
+    public void setEs(List es) {
+        this.es = es;
+    }
+
+    public List getEs() {
+        return this.es;
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachD.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachD.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachD.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachD.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,174 @@
+/*
+ * 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.kernel.common.apps;
+
+import java.io.Serializable;
+import java.math.BigInteger;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Embedded;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+
+import org.apache.openjpa.persistence.jdbc.KeyColumn;
+import org.apache.openjpa.persistence.FetchAttribute;
+import org.apache.openjpa.persistence.FetchGroup;
+import org.apache.openjpa.persistence.FetchGroups;
+import org.apache.openjpa.persistence.PersistentMap;
+import org.apache.openjpa.persistence.jdbc.KeyColumn;
+
+@Entity
+@FetchGroups({
+@FetchGroup(name = "all", attributes = {
+@FetchAttribute(name = "bs", recursionDepth = 0),
+@FetchAttribute(name = "pcStringMap"),
+@FetchAttribute(name = "bigIntegerPCMap", recursionDepth = 0),
+@FetchAttribute(name = "embeddedE", recursionDepth = 0),
+@FetchAttribute(name = "embeddedA", recursionDepth = 0)
+
+    })
+    })
+public class AttachD implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    @Column(name = "D_ID")
+    private int id;
+
+    private Object version;
+
+    @Basic
+    private String dstr;
+    @Basic
+    private int dint;
+    @Basic
+    private double ddbl;
+
+    @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+    private AttachA a;
+
+    @ManyToMany(mappedBy = "ds",
+        cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+    private Set<AttachB> bs = new HashSet();
+
+    @PersistentMap(keyCascade = { CascadeType.PERSIST, CascadeType.MERGE })
+    @KeyColumn(name = "strngmap")
+    private Map<AttachA, String> pcStringMap = new HashMap();
+
+    @PersistentMap(elementCascade = { CascadeType.PERSIST, CascadeType.MERGE })
+    @KeyColumn(name = "intmap")
+    private TreeMap<BigInteger, AttachF> bigIntegerPCMap =
+        new TreeMap<BigInteger, AttachF>();
+
+    @Embedded
+    private AttachE embeddedE;
+
+    @Embedded
+    private AttachA embeddedA;
+
+    public int getId() {
+        return id;
+    }
+
+    public void setDstr(String dstr) {
+        this.dstr = dstr;
+    }
+
+    public String getDstr() {
+        return this.dstr;
+    }
+
+    public void setDint(int dint) {
+        this.dint = dint;
+    }
+
+    public int getDint() {
+        return this.dint;
+    }
+
+    public void setDdbl(double ddbl) {
+        this.ddbl = ddbl;
+    }
+
+    public double getDdbl() {
+        return this.ddbl;
+    }
+
+    public AttachA getA() {
+        return a;
+    }
+
+    public void setA(AttachA a) {
+        this.a = a;
+    }
+
+    public void setBs(Set bs) {
+        this.bs = bs;
+    }
+
+    public Set getBs() {
+        return this.bs;
+    }
+
+    public void setPcStringMap(Map pcStringMap) {
+        this.pcStringMap = pcStringMap;
+    }
+
+    public Map getPcStringMap() {
+        return this.pcStringMap;
+    }
+
+    public void setBigIntegerPCMap(TreeMap bigIntegerPCMap) {
+        this.bigIntegerPCMap = bigIntegerPCMap;
+    }
+
+    public TreeMap getBigIntegerPCMap() {
+        return this.bigIntegerPCMap;
+    }
+
+    public void setEmbeddedE(AttachE embeddedE) {
+        this.embeddedE = embeddedE;
+    }
+
+    public AttachE getEmbeddedE() {
+        return this.embeddedE;
+    }
+
+    public void setEmbeddedA(AttachA embeddedA) {
+        this.embeddedA = embeddedA;
+    }
+
+    public AttachA getEmbeddedA() {
+        return this.embeddedA;
+    }
+
+    public Object getVersion() {
+        return this.version;
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachE.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachE.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachE.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachE.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,127 @@
+/*
+ * 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.kernel.common.apps;
+
+import java.io.Serializable;
+import java.util.Date;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToOne;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.apache.openjpa.persistence.FetchAttribute;
+import org.apache.openjpa.persistence.FetchGroup;
+import org.apache.openjpa.persistence.FetchGroups;
+
+@Entity
+@DiscriminatorValue("ATTACH_E")
+@FetchGroups({
+@FetchGroup(name = "all", attributes = {
+@FetchAttribute(name = "b"),
+@FetchAttribute(name = "f")
+    })
+    })
+public class AttachE implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    @Column(name = "E_ID")
+    private int id;
+
+    private Object version;
+
+    @Basic
+    private String estr;
+
+    private int eint;
+
+    private double edbl;
+
+    @ManyToOne(fetch = FetchType.LAZY,
+        cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+    private AttachB b;
+
+    @OneToOne(fetch = FetchType.LAZY, mappedBy = "e",
+        cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+    private AttachF f;
+
+    @Temporal(TemporalType.DATE)
+    private Date dateField;
+
+    public int getId() {
+        return id;
+    }
+
+    public void setEstr(String estr) {
+        this.estr = estr;
+    }
+
+    public String getEstr() {
+        return this.estr;
+    }
+
+    public void setEint(int eint) {
+        this.eint = eint;
+    }
+
+    public int getEint() {
+        return this.eint;
+    }
+
+    public void setEdbl(double edbl) {
+        this.edbl = edbl;
+    }
+
+    public double getEdbl() {
+        return this.edbl;
+    }
+
+    public void setB(AttachB b) {
+        this.b = b;
+    }
+
+    public AttachB getB() {
+        return this.b;
+    }
+
+    public void setF(AttachF f) {
+        this.f = f;
+    }
+
+    public AttachF getF() {
+        return this.f;
+    }
+
+    public void setDateField(Date date) {
+        this.dateField = date;
+    }
+
+    public Date getDateField() {
+        return this.dateField;
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachF.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachF.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachF.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachF.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,166 @@
+/*
+ * 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.kernel.common.apps;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Embedded;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+
+import org.apache.openjpa.persistence.FetchAttribute;
+import org.apache.openjpa.persistence.FetchGroup;
+import org.apache.openjpa.persistence.FetchGroups;
+import org.apache.openjpa.persistence.PersistentCollection;
+
+@Entity
+@DiscriminatorValue("ATTACH_F")
+@IdClass(AttachF.ID.class)
+@FetchGroups({
+@FetchGroup(name = "all", attributes = {
+@FetchAttribute(name = "e", recursionDepth = 0),
+@FetchAttribute(name = "strings"),
+@FetchAttribute(name = "embeddedC", recursionDepth = 0)
+    })
+    })
+public class AttachF implements Serializable {
+
+    @Id
+    private int id1;
+
+    @Id
+    private String id2;
+
+    private String fstr;
+    private int fint;
+    private double fdbl;
+
+    @ManyToOne
+    @JoinColumn(name = "ATT_E")
+    private AttachE e;
+
+    @PersistentCollection
+    private List<String> strings = new ArrayList();
+
+    @Embedded
+    private AttachC embeddedC;
+
+    public void setFstr(String fstr) {
+        this.fstr = fstr;
+    }
+
+    public String getFstr() {
+        return this.fstr;
+    }
+
+    public void setFint(int fint) {
+        this.fint = fint;
+    }
+
+    public int getFint() {
+        return this.fint;
+    }
+
+    public void setFdbl(double fdbl) {
+        this.fdbl = fdbl;
+    }
+
+    public double getFdbl() {
+        return this.fdbl;
+    }
+
+    public void setE(AttachE e) {
+        this.e = e;
+    }
+
+    public AttachE getE() {
+        return this.e;
+    }
+
+    public void setStrings(List strings) {
+        this.strings = strings;
+    }
+
+    public List getStrings() {
+        return this.strings;
+    }
+
+    public static class ID {
+
+        public int id1;
+        public String id2;
+
+        public ID() {
+        }
+
+        public ID(String str) {
+            StringTokenizer tok = new StringTokenizer(str, ":");
+            id1 = Integer.parseInt(tok.nextToken());
+            id2 = tok.nextToken();
+        }
+
+        @Override
+        public int hashCode() {
+            return id1 + (id2 == null ? 0 : id2.hashCode());
+        }
+
+        public String toString() {
+            return id1 + ":" + id2;
+        }
+
+        @Override
+        public boolean equals(Object other) {
+            return other instanceof ID
+                && ((ID) other).id1 == id1
+                && (id2 == null ? ((ID) other).id2 == null
+                : id2.equals(((ID) other).id2));
+        }
+    }
+
+    public void setId1(int id1) {
+        this.id1 = id1;
+    }
+
+    public int getId1() {
+        return this.id1;
+    }
+
+    public void setId2(String id2) {
+        this.id2 = id2;
+    }
+
+    public String getId2() {
+        return this.id2;
+    }
+
+    public void setEmbeddedC(AttachC embeddedC) {
+        this.embeddedC = embeddedC;
+    }
+
+    public AttachC getEmbeddedC() {
+        return this.embeddedC;
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachVersionA.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachVersionA.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachVersionA.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachVersionA.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,115 @@
+/*
+ * 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.kernel.common.apps;
+
+import java.util.Set;
+import javax.persistence.Entity;
+
+@Entity
+public class AttachVersionA {
+
+    private int pk;
+    private int version;
+    private String stringField;
+    private String fetchA;
+    private String fetchB;
+    private AttachVersionA pc;
+    private AttachVersionC embedded;
+    private Set many;
+
+    public AttachVersionA() {
+    }
+
+    public AttachVersionA(int pk) {
+        this.pk = pk;
+    }
+
+    public AttachVersionA(int pk, String s) {
+        this.pk = pk;
+        stringField = s;
+    }
+
+    public void setPk(int pk) {
+        this.pk = pk;
+    }
+
+    public int getPk() {
+        return pk;
+    }
+
+    public void setVersion(int v) {
+        version = v;
+    }
+
+    public int getVersion() {
+        return version;
+    }
+
+    public Object getVersionObject() {
+        return new Integer(version);
+    }
+
+    public String getStringField() {
+        return stringField;
+    }
+
+    public void setStringField(String s) {
+        stringField = s;
+    }
+
+    public void setFetchA(String fetchA) {
+        this.fetchA = fetchA;
+    }
+
+    public String getFetchA() {
+        return fetchA;
+    }
+
+    public void setFetchB(String fetchB) {
+        this.fetchB = fetchB;
+    }
+
+    public String getFetchB() {
+        return fetchB;
+    }
+
+    public void setPC(AttachVersionA pc) {
+        this.pc = pc;
+    }
+
+    public AttachVersionA getPC() {
+        return pc;
+    }
+
+    public void setMany(Set many) {
+        this.many = many;
+    }
+
+    public Set getMany() {
+        return many;
+    }
+
+    public void setEmbedded(AttachVersionC embedded) {
+        this.embedded = embedded;
+    }
+
+    public AttachVersionC getEmbedded() {
+        return embedded;
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachVersionB.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachVersionB.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachVersionB.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachVersionB.java Fri Feb 15 01:19:55 2008
@@ -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.kernel.common.apps;
+
+import javax.persistence.Entity;
+
+@Entity
+public class AttachVersionB
+    extends AttachVersionA {
+
+    private String stringField2;
+
+    public AttachVersionB() {
+    }
+
+    public AttachVersionB(int pk) {
+        super(pk);
+    }
+
+    public AttachVersionB(int pk, String s, String s2) {
+        super(pk, s);
+        stringField2 = s2;
+    }
+
+    public String getStringField2() {
+        return stringField2;
+    }
+
+    public void setStringField2(String s) {
+        stringField2 = s;
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachVersionC.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachVersionC.java?rev=627979&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachVersionC.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/AttachVersionC.java Fri Feb 15 01:19:55 2008
@@ -0,0 +1,44 @@
+/*
+ * 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.kernel.common.apps;
+
+import javax.persistence.Entity;
+
+@Entity
+public class AttachVersionC {
+
+    private int intField;
+    private AttachVersionA pc;
+
+    public void setIntField(int intField) {
+        this.intField = intField;
+    }
+
+    public int getIntField() {
+        return intField;
+    }
+
+    public void setPc(AttachVersionA pc) {
+        this.pc = pc;
+    }
+
+    public AttachVersionA getPc() {
+        return pc;
+    }
+}



Mime
View raw message