openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fayw...@apache.org
Subject svn commit: r727791 - in /openjpa/trunk/openjpa-persistence-jdbc/src/test: java/org/apache/openjpa/persistence/embed/ resources/META-INF/ resources/org/apache/openjpa/persistence/embed/
Date Thu, 18 Dec 2008 19:08:44 GMT
Author: faywang
Date: Thu Dec 18 11:08:43 2008
New Revision: 727791

URL: http://svn.apache.org/viewvc?rev=727791&view=rev
Log:
OPENJPA-782: add test case for embeddable support
using orm xml.

Added:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/EmbedXml.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/Embed_EmbedXml.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/EntityA_Coll_Embed_EmbedXml.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/EntityA_Coll_StringXml.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddableXml.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/embed/
    openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/embed/embed-orm.xml
Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/EmbedXml.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/EmbedXml.java?rev=727791&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/EmbedXml.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/EmbedXml.java
Thu Dec 18 11:08:43 2008
@@ -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.embed;
+
+import javax.persistence.Embeddable;
+
+public class EmbedXml {
+    // owned by BasicA via Embed4
+    // can not contain a collection of basic types if BasicA contains 
+    // a collection of Embed4 
+    protected int intVal1;
+    protected int intVal2;
+    protected int intVal3;
+    
+    public int getIntVal1() {
+        return intVal1;
+    }
+    
+    public void setIntVal1(int intVal1) {
+        this.intVal1 = intVal1;
+    }
+    
+    public int getIntVal2() {
+        return intVal2;
+    }
+    
+    public void setIntVal2(int intVal2) {
+        this.intVal2 = intVal2;
+    }
+    
+    public int getIntVal3() {
+        return intVal3;
+    }
+    
+    public void setIntVal3(int intVal3) {
+        this.intVal3 = intVal3;
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/Embed_EmbedXml.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/Embed_EmbedXml.java?rev=727791&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/Embed_EmbedXml.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/Embed_EmbedXml.java
Thu Dec 18 11:08:43 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.embed;
+
+
+public class Embed_EmbedXml {
+    protected int intVal1;
+    protected int intVal2;
+    protected int intVal3;
+    
+    protected EmbedXml embed;
+    
+    public int getIntVal1() {
+        return intVal1;
+    }
+    
+    public void setIntVal1(int intVal1) {
+        this.intVal1 = intVal1;
+    }
+    
+    public int getIntVal2() {
+        return intVal2;
+    }
+    
+    public void setIntVal2(int intVal2) {
+        this.intVal2 = intVal2;
+    }
+    
+    public int getIntVal3() {
+        return intVal3;
+    }
+    
+    public void setIntVal3(int intVal3) {
+        this.intVal3 = intVal3;
+    }
+        
+    public EmbedXml getEmbed() {
+        return embed;
+    }
+ 
+    public void setEmbed(EmbedXml embed) {
+        this.embed = embed;
+    }
+}

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/EntityA_Coll_Embed_EmbedXml.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/EntityA_Coll_Embed_EmbedXml.java?rev=727791&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/EntityA_Coll_Embed_EmbedXml.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/EntityA_Coll_Embed_EmbedXml.java
Thu Dec 18 11:08:43 2008
@@ -0,0 +1,74 @@
+/*
+ * 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.embed;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * CREATE TABLE EntityA_Coll_Embed_Embed (id INTEGER NOT NULL, age INTEGER, name VARCHAR(30),
PRIMARY KEY (id))
+ * CREATE TABLE EntityA_Coll_Embed_Embed_embeds (ENTITYA_COLL_EMBED_EMBED_ID INTEGER, intVal1
INTEGER, intVal2 INTEGER, intVal3 INTEGER, IntVal1x INTEGER, IntVal2x INTEGER, IntVal3x INTEGER)
+ * @author faywang
+ *
+ */
+
+
+public class EntityA_Coll_Embed_EmbedXml implements Serializable {
+    Integer id;
+
+    String name;
+    
+    int age;
+
+    protected List<Embed_EmbedXml> embeds = new ArrayList<Embed_EmbedXml>();
+    
+    public int getAge() {
+        return age;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public List<Embed_EmbedXml> getEmbeds() {
+        return embeds;
+    }
+    
+    public void addEmbed(Embed_EmbedXml embed) {
+        embeds.add(embed);
+    }
+}
+

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/EntityA_Coll_StringXml.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/EntityA_Coll_StringXml.java?rev=727791&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/EntityA_Coll_StringXml.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/EntityA_Coll_StringXml.java
Thu Dec 18 11:08:43 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.embed;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * CREATE TABLE EntityA_Coll_String (id INTEGER NOT NULL, age INTEGER, name VARCHAR(30),
PRIMARY KEY (id))
+ * CREATE TABLE NickNames_Tbl (ENTITYA_COLL_STRING_ID INTEGER, nicknames1 VARCHAR(20))
+ * CREATE INDEX I_NCKNTBL_ENTITYA_ ON NickNames_Tbl (ENTITYA_COLL_STRING_ID)
+ * INSERT INTO EntityA_Coll_String (id, age, name) VALUES (?, ?, ?)
+ * INSERT INTO NickNames_Tbl (ENTITYA_COLL_STRING_ID, nicknames1) VALUES (?, ?)
+ * SELECT t0.age, t0.name FROM EntityA_Coll_String t0 WHERE t0.id = ?  optimize for 1 row
+ * SELECT t0.nicknames1 FROM NickNames_Tbl t0 WHERE t0.ENTITYA_COLL_STRING_ID = ? 
+ * @author faywang
+ */
+
+
+public class EntityA_Coll_StringXml implements Serializable {
+    // contains a collection of basic types
+    
+    Integer id;
+
+    String name;
+    
+    int age;
+
+    protected Set<String> nickNames = new HashSet<String>();
+
+    public int getAge() {
+        return age;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Set<String> getNickNames() {
+        return nickNames;
+    }
+    
+    public void addNickName(String nickName) {
+        nickNames.add(nickName);
+    }
+}
+

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddableXml.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddableXml.java?rev=727791&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddableXml.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbeddableXml.java
Thu Dec 18 11:08:43 2008
@@ -0,0 +1,225 @@
+/*
+ * 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.embed;
+
+import java.util.List;
+import java.util.Set;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityTransaction;
+import javax.persistence.Query;
+
+import org.apache.openjpa.persistence.test.SingleEMFTestCase;
+
+
+public class TestEmbeddableXml extends SingleEMFTestCase {
+   
+    public int numEmbeddables = 1;
+    public int numBasicTypes = 1;
+    public int ID = 1;
+    
+    public void setUp() {
+        setUp(CLEAR_TABLES);
+    }
+    
+    @Override
+    protected String getPersistenceUnitName() {
+        return "embed-pu";
+    }
+    
+    public void testEntityA_Coll_StringXml() {
+        createEntityA_Coll_StringXml();
+        queryEntityA_Coll_StringXml();
+        findEntityA_Coll_StringXml();
+    }
+
+    public void testEntityA_Coll_Embed_Embed() {
+        createEntityA_Coll_Embed_EmbedXml();
+        queryEntityA_Coll_Embed_EmbedXml();
+        findEntityA_Coll_Embed_EmbedXml();
+    }
+
+    /*
+     * Create EntityA_Coll_StringXml
+     */
+    public void createEntityA_Coll_StringXml() {
+        EntityManager em = emf.createEntityManager();
+        EntityTransaction tran = em.getTransaction();
+        createEntityA_Coll_StringXml(em, ID);
+        tran.begin();
+        em.flush();
+        tran.commit();
+        em.close();
+    }
+
+    public void createEntityA_Coll_StringXml(EntityManager em, int id) {
+        EntityA_Coll_StringXml a = new EntityA_Coll_StringXml();
+        a.setId(id);
+        a.setName("a" + id);
+        a.setAge(id);
+        for (int i = 0; i < numBasicTypes; i++)
+            a.addNickName("nickName_" + id + i);
+        em.persist(a);
+    }
+
+    /*
+     * Create EntityA_Coll_Embed_EmbedXml
+     */
+    public void createEntityA_Coll_Embed_EmbedXml() {
+        EntityManager em = emf.createEntityManager();
+        EntityTransaction tran = em.getTransaction();
+        createEntityA_Coll_Embed_EmbedXml(em, ID);
+        tran.begin();
+        em.flush();
+        tran.commit();
+        em.close();
+    }
+
+    public void createEntityA_Coll_Embed_EmbedXml(EntityManager em, int id) {
+        EntityA_Coll_Embed_EmbedXml a = new EntityA_Coll_Embed_EmbedXml();
+        a.setId(id);
+        a.setName("a" + id);
+        a.setAge(id);
+        for (int i = 0; i < numEmbeddables; i++) {
+            Embed_EmbedXml embed = createEmbed_EmbedXml(em, id, i);
+            a.addEmbed(embed);
+        }
+        em.persist(a);
+    }
+
+    public Embed_EmbedXml createEmbed_EmbedXml(EntityManager em, int id, int idx) {
+        Embed_EmbedXml embed = new Embed_EmbedXml();
+        embed.setIntVal1(id * 100 + idx * 10 + 1);
+        embed.setIntVal2(id * 100 + idx * 10 + 2);
+        embed.setIntVal3(id * 100 + idx * 10 + 3);
+        EmbedXml embed1 = createEmbedXml(id, idx);
+        embed.setEmbed(embed1);
+        return embed;
+    }
+
+    public EmbedXml createEmbedXml(int id, int idx) {
+        EmbedXml embed = new EmbedXml();
+        embed.setIntVal1(id * 100 + idx * 10 + 4);
+        embed.setIntVal2(id * 100 + idx * 10 + 5);
+        embed.setIntVal3(id * 100 + idx * 10 + 6);
+        return embed;
+    }
+
+    /*
+     * Find EntityA_Coll_StringXml
+     */
+    public void findEntityA_Coll_StringXml() {
+        EntityManager em = emf.createEntityManager();
+        EntityA_Coll_StringXml a = em.find(EntityA_Coll_StringXml.class, ID);
+        checkEntityA_Coll_StringXml(a);
+        em.close();
+    }
+
+    /*
+     * Find EntityA_Coll_Embed_EmbedXml
+     */
+    public void findEntityA_Coll_Embed_EmbedXml() {
+        EntityManager em = emf.createEntityManager();
+        EntityA_Coll_Embed_EmbedXml a = em.find(EntityA_Coll_Embed_EmbedXml.class, ID);
+        checkEntityA_Coll_Embed_EmbedXml(a);
+        em.close();
+    }
+
+    /*
+     * check EntityA_Coll_String
+     */
+    public void checkEntityA_Coll_StringXml(EntityA_Coll_StringXml a) {
+        int id = a.getId();
+        String name = a.getName();
+        int age = a.getAge();
+        assertEquals(1, id);
+        assertEquals("a" + id ,name);
+        assertEquals(1, age);
+        Set<String> nickNames = a.getNickNames();
+        for (String nickName : nickNames)
+            assertEquals("nickName_" + id + "0", nickName);
+    }
+
+    /*
+     * check EntityA_Coll_Embed_EmbedXml
+     */
+    public void checkEntityA_Coll_Embed_EmbedXml(EntityA_Coll_Embed_EmbedXml a) {
+        int id = a.getId();
+        String name = a.getName();
+        int age = a.getAge();
+        assertEquals(1, id);
+        assertEquals("a" + id ,name);
+        assertEquals(1, age);
+        List<Embed_EmbedXml> embeds = a.getEmbeds();
+        for (Embed_EmbedXml embed : embeds)
+            checkEmbed_EmbedXml(embed);
+    }
+
+    public void checkEmbed_EmbedXml(Embed_EmbedXml embed) {
+        int intVal1 = embed.getIntVal1();
+        int intVal2 = embed.getIntVal2();
+        int intVal3 = embed.getIntVal3();
+        assertEquals(101, intVal1);
+        assertEquals(102, intVal2);
+        assertEquals(103, intVal3);
+        EmbedXml embed1 = embed.getEmbed();
+        checkEmbedXml(embed1);
+    }
+
+    public void checkEmbedXml(EmbedXml embed) {
+        int intVal1 = embed.getIntVal1();
+        int intVal2 = embed.getIntVal2();
+        int intVal3 = embed.getIntVal3();
+        assertEquals(104, intVal1);
+        assertEquals(105, intVal2);
+        assertEquals(106, intVal3);
+    }
+
+    /*
+     * Query EntityA_Coll_StringXml
+     */
+    public void queryEntityA_Coll_StringXml() {
+        EntityManager em = emf.createEntityManager();
+        EntityTransaction tran = em.getTransaction();
+        tran.begin();
+        Query q = em.createQuery("select a from EntityA_Coll_StringXml a");
+        List<EntityA_Coll_StringXml> as = q.getResultList();
+        for (EntityA_Coll_StringXml a : as) {
+            checkEntityA_Coll_StringXml(a);
+        }
+        tran.commit();
+        em.close();
+    }
+
+    /*
+     * Query EntityA_Coll_Embed_Embed
+     */
+    public void queryEntityA_Coll_Embed_EmbedXml() {
+        EntityManager em = emf.createEntityManager();
+        EntityTransaction tran = em.getTransaction();
+        tran.begin();
+        Query q = em.createQuery("select a from EntityA_Coll_Embed_EmbedXml a");
+        List<EntityA_Coll_Embed_EmbedXml> as = q.getResultList();
+        for (EntityA_Coll_Embed_EmbedXml a : as) {
+            checkEntityA_Coll_Embed_EmbedXml(a);
+        }
+        tran.commit();
+        em.close();
+    }
+}

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml?rev=727791&r1=727790&r2=727791&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml Thu
Dec 18 11:08:43 2008
@@ -101,4 +101,16 @@
         <mapping-file>org/apache/openjpa/persistence/annotations/xml/orm.xml</mapping-file>
     </persistence-unit>
     
+    <persistence-unit name="embed-pu">
+        <mapping-file>org/apache/openjpa/persistence/embed/embed-orm.xml</mapping-file>
+        <class>org.apache.openjpa.persistence.embed.EntityA_Coll_StringXml</class>
+        <class>org.apache.openjpa.persistence.embed.EntityA_Coll_Embed_EmbedXml</class>
+        <class>org.apache.openjpa.persistence.embed.Embed_EmbedXml</class>
+        <class>org.apache.openjpa.persistence.embed.EmbedXml</class>
+        <properties>
+            <property name="openjpa.jdbc.SynchronizeMappings"
+                  value="buildSchema(ForeignKeys=true)"/>
+        </properties>
+    </persistence-unit>
+
 </persistence>

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/embed/embed-orm.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/embed/embed-orm.xml?rev=727791&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/embed/embed-orm.xml
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/embed/embed-orm.xml
Thu Dec 18 11:08:43 2008
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- AtestCatalog metadata in xml -->
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
+version="2.0">
+	<package>embeddableXml</package>
+
+    <entity name="EntityA_Coll_StringXml" 
+            class="org.apache.openjpa.persistence.embed.EntityA_Coll_StringXml" 
+            access="FIELD">
+        <table name="EntityA_Coll_String_XML" />
+        
+        <attributes>
+            <id name="id">
+            </id>
+            
+            <basic name="name">
+                <column length="30" />
+            </basic>
+            
+            <basic name="age" fetch="LAZY">
+            </basic>
+            
+            <element-collection name="nickNames">
+              <column name="nickName_xml" length="20"/>
+              <collection-table name="NickNames_xml">
+                 <join-column name="A_ID_xml" nullable="false"/>
+                 <unique-constraint>
+                   <column-name>A_ID_xml</column-name>
+                    <column-name>nickName_xml</column-name>
+                 </unique-constraint>
+              </collection-table>
+	        </element-collection>
+        </attributes>
+    </entity>
+     
+    <entity name="EntityA_Coll_Embed_EmbedXml" 
+            class="org.apache.openjpa.persistence.embed.EntityA_Coll_Embed_EmbedXml" 
+            access="FIELD">
+        <table name="EntityA_Coll_Embed_EmbedXML" />
+        <attributes>
+            <id name="id">
+            </id>
+            <basic name="name">
+                <column length="30" />
+            </basic>
+            <basic name="age" fetch="LAZY">
+            </basic>
+            <element-collection name="embeds">
+            </element-collection>
+        </attributes>
+    </entity>
+ 
+    <embeddable class="org.apache.openjpa.persistence.embed.Embed_EmbedXml" 
+                access="FIELD">
+        <attributes>
+            <basic name="intVal1">
+            </basic>
+            <basic name="intVal2">
+            </basic>
+            <basic name="intVal3">
+            </basic>
+            <embedded name="embed">
+                 <attribute-override name="intVal1">
+                   <column name="embed_intVal1"/>
+                 </attribute-override>
+                 <attribute-override name="intVal2">
+                   <column name="embed_intVal2"/>
+                 </attribute-override>
+                 <attribute-override name="intVal3">
+                   <column name="embed_intVal3"/>
+                 </attribute-override>
+            </embedded>
+        </attributes>
+    </embeddable>
+
+    <embeddable class="org.apache.openjpa.persistence.embed.EmbedXml" 
+                access="FIELD">
+        <attributes>
+            <basic name="intVal1">
+            </basic>
+            <basic name="intVal2">
+            </basic>
+            <basic name="intVal3">
+            </basic>
+        </attributes>
+    </embeddable>
+    
+</entity-mappings>
\ No newline at end of file



Mime
View raw message