You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by jr...@apache.org on 2009/05/11 23:59:21 UTC

svn commit: r773704 [3/4] - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ openjpa-kernel/src/main/java/org/apache/openjpa/meta/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/ openjpa-persiste...

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/TestXMLExplicitAccess.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/TestXMLExplicitAccess.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/TestXMLExplicitAccess.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/TestXMLExplicitAccess.java Mon May 11 21:59:15 2009
@@ -0,0 +1,789 @@
+/*
+ * 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.access.xml;
+
+import java.util.Date;
+
+import javax.persistence.Query;
+
+import org.apache.openjpa.persistence.ArgumentException;
+import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
+import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
+import org.apache.openjpa.persistence.OpenJPAPersistence;
+import org.apache.openjpa.persistence.access.EmbedMixedAccess;
+import org.apache.openjpa.persistence.access.PropMixedEntity;
+import org.apache.openjpa.persistence.test.AllowFailure;
+import org.apache.openjpa.persistence.test.PersistenceTestCase;
+
+public class TestXMLExplicitAccess extends PersistenceTestCase {
+    
+    private OpenJPAEntityManagerFactorySPI emf = null;
+    
+    public void setUp() throws Exception {
+        super.setUp();
+        emf = (OpenJPAEntityManagerFactorySPI)OpenJPAPersistence.
+            createEntityManagerFactory("Access-1",
+            "org/apache/openjpa/persistence/access/" +
+            "access-persistence.xml");
+    }
+    
+    public void tearDown() throws Exception {
+        super.tearDown();
+        if (emf != null) {
+            clear(emf);
+            emf.close();
+        }
+    }
+    /**
+     * Validates the use of field level access on an
+     * entity, mappedsuperclass, and embeddable at the
+     * class level.
+     */
+    public void testClassSpecifiedFieldAccess() {
+
+        OpenJPAEntityManagerSPI em = emf.createEntityManager();
+        
+        XMLFieldAccess fa = new XMLFieldAccess();
+        // Set the persistent field through a misnamed setter         
+        fa.setStringField("XMLFieldAccess");
+        
+        em.getTransaction().begin();
+        em.persist(fa);
+        em.getTransaction().commit();
+        em.clear();
+        
+        // This value of a persistent field was set using the setter
+        // above, but this query will use the field name to verify that
+        // field access is in use.
+        Query qry = em.createNamedQuery("XMLFieldAccess.query");
+        qry.setParameter("id", fa.getId());
+        qry.setParameter("strVal", "XMLFieldAccess");
+        XMLFieldAccess fa2 = (XMLFieldAccess)qry.getSingleResult();
+        assertEquals(fa.getId(), fa2.getId());
+        
+        em.close();
+    }
+
+    /**
+     * Validates the use of property level access on an
+     * entity, mappedsuperclass, and embeddable at the
+     * class level.
+     */
+    public void testClassSpecifiedPropertyAccess() {
+
+        OpenJPAEntityManagerSPI em = emf.createEntityManager();
+        
+        XMLPropAccess pa = new XMLPropAccess();
+        // Set the persistent field through a misnamed setter         
+        pa.setStrProp("PropertyAccess");
+        
+        em.getTransaction().begin();
+        em.persist(pa);
+        em.getTransaction().commit();
+        em.clear();
+        
+        // This value of a persistent field was set using the setter
+        // above, but this query will use the field name to verify that
+        // field access is in use.
+        Query qry = em.createNamedQuery("XMLPropAccess.query");
+        qry.setParameter("id", pa.getId());
+        qry.setParameter("strVal", "PropertyAccess");
+        XMLPropAccess pa2 = (XMLPropAccess)qry.getSingleResult();
+        assertEquals(pa, pa2);
+        
+        em.close();
+    }
+    
+    /**
+     * Validates the use of explicit field access on an entity, 
+     * mappedsuperclass, and embeddable with property access
+     * defined at the class level and field access defined
+     * on specific methods. 
+     */    
+    
+    public void testClassSpecifiedMixedSinglePCFieldAccess() {
+
+        OpenJPAEntityManagerSPI em = emf.createEntityManager();
+        
+        XMLDefFieldMixedPropAccess dfmpa = new XMLDefFieldMixedPropAccess();
+        // Call non-PC setter
+        dfmpa.setStrField("NonPCSetter");
+        // Call setter with property access
+        dfmpa.setStringField("XMLDFMPA");
+        
+        em.getTransaction().begin();
+        em.persist(dfmpa);
+        em.getTransaction().commit();
+        em.clear();
+        
+        // This value of a persistent property was set using the setter
+        // above, but this query will use the property name to verify that
+        // propety access is in use.
+        Query qry = em.createNamedQuery("XMLDFMPA.query");
+        qry.setParameter("id", dfmpa.getId());
+        qry.setParameter("strVal", "XMLDFMPA");
+        XMLDefFieldMixedPropAccess dfmpa2 = 
+            (XMLDefFieldMixedPropAccess)qry.getSingleResult();
+        assertEquals(dfmpa, dfmpa2);
+        assertEquals(dfmpa2.getStringField(), "XMLDFMPA");
+
+        try {
+            qry = em.createNamedQuery("XMLDFMPA.badQuery");
+            qry.setParameter("id", dfmpa.getId());
+            qry.setParameter("strVal", "XMLDFMPA");
+            qry.getSingleResult();
+            fail("Execution of this query should have thrown an exception");
+        }
+        catch (Exception e) {
+            assertExceptionMessage(e, ArgumentException.class,
+                "No field named \"strField\" in \"XMLDefFieldMixedPropAccess\"",
+                "[id, stringField, version]");
+        }
+
+        em.close();                
+    }
+    
+    /**
+     * Validates the use of explicit property access on an entity, 
+     * mappedsuperclass, and embeddable with field access
+     * defined at the class level and property access defined
+     * on specific methods. 
+     */
+    public void testClassSpecifiedMixedSinglePCPropertyAccess() {
+        
+        OpenJPAEntityManagerSPI em = emf.createEntityManager();
+        
+        XMLDefPropMixedFieldAccess dpmfa = new XMLDefPropMixedFieldAccess();
+        // Call setter with underlying field access
+        dpmfa.setStrProp("XMLDPMFA");
+        
+        em.getTransaction().begin();
+        em.persist(dpmfa);
+        em.getTransaction().commit();
+        em.clear();
+        
+        // This value of a persistent field was set using the setter
+        // above, but this query will use the property name to verify that
+        // propety access is in use.
+        Query qry = em.createNamedQuery("XMLDPMFA.query");
+        qry.setParameter("id", dpmfa.getId());
+        qry.setParameter("strVal", "XMLDPMFA");
+        XMLDefPropMixedFieldAccess dpmfa2 = 
+            (XMLDefPropMixedFieldAccess)qry.getSingleResult();
+        assertEquals(dpmfa, dpmfa2);
+        assertEquals(dpmfa2.getStrProp(), "XMLDPMFA");
+
+        try {
+            qry = em.createNamedQuery("XMLDPMFA.badQuery");
+            qry.setParameter("id", dpmfa.getId());
+            qry.setParameter("strVal", "XMLDPMFA");
+            qry.getSingleResult();
+            fail("Usage of this query should have thrown an exception");
+        }
+        catch (Exception e) {
+            assertExceptionMessage(e, ArgumentException.class,
+                "No field named \"strProp\" in \"XMLDefPropMixedFieldAccess\"",
+                "[id, strField, version]");
+        }
+
+        em.close();
+    }
+    
+    /**
+     * Validates that a mapped superclass using field access and an entity
+     * subclass using property access get mapped properly.
+     */
+    public void testAbstractMappedSuperField() {
+        OpenJPAEntityManagerFactorySPI emf = 
+            (OpenJPAEntityManagerFactorySPI)OpenJPAPersistence.
+            createEntityManagerFactory("Access-1",
+            "org/apache/openjpa/persistence/access/" +
+            "access-persistence.xml");
+
+        OpenJPAEntityManagerSPI em = emf.createEntityManager();
+
+        XMLPropertySub ps = new XMLPropertySub();
+        // Call super setter with underlying field access
+        ps.setName("AbsMappedSuperName");
+        // Call base setter with property access
+        Date now = new Date();
+        ps.setCreateDate(now);
+        
+        em.getTransaction().begin();
+        em.persist(ps);
+        em.getTransaction().commit();
+        em.clear();
+        
+        // This value of a persistent field was set using the setter
+        // above, but this query will use the property name to verify that
+        // propety access is in use.
+        Query qry = em.createNamedQuery("XMLPropertySub.query");
+        qry.setParameter("id", ps.getId());
+        qry.setParameter("name", "AbsMappedSuperName");
+        qry.setParameter("crtDate", now);
+        XMLPropertySub ps2 = 
+            (XMLPropertySub)qry.getSingleResult();
+        assertEquals(ps, ps2);
+        assertEquals(ps2.getName(), "AbsMappedSuperName");
+        assertEquals(ps2.getCreateDate(), now);
+
+        try {
+            qry = em.createNamedQuery("XMLPropertySub.badQuery");
+            qry.setParameter("id", ps.getId());
+            qry.setParameter("name", "AbsMappedSuperName");
+            qry.setParameter("crtDate", now);
+            qry.getSingleResult();
+            fail("Usage of this query should have thrown an exception");
+        }
+        catch (Exception e) {
+            assertExceptionMessage(e, ArgumentException.class,
+                "No field named \"crtDate\" in \"XMLPropertySub\"",
+                "[createDate, id, name]");
+        }
+
+        em.close();
+    }
+
+    /**
+     * Validates that a mapped superclass using property access and an entity
+     * subclass using field access get mapped properly.
+     */
+    public void testAbstractMappedSuperProperty() {
+
+        OpenJPAEntityManagerFactorySPI emf = 
+            (OpenJPAEntityManagerFactorySPI)OpenJPAPersistence.
+            createEntityManagerFactory("Access-1",
+            "org/apache/openjpa/persistence/access/" +
+            "access-persistence.xml");
+
+        OpenJPAEntityManagerSPI em = emf.createEntityManager();
+        
+        XMLFieldSub fs = new XMLFieldSub();
+        // Call super setter with underlying field access
+        fs.setName("AbsMappedSuperName");
+        // Call base setter with property access
+        Date now = new Date();
+        fs.setCreateDate(now);
+        
+        em.getTransaction().begin();
+        em.persist(fs);
+        em.getTransaction().commit();
+        em.clear();
+        
+        // This value of a persistent field was set using the setter
+        // above, but this query will use the property name to verify that
+        // propety access is in use.
+        Query qry = em.createNamedQuery("XMLFieldSub.query");
+        qry.setParameter("id", fs.getId());
+        qry.setParameter("name", "AbsMappedSuperName");
+        qry.setParameter("crtDate", now);
+        XMLFieldSub fs2 = 
+            (XMLFieldSub)qry.getSingleResult();
+        assertEquals(fs, fs2);
+        assertEquals(fs2.getName(), "AbsMappedSuperName");
+        assertEquals(fs2.getCreateDate(), now);
+
+        try {
+            qry = em.createNamedQuery("XMLFieldSub.badQuery");
+            qry.setParameter("id", fs.getId());
+            qry.setParameter("name", "AbsMappedSuperName");
+            qry.setParameter("crtDate", now);
+            qry.getSingleResult();
+            fail("Usage of this query should have thrown an exception");
+        }
+        catch (Exception e) {
+            assertExceptionMessage(e, ArgumentException.class,
+                "No field named \"createDate\" in \"XMLFieldSub\"",
+                "[crtDate, id, name]");
+        }
+
+        em.close();
+    }
+
+    /**
+     * Validates that an mapped superclass using field access and an 
+     * entity subclass using property access get mapped properly.
+     * The subclass uses a storage field in the superclass. 
+     */
+    public void testMappedSuperField() {
+        
+        OpenJPAEntityManagerFactorySPI emf = 
+            (OpenJPAEntityManagerFactorySPI)OpenJPAPersistence.
+            createEntityManagerFactory("Access-1",
+            "org/apache/openjpa/persistence/access/" +
+            "access-persistence.xml");
+
+        OpenJPAEntityManagerSPI em = emf.createEntityManager();
+        
+        XMLPropertySub2 ps = new XMLPropertySub2();
+        // Call super setter with underlying field access
+        ps.setName("MappedSuperName");
+        // Call base setter with property access
+        Date now = new Date();
+        ps.setCreateDate(now);
+        
+        em.getTransaction().begin();
+        em.persist(ps);
+        em.getTransaction().commit();
+        em.clear();
+        
+        // This value of a persistent field was set using the setter
+        // above, but this query will use the property name to verify that
+        // propety access is in use.
+        Query qry = em.createNamedQuery("XMLPropertySub2.query");
+        qry.setParameter("id", ps.getId());
+        qry.setParameter("name", "MappedSuperName");
+        qry.setParameter("crtDate", now);
+        XMLPropertySub2 ps2 = 
+            (XMLPropertySub2)qry.getSingleResult();
+        assertEquals(ps, ps2);
+        assertEquals(ps2.getName(), "MappedSuperName");
+        assertEquals(ps2.getCreateDate(), now);
+
+        try {
+            qry = em.createNamedQuery("XMLPropertySub2.badQuery");
+            qry.setParameter("id", ps.getId());
+            qry.setParameter("name", "MappedSuperName");
+            qry.setParameter("crtDate", now);
+            qry.getSingleResult();
+            fail("Usage of this query should have thrown an exception");
+        }
+        catch (Exception e) {
+            assertExceptionMessage(e, ArgumentException.class,
+                    "No field named \"crtDate\" in \"XMLPropertySub2\"",
+                    "[createDate, id, name]");
+        }
+
+        em.close();        
+    }
+
+    /**
+     * Validates that an mapped superclass using field access and an 
+     * entity subclass using property access get mapped properly.
+     * The subclass uses a storage field in the superclass. 
+     */
+    public void testMappedSuperProperty() {
+        
+        OpenJPAEntityManagerSPI em = emf.createEntityManager();
+        
+        XMLFieldSub2 fs = new XMLFieldSub2();
+        // Call super setter with underlying field access
+        fs.setName("MappedSuperName");
+        // Call base setter with property access
+        Date now = new Date();
+        fs.setCreateDate(now);
+        
+        em.getTransaction().begin();
+        em.persist(fs);
+        em.getTransaction().commit();
+        em.clear();
+        
+        // This value of a persistent field was set using the setter
+        // above, but this query will use the property name to verify that
+        // propety access is in use.
+        Query qry = em.createNamedQuery("XMLFieldSub2.query");
+        qry.setParameter("id", fs.getId());
+        qry.setParameter("name", "MappedSuperName");
+        qry.setParameter("crtDate", now);
+        XMLFieldSub2 fs2 = 
+            (XMLFieldSub2)qry.getSingleResult();
+        assertEquals(fs, fs2);
+        assertEquals(fs2.getName(), "MappedSuperName");
+        assertEquals(fs2.getCreateDate(), now);
+
+        try {
+            qry = em.createNamedQuery("XMLFieldSub2.badQuery");
+            qry.setParameter("id", fs.getId());
+            qry.setParameter("name", "MappedSuperName");
+            qry.setParameter("crtDate", now);
+            qry.getSingleResult();
+            fail("Usage of this query should have thrown an exception");
+        }
+        catch (Exception e) {
+            assertExceptionMessage(e, ArgumentException.class,
+                    "No field named \"createDate\" in \"XMLFieldSub2\"",
+                    "[crtDate, id, name]");
+        }
+
+        em.close();        
+    }
+
+    /**
+     * Validates that a mix of access types can be used within multiple 
+     * persistent classes within an inheritance hierarchy that uses 
+     * MappedSuperclass.
+     */
+    public void testMixedMappedSuper() {
+        OpenJPAEntityManagerSPI em = emf.createEntityManager();
+        
+        XMLMixedFieldSub fs = new XMLMixedFieldSub();
+        // Call super setter with underlying field access
+        fs.setName("XMLMixedMappedSuperName");
+        fs.setMyFieldProp("MyFieldName");
+        // Call base setter with property access
+        Date now = new Date();
+        fs.setCreateDate(now);
+        
+        em.getTransaction().begin();
+        em.persist(fs);
+        em.getTransaction().commit();
+        em.clear();
+        
+        // This value of a persistent field was set using the setter
+        // above, but this query will use the property name to verify that
+        // propety access is in use.
+        Query qry = em.createNamedQuery("XMLMixedFieldSub.query");
+        qry.setParameter("id", fs.getId());
+        qry.setParameter("name", "XMLMixedMappedSuperName");
+        qry.setParameter("crtDate", now);
+        qry.setParameter("myField", "MyFieldName");
+        XMLMixedFieldSub fs2 = 
+            (XMLMixedFieldSub)qry.getSingleResult();
+        assertEquals(fs, fs2);
+        assertEquals(fs2.getName(), "XMLMixedMappedSuperName");
+        assertEquals(fs2.getCreateDate(), now);
+
+        try {
+            qry = em.createNamedQuery("XMLMixedFieldSub.badQuery");
+            qry.setParameter("id", fs.getId());
+            qry.setParameter("name", "XMLMixedMappedSuperName");
+            qry.setParameter("myField", "MyFieldName");
+            qry.getSingleResult();
+            fail("Usage of this query should have thrown an exception");
+        }
+        catch (Exception e) {
+            assertExceptionMessage(e, ArgumentException.class,
+                    "No field named \"myFieldProp\" in \"XMLMixedFieldSub\"",
+                    "[createDate, mid, myField, name]");
+        }
+
+        em.close();        
+        
+    }
+
+    /**
+     * Validates that a mix of access types can be used within
+     * an inheritance hierarchy which uses default Entity inheritance.
+     * NOTE: be sure to test with all forms of inheritance.
+     */
+    public void testEntityFieldDefaultInheritance() {
+        OpenJPAEntityManagerSPI em = emf.createEntityManager();
+        
+        XMLFieldSub3 fs = new XMLFieldSub3();
+        // Call super setter with underlying field access
+        fs.setName("EntitySuperName");
+        // Call base setter with property access
+        Date now = new Date();
+        fs.setCreateDate(now);
+
+        XMLSuperPropertyEntity spe = new XMLSuperPropertyEntity();
+        spe.setName("SuperPropertyEntity");
+        
+        em.getTransaction().begin();
+        em.persist(fs);
+        em.persist(spe);
+        em.getTransaction().commit();
+        em.clear();
+        
+        // This value of a persistent field was set using the setter
+        // above, but this query will use the property name to verify that
+        // propety access is in use.
+        Query qry = em.createNamedQuery("XMLFieldSub3.query");
+        qry.setParameter("id", fs.getId());
+        qry.setParameter("name", "EntitySuperName");
+        qry.setParameter("crtDate", now);
+        XMLFieldSub3 fs2 = 
+            (XMLFieldSub3)qry.getSingleResult();
+        assertEquals(fs, fs2);
+        assertEquals(fs2.getName(), "EntitySuperName");
+        assertEquals(fs2.getCreateDate(), now);
+
+        try {
+            qry = em.createNamedQuery("XMLFieldSub3.badQuery");
+            qry.setParameter("id", fs.getId());
+            qry.setParameter("name", "EntitySuperName");
+            qry.setParameter("crtDate", now);
+            qry.getSingleResult();
+            fail("Usage of this query should have thrown an exception");
+        }
+        catch (Exception e) {
+            assertExceptionMessage(e, ArgumentException.class,
+                    "No field named \"createDate\" in \"XMLFieldSub3\"",
+                    "[crtDate, id, name]");
+        }
+
+        qry = em.createNamedQuery("XMLSuperPropertyEntity.query");
+        qry.setParameter("id", spe.getId());
+        qry.setParameter("name", "SuperPropertyEntity");
+        XMLSuperPropertyEntity spe2 = 
+            (XMLSuperPropertyEntity)qry.getSingleResult();
+        assertEquals(spe, spe2);
+        assertEquals(spe2.getName(), "SuperPropertyEntity");
+
+        try {
+            // This query ensures that a subclass property didn't somehow get
+            // picked up by the superclass while building field metadata using
+            // explicit access.
+            qry = em.createNamedQuery("XMLSuperPropertyEntity.badQuery");
+            qry.setParameter("id", spe.getId());
+            qry.setParameter("name", "SuperPropertyEntity");
+            qry.setParameter("crtDate", now);
+            qry.getSingleResult();
+            fail("Usage of this query should have thrown an exception");
+        }
+        catch (Exception e) {
+            assertExceptionMessage(e, ArgumentException.class,
+                    "No field named \"crtDate\" in \"XMLSuperPropertyEntity\"",
+                    "[id, name]");
+        }        
+        
+        em.close();        
+    }
+
+    /**
+     * Validates that a mix of access types can be used within
+     * an inheritance hierarchy which uses default Entity inheritance.
+     * NOTE: be sure to test with all forms of inheritance.
+     */
+    public void testEntityPropertyDefaultInheritance() {
+        OpenJPAEntityManagerSPI em = emf.createEntityManager();
+        
+        XMLPropertySub3 ps = new XMLPropertySub3();
+        // Call super setter with underlying field access
+        ps.setName("EntitySuperName");
+        // Call base setter with property access
+        Date now = new Date();
+        ps.setCreateDate(now);
+
+        XMLSuperFieldEntity sfe = new XMLSuperFieldEntity();
+        sfe.setName("SuperFieldEntity");
+        
+        em.getTransaction().begin();
+        em.persist(ps);
+        em.persist(sfe);
+        em.getTransaction().commit();
+        em.clear();
+        
+        // This value of a persistent field was set using the setter
+        // above, but this query will use the property name to verify that
+        // propety access is in use.
+        Query qry = em.createNamedQuery("XMLPropertySub3.query");
+        qry.setParameter("id", ps.getId());
+        qry.setParameter("name", "EntitySuperName");
+        qry.setParameter("crtDate", now);
+        XMLPropertySub3 ps2 = 
+            (XMLPropertySub3)qry.getSingleResult();
+        assertEquals(ps, ps2);
+        assertEquals(ps2.getName(), "EntitySuperName");
+        assertEquals(ps2.getCreateDate(), now);
+
+        try {
+            qry = em.createNamedQuery("XMLPropertySub3.badQuery");
+            qry.setParameter("id", ps.getId());
+            qry.setParameter("name", "EntitySuperName");
+            qry.setParameter("crtDate", now);
+            qry.getSingleResult();
+            fail("Usage of this query should have thrown an exception");
+        }
+        catch (Exception e) {
+            assertExceptionMessage(e, ArgumentException.class,
+                    "No field named \"crtDate\" in \"XMLPropertySub3\"",
+                    "[createDate, id, name]");
+        }
+
+        qry = em.createNamedQuery("XMLSuperFieldEntity.query");
+        qry.setParameter("id", sfe.getId());
+        qry.setParameter("name", "SuperFieldEntity");
+        XMLSuperFieldEntity sfe2 = 
+            (XMLSuperFieldEntity)qry.getSingleResult();
+        assertEquals(sfe2, sfe2);
+        assertEquals(sfe2.getName(), "SuperFieldEntity");
+
+        try {
+            // This query ensures that a subclass property didn't somehow get
+            // picked up by the superclass while building field metadata using
+            // explicit access.
+            qry = em.createNamedQuery("XMLSuperFieldEntity.badQuery");
+            qry.setParameter("id", sfe.getId());
+            qry.setParameter("name", "SuperFieldEntity");
+            qry.setParameter("crtDate", now);
+            qry.getSingleResult();
+            fail("Usage of this query should have thrown an exception");
+        }
+        catch (Exception e) {
+            assertExceptionMessage(e, ArgumentException.class,
+                    "No field named \"crtDate\" in \"XMLSuperFieldEntity\"",
+                    "[id, name]");
+        }        
+        em.close();        
+    }
+
+    /**
+     * Validates an embeddable with field access can be used within an
+     * entity with property access
+     */
+    @AllowFailure(value=true, 
+        message="Support for explicit Access on embeddables is not complete.")
+    public void testEmbeddablesField() {
+        OpenJPAEntityManagerSPI em = emf.createEntityManager();
+        
+        XMLEmbedFieldAccess efa = new XMLEmbedFieldAccess();
+        efa.setFirstName("J");
+        efa.setLastName("Tolkien");
+        
+        XMLPropEmbedEntity pe = new XMLPropEmbedEntity();
+        pe.setName("PropEmbedEntity");
+        pe.setEmbedProp(efa);
+        
+        em.getTransaction().begin();
+        em.persist(pe);
+        em.getTransaction().commit();
+        
+        em.clear();
+        
+        Query qry = em.createNamedQuery("XMLPropEmbedEntity.query");
+        qry.setParameter("id", pe.getId());
+        qry.setParameter("name", "PropEmbedEntity");
+        qry.setParameter("firstName", "J");
+        qry.setParameter("lastName", "Tolkien");
+        XMLPropEmbedEntity pe2 = (XMLPropEmbedEntity)qry.getSingleResult();
+        assertEquals(pe, pe2);
+        assertEquals(efa, pe2.getEmbedProp());
+
+        try {
+            qry = em.createNamedQuery("XMLPropEmbedEntity.badQuery");
+            qry.setParameter("id", pe.getId());
+            qry.setParameter("name", "PropEmbedEntity");
+            qry.setParameter("firstName", "J");
+            qry.setParameter("lastName", "Tolkien");
+            qry.getSingleResult();
+            fail("Query execution should have failed.");
+        } catch (Exception e) {
+            assertExceptionMessage(e, ArgumentException.class,
+                    "No field named \"firstName\" in \"XMLEmbedFieldAccess\"",
+                    "[fName, lName]");
+        }
+
+        em.close();
+    }
+
+    /**
+     * Validates an embeddable with property access can be used within an
+     * entity with field access
+     */
+    @AllowFailure(value=true, 
+        message="Support for explicit Access on embeddables is not complete.")
+    public void testEmbeddablesProperty() {
+        OpenJPAEntityManagerSPI em = emf.createEntityManager();
+        
+        XMLEmbedPropAccess epa = new XMLEmbedPropAccess();
+        epa.setFirstName("Walt");
+        epa.setLastName("Whitman");
+        
+        XMLFieldEmbedEntity fe = new XMLFieldEmbedEntity();
+        fe.setName("FieldEmbedEntity");
+        fe.setEPA(epa);
+        
+        em.getTransaction().begin();
+        em.persist(fe);
+        em.getTransaction().commit();
+        
+        em.clear();
+        
+        Query qry = em.createNamedQuery("XMLFieldEmbedEntity.query");
+        qry.setParameter("id", fe.getId());
+        qry.setParameter("name", "FieldEmbedEntity");
+        qry.setParameter("firstName", "Walt");
+        qry.setParameter("lastName", "Whitman");
+        XMLFieldEmbedEntity fe2 = (XMLFieldEmbedEntity)qry.getSingleResult();
+        fe2.getEPA().getFirstName();
+        fe2.getEPA().getLastName();
+        assertEquals(fe, fe2);
+        assertEquals(epa, fe2.getEPA());
+
+        try {
+            qry = em.createNamedQuery("XMLFieldEmbedEntity.badQuery");
+            qry.setParameter("id", fe.getId());
+            qry.setParameter("name", "FieldEmbedEntity");
+            qry.setParameter("firstName", "Walt");
+            qry.setParameter("lastName", "Whitman");
+            qry.getSingleResult();
+            fail("Query execution should have failed.");
+        } catch (Exception e) {
+            assertExceptionMessage(e, ArgumentException.class,
+                    "No field named \"fName\" in \"XMLEmbedPropAccess\"",
+                    "[firstName, lastName]");
+        }
+
+        em.close();
+    }
+
+    /**
+     * Validates an embeddable with mixed access can be used within an
+     * entity with mixed access
+     */
+    @AllowFailure(value=true, 
+        message="Support for explicit Access on embeddables is not complete.")
+    public void testMixedEmbeddables() {
+        OpenJPAEntityManagerSPI em = emf.createEntityManager();
+        
+        XMLEmbedMixedAccess ema = new XMLEmbedMixedAccess();
+        ema.setFirstName("J");
+        ema.setLastName("Tolkien");
+        ema.setMiddleName("R");
+        
+        XMLPropMixedEntity pm = new XMLPropMixedEntity();
+        pm.setName("PropMixedEntity");
+        pm.setEmbedProp(ema);
+        
+        em.getTransaction().begin();
+        em.persist(pm);
+        em.getTransaction().commit();
+        
+        em.clear();
+        
+        Query qry = em.createNamedQuery("XMLPropMixedEntity.query");
+        qry.setParameter("id", pm.getId());
+        qry.setParameter("name", "PropMixedEntity");
+        qry.setParameter("firstName", "J");
+        qry.setParameter("lastName", "Tolkien");
+        qry.setParameter("middleName", "R");
+        XMLPropMixedEntity pm2 = (XMLPropMixedEntity)qry.getSingleResult();
+        assertEquals(pm, pm2);
+        assertEquals(ema, pm2.getEmbedProp());
+
+        try {
+            qry = em.createNamedQuery("XMLPropMixedEntity.badQuery");
+            qry.setParameter("id", pm.getId());
+            qry.setParameter("name", "PropMixedEntity");
+            qry.setParameter("firstName", "J");
+            qry.setParameter("lastName", "Tolkien");
+            qry.setParameter("middleName", "R");
+            qry.getSingleResult();
+            fail("Query execution should have failed.");
+        } catch (Exception e) {
+            assertExceptionMessage(e, ArgumentException.class,
+                "No field named \"middleName\" in \"XMLEmbedMixedAccess\"",
+                "[firstName, lastName, mName]");
+        }
+
+        em.close();
+    }
+
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/TestXMLExplicitAccess.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLAbstractMappedSuperField.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLAbstractMappedSuperField.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLAbstractMappedSuperField.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLAbstractMappedSuperField.java Mon May 11 21:59:15 2009
@@ -0,0 +1,57 @@
+/*
+ * 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.access.xml;
+
+import java.util.Date;
+
+public abstract class XMLAbstractMappedSuperField {
+
+    private int id;
+    
+    private String name;
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+    
+    abstract public Date getCreateDate();
+    
+    abstract public void setCreateDate(Date date);    
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLAbstractMappedSuperField) {
+            XMLAbstractMappedSuperField ps = (XMLAbstractMappedSuperField)obj;
+            return id == ps.getId() &&
+                   name.equals(ps.getName());
+        }
+        return false;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLAbstractMappedSuperField.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLAbstractMappedSuperProperty.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLAbstractMappedSuperProperty.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLAbstractMappedSuperProperty.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLAbstractMappedSuperProperty.java Mon May 11 21:59:15 2009
@@ -0,0 +1,57 @@
+/*
+ * 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.access.xml;
+
+import java.util.Date;
+
+public abstract class XMLAbstractMappedSuperProperty {
+
+    private int id;
+    
+    private String name;
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+    
+    abstract public Date getCreateDate();
+    
+    abstract public void setCreateDate(Date date);    
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLAbstractMappedSuperProperty) {
+            XMLAbstractMappedSuperProperty ps = (XMLAbstractMappedSuperProperty)obj;
+            return getId() == ps.getId() &&
+                   getName().equals(ps.getName());
+        }
+        return false;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLAbstractMappedSuperProperty.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLDefFieldMixedPropAccess.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLDefFieldMixedPropAccess.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLDefFieldMixedPropAccess.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLDefFieldMixedPropAccess.java Mon May 11 21:59:15 2009
@@ -0,0 +1,69 @@
+/*
+ * 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.access.xml;
+
+public class XMLDefFieldMixedPropAccess {
+
+    private int id;
+
+    private int version;
+    
+    private String strField;
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setVersion(int version) {
+        this.version = version;
+    }
+
+    public int getVersion() {
+        return version;
+    }
+
+    public void setStringField(String val) {
+        strField = val;
+    }
+
+    public String getStringField() {
+        return strField;
+    }  
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLDefFieldMixedPropAccess) {
+            XMLDefFieldMixedPropAccess fa = (XMLDefFieldMixedPropAccess)obj;
+            return id == fa.getId() &&
+                getStringField().equals(fa.getStringField());
+        }
+        return false;
+    }
+
+    public void setStrField(String strField) {
+        this.strField = strField;
+    }
+
+    public String getStrField() {
+        return strField;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLDefFieldMixedPropAccess.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLDefPropMixedFieldAccess.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLDefPropMixedFieldAccess.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLDefPropMixedFieldAccess.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLDefPropMixedFieldAccess.java Mon May 11 21:59:15 2009
@@ -0,0 +1,69 @@
+/*
+ * 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.access.xml;
+
+public class XMLDefPropMixedFieldAccess {
+
+    private int id;
+
+    private int version;
+    
+    private String strField;
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setVersion(int version) {
+        this.version = version;
+    }
+
+    public int getVersion() {
+        return version;
+    }
+
+    public void setStrProp(String var) {
+        this.setStrField(var);
+    }
+
+    public String getStrProp() {
+        return getStrField();
+    }   
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLDefPropMixedFieldAccess) {
+            XMLDefPropMixedFieldAccess dpmfa = (XMLDefPropMixedFieldAccess)obj;
+            return getId() == dpmfa.getId() &&
+                getStrField().equals(dpmfa.getStrProp());
+        }
+        return false;
+    }
+
+    public void setStrField(String strField) {
+        this.strField = strField;
+    }
+
+    public String getStrField() {
+        return strField;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLDefPropMixedFieldAccess.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLEmbedFieldAccess.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLEmbedFieldAccess.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLEmbedFieldAccess.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLEmbedFieldAccess.java Mon May 11 21:59:15 2009
@@ -0,0 +1,50 @@
+/*
+ * 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.access.xml;
+
+public class XMLEmbedFieldAccess {
+
+    String fName;
+    String lName;
+
+    public String getFirstName() {
+        return fName;
+    }
+    
+    public void setFirstName(String fname) {
+        fName = fname;        
+    }
+    
+    public String getLastName() {
+        return lName;
+    }
+    
+    public void setLastName(String lname) {
+        lName = lname;
+    }  
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLEmbedFieldAccess) {
+            XMLEmbedFieldAccess ps = (XMLEmbedFieldAccess)obj;
+            return getFirstName().equals(ps.getFirstName()) &&
+                getLastName().equals(ps.getLastName());
+        }
+        return false;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLEmbedFieldAccess.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLEmbedMixedAccess.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLEmbedMixedAccess.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLEmbedMixedAccess.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLEmbedMixedAccess.java Mon May 11 21:59:15 2009
@@ -0,0 +1,69 @@
+/*
+ * 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.access.xml;
+
+public class XMLEmbedMixedAccess {
+    
+    private transient String fName;
+    private transient String lName;
+
+    private String mName; 
+
+    public String getFirstName() {
+        return fName;
+    }
+    
+    public void setFirstName(String fname) {
+        fName = fname;        
+    }
+    
+    public String getLastName() {
+        return lName;
+    }
+    
+    public void setLastName(String lname) {
+        lName = lname;
+    }  
+
+    public String getMiddleName() {
+        return getMName();
+    }
+
+    public void setMiddleName(String mname) {
+        setMName(mname);
+    }
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLEmbedMixedAccess) {
+            XMLEmbedMixedAccess ps = (XMLEmbedMixedAccess)obj;
+            return getFirstName().equals(ps.getFirstName()) &&
+                getLastName().equals(ps.getLastName()) &&
+                getMiddleName().equals(ps.getMiddleName());
+        }
+        return false;
+    }
+
+    public void setMName(String mName) {
+        this.mName = mName;
+    }
+
+    public String getMName() {
+        return mName;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLEmbedMixedAccess.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLEmbedPropAccess.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLEmbedPropAccess.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLEmbedPropAccess.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLEmbedPropAccess.java Mon May 11 21:59:15 2009
@@ -0,0 +1,58 @@
+/*
+ * 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.access.xml;
+
+public class XMLEmbedPropAccess {
+
+    String fName;
+    String lName;
+
+    public XMLEmbedPropAccess() {        
+    }
+    
+    public XMLEmbedPropAccess(String fn, String ln) {
+        setFirstName(fn);
+        setLastName(ln);
+    }
+    
+    public String getFirstName() {
+        return fName;
+    }
+    
+    public void setFirstName(String fname) {
+        fName = fname;        
+    }
+    
+    public String getLastName() {
+        return lName;
+    }
+    
+    public void setLastName(String lname) {
+        lName = lname;
+    }    
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLEmbedPropAccess) {
+            XMLEmbedPropAccess ps = (XMLEmbedPropAccess)obj;
+            return getFirstName().equals(ps.getFirstName()) &&
+                getLastName().equals(ps.getLastName());
+        }
+        return false;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLEmbedPropAccess.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldAccess.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldAccess.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldAccess.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldAccess.java Mon May 11 21:59:15 2009
@@ -0,0 +1,69 @@
+/*
+ * 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.access.xml;
+
+public class XMLFieldAccess {
+
+    private int id;
+
+    private int version;
+    
+    private String strField;
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setVersion(int version) {
+        this.version = version;
+    }
+
+    public int getVersion() {
+        return version;
+    }
+
+    public void setStringField(String val) {
+        this.setStrField(val);
+    }
+
+    public String getStringField() {
+        return getStrField();
+    }  
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLFieldAccess) {
+            XMLFieldAccess fa = (XMLFieldAccess)obj;
+            return id == fa.getId() &&
+              getStrField().equals(fa.getStringField());
+        }
+        return false;
+    }
+
+    public void setStrField(String strField) {
+        this.strField = strField;
+    }
+
+    public String getStrField() {
+        return strField;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldAccess.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldEmbedEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldEmbedEntity.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldEmbedEntity.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldEmbedEntity.java Mon May 11 21:59:15 2009
@@ -0,0 +1,61 @@
+/*
+ * 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.access.xml;
+
+public class XMLFieldEmbedEntity {
+
+    private int id;
+    
+    private String name;
+
+    private XMLEmbedPropAccess epa;
+    
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+    
+    public XMLEmbedPropAccess getEPA() {
+        return epa;
+    }
+
+    public void setEPA(XMLEmbedPropAccess ep) {
+        epa = ep;
+    }
+
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLFieldEmbedEntity) {
+            XMLFieldEmbedEntity ps = (XMLFieldEmbedEntity)obj;
+            return epa.equals(ps.getEPA()) && getId() == ps.getId() &&
+                   getName().equals(ps.getName());
+        }
+        return false;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldEmbedEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldSub.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldSub.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldSub.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldSub.java Mon May 11 21:59:15 2009
@@ -0,0 +1,45 @@
+/*
+ * 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.access.xml;
+
+import java.util.Date;
+
+public class XMLFieldSub extends XMLAbstractMappedSuperProperty {
+
+    private Date crtDate;
+    
+    @Override
+    public Date getCreateDate() {
+        return crtDate;
+    }
+
+    @Override
+    public void setCreateDate(Date date) {
+        crtDate = date;
+    }
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLFieldSub) {
+            XMLFieldSub ps = (XMLFieldSub)obj;
+            return super.equals(obj) &&
+                   crtDate.equals(ps.getCreateDate());
+        }
+        return false;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldSub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldSub2.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldSub2.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldSub2.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldSub2.java Mon May 11 21:59:15 2009
@@ -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.access.xml;
+
+import java.util.Date;
+
+public class XMLFieldSub2 extends XMLMappedSuperProperty {
+    
+    protected Date crtDate;
+
+    public Date getCreateDate() {
+        return crtDate;
+    }
+
+    public void setCreateDate(Date date) {
+        crtDate = date;
+    }
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLFieldSub2) {
+            XMLFieldSub2 ps = (XMLFieldSub2)obj;
+            return super.equals(obj) &&
+                   crtDate.equals(ps.getCreateDate());
+        }
+        return false;
+    }
+    
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldSub2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldSub3.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldSub3.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldSub3.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldSub3.java Mon May 11 21:59:15 2009
@@ -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.access.xml;
+
+import java.util.Date;
+
+public class XMLFieldSub3 extends XMLSuperPropertyEntity {
+    
+    protected Date crtDate;
+
+    public Date getCreateDate() {
+        return crtDate;
+    }
+
+    public void setCreateDate(Date date) {
+        crtDate = date;
+    }
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLFieldSub3) {
+            XMLFieldSub3 ps = (XMLFieldSub3)obj;
+            return super.equals(obj) &&
+                   crtDate.equals(ps.getCreateDate());
+        }
+        return false;
+    }
+    
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLFieldSub3.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMappedSuperField.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMappedSuperField.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMappedSuperField.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMappedSuperField.java Mon May 11 21:59:15 2009
@@ -0,0 +1,55 @@
+/*
+ * 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.access.xml;
+
+import java.util.Date;
+
+public class XMLMappedSuperField {
+
+    private int id;
+    
+    private String name;
+
+    protected Date crtDate;
+    
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+        
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLMappedSuperField) {
+            XMLMappedSuperField ps = (XMLMappedSuperField)obj;
+            return id == ps.getId() &&
+                   name.equals(ps.getName());
+        }
+        return false;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMappedSuperField.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMappedSuperProperty.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMappedSuperProperty.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMappedSuperProperty.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMappedSuperProperty.java Mon May 11 21:59:15 2009
@@ -0,0 +1,51 @@
+/*
+ * 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.access.xml;
+
+public class XMLMappedSuperProperty {
+
+    private int id;
+    
+    private String name;
+    
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+        
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLMappedSuperProperty) {
+            XMLMappedSuperProperty ps = (XMLMappedSuperProperty)obj;
+            return getId() == ps.getId() &&
+                   getName().equals(ps.getName());
+        }
+        return false;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMappedSuperProperty.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMixedFieldSub.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMixedFieldSub.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMixedFieldSub.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMixedFieldSub.java Mon May 11 21:59:15 2009
@@ -0,0 +1,54 @@
+/*
+ * 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.access.xml;
+
+import java.util.Date;
+
+public class XMLMixedFieldSub extends XMLMixedMappedSuper {
+
+    private String myField;
+    
+    private Date crtDate;
+    
+    public Date getCreateDate() {
+        return crtDate;
+    }
+
+    public void setCreateDate(Date date) {
+        crtDate = date;
+    }
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLMixedFieldSub) {
+            XMLMixedFieldSub ps = (XMLMixedFieldSub)obj;
+            return super.equals(obj) &&
+                   getCreateDate().equals(ps.getCreateDate());
+        }
+        return false;
+    }
+
+    public void setMyFieldProp(String myField) {
+        this.myField = myField;
+    }
+
+    public String getMyFieldProp() {
+        return myField;
+    }
+
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMixedFieldSub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMixedMappedSuper.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMixedMappedSuper.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMixedMappedSuper.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMixedMappedSuper.java Mon May 11 21:59:15 2009
@@ -0,0 +1,63 @@
+/*
+ * 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.access.xml;
+
+import java.util.Date;
+
+public class XMLMixedMappedSuper {
+
+    private int mid;
+    
+    private String mname;
+
+    protected Date crtDate;
+    
+    public void setId(int id) {
+        this.setMid(id);
+    }
+
+    public int getId() {
+        return getMid();
+    }
+
+    public void setName(String name) {
+        this.mname = name;
+    }
+
+    public String getName() {
+        return mname;
+    }
+        
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLMixedMappedSuper) {
+            XMLMixedMappedSuper ps = (XMLMixedMappedSuper)obj;
+            return getId() == ps.getId() &&
+                   getName().equals(ps.getName());
+        }
+        return false;
+    }
+
+    public void setMid(int mid) {
+        this.mid = mid;
+    }
+
+    public int getMid() {
+        return mid;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLMixedMappedSuper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropAccess.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropAccess.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropAccess.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropAccess.java Mon May 11 21:59:15 2009
@@ -0,0 +1,61 @@
+/*
+ * 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.access.xml;
+
+public class XMLPropAccess {
+
+    private int id;
+
+    private int version;
+    
+    private String strField;
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setVersion(int version) {
+        this.version = version;
+    }
+
+    public int getVersion() {
+        return version;
+    }
+
+    public void setStrProp(String var) {
+        this.strField = var;
+    }
+
+    public String getStrProp() {
+        return strField;
+    } 
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLPropAccess) {
+            XMLPropAccess pa = (XMLPropAccess)obj;
+            return getId() == pa.getId() &&
+                getStrProp().equals(pa.getStrProp());
+        }
+        return false;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropAccess.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropEmbedEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropEmbedEntity.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropEmbedEntity.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropEmbedEntity.java Mon May 11 21:59:15 2009
@@ -0,0 +1,62 @@
+/*
+ * 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.access.xml;
+
+public class XMLPropEmbedEntity {
+
+    private int id;
+    
+    private String name;
+
+    private XMLEmbedFieldAccess efa;
+    
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+    
+    public XMLEmbedFieldAccess getEmbedProp() {
+        return efa;
+    }
+
+    public void setEmbedProp(XMLEmbedFieldAccess ef) {
+        efa = ef;
+    }
+
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLPropEmbedEntity) {
+            XMLPropEmbedEntity ps = (XMLPropEmbedEntity)obj;
+            return getEmbedProp().equals(ps.getEmbedProp()) 
+                && getId() == ps.getId() &&
+                getName().equals(ps.getName());
+        }
+        return false;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropEmbedEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropMixedEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropMixedEntity.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropMixedEntity.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropMixedEntity.java Mon May 11 21:59:15 2009
@@ -0,0 +1,81 @@
+/*
+ * 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.access.xml;
+
+public class XMLPropMixedEntity {
+    
+    private int idval;
+    
+    private String myName;
+
+    private XMLEmbedMixedAccess ema;
+    
+    public void setId(int id) {
+        this.setIdval(id);
+    }
+
+    public int getId() {
+        return getIdval();
+    }
+
+    public void setName(String name) {
+        this.myName = name;
+    }
+
+    // Property access
+    public String getName() {
+        return myName;
+    }
+
+    public XMLEmbedMixedAccess getEmbedProp() {
+        return getEma();
+    }
+
+    public void setEmbedProp(XMLEmbedMixedAccess ef) {
+        setEma(ef);
+    }
+
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLPropMixedEntity) {
+            XMLPropMixedEntity ps = (XMLPropMixedEntity)obj;
+            return getEmbedProp().equals(ps.getEmbedProp()) 
+                && getId() == ps.getId() &&
+                getName().equals(ps.getName());
+        }
+        return false;
+    }
+
+    public void setIdval(int idval) {
+        this.idval = idval;
+    }
+
+    public int getIdval() {
+        return idval;
+    }
+
+    public void setEma(XMLEmbedMixedAccess ema) {
+        this.ema = ema;
+    }
+
+    public XMLEmbedMixedAccess getEma() {
+        return ema;
+    }
+
+
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropMixedEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropertySub.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropertySub.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropertySub.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropertySub.java Mon May 11 21:59:15 2009
@@ -0,0 +1,46 @@
+/*
+ * 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.access.xml;
+
+import java.util.Date;
+
+public class XMLPropertySub extends XMLAbstractMappedSuperField {
+
+    private Date crtDate;
+    
+    @Override
+    public Date getCreateDate() {
+        return crtDate;
+    }
+
+    @Override
+    public void setCreateDate(Date date) {
+        crtDate = date;
+    }
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLPropertySub) {
+            XMLPropertySub ps = (XMLPropertySub)obj;
+            return super.equals(obj) &&
+                   crtDate.equals(ps.getCreateDate());
+        }
+        return false;
+    }
+    
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropertySub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropertySub2.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropertySub2.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropertySub2.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropertySub2.java Mon May 11 21:59:15 2009
@@ -0,0 +1,42 @@
+/*
+ * 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.access.xml;
+
+import java.util.Date;
+
+public class XMLPropertySub2 extends XMLMappedSuperField {
+    
+    public Date getCreateDate() {
+        return crtDate;
+    }
+
+    public void setCreateDate(Date date) {
+        crtDate = date;
+    }
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLPropertySub2) {
+            XMLPropertySub2 ps = (XMLPropertySub2)obj;
+            return super.equals(obj) &&
+                   crtDate.equals(ps.getCreateDate());
+        }
+        return false;
+    }
+    
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropertySub2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropertySub3.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropertySub3.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropertySub3.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropertySub3.java Mon May 11 21:59:15 2009
@@ -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.access.xml;
+
+import java.util.Date;
+
+public class XMLPropertySub3 extends XMLSuperFieldEntity {
+    
+    protected Date crtDate;
+
+    public Date getCreateDate() {
+        return crtDate;
+    }
+
+    public void setCreateDate(Date date) {
+        crtDate = date;
+    }
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof XMLPropertySub3) {
+            XMLPropertySub3 ps = (XMLPropertySub3)obj;
+            return super.equals(obj) &&
+                   crtDate.equals(ps.getCreateDate());
+        }
+        return false;
+    }
+    
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLPropertySub3.java
------------------------------------------------------------------------------
    svn:eol-style = native