openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r916855 - in /openjpa/trunk/openjpa-persistence-jdbc/src/test: java/org/apache/openjpa/persistence/jpql/entities/ java/org/apache/openjpa/persistence/jpql/expressions/ java/org/apache/openjpa/persistence/test/ resources/META-INF/ resources/...
Date Fri, 26 Feb 2010 23:16:14 GMT
Author: dwoods
Date: Fri Feb 26 23:16:13 2010
New Revision: 916855

URL: http://svn.apache.org/viewvc?rev=916855&view=rev
Log:
OPENJPA-855 Add additional O2M and Element collection tests for annotated and XML mapped entities

Added:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/IOrderedElements.java   (with props)
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/JPAEntityClassEnum.java   (with props)
    openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jpql/expressions/orm.xml
Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/IOrderedEntity.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/OrderedElementEntity.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/OrderedManyToManyEntity.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/OrderedOneToManyEntity.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/XMLOrderedElementEntity.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/XMLOrderedManyToManyEntity.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/XMLOrderedOneToManyEntity.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestIndex.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/AbstractPersistenceTestCase.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml
    openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jpql/expressions/persistence.xml

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/IOrderedElements.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/IOrderedElements.java?rev=916855&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/IOrderedElements.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/IOrderedElements.java Fri Feb 26 23:16:13 2010
@@ -0,0 +1,41 @@
+/*
+ * 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.jpql.entities;
+
+import java.util.List;
+
+
+public interface IOrderedElements {
+
+    public int getId();
+
+    public void setId(int id);
+
+    public List<String> getListElements();
+
+    public void setListElements(List<String> elements);
+
+    public void addListElements(String element);
+    
+    public String removeListElements(int location);
+    
+    public void insertListElements(int location, String name);
+
+    public String toString();
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/IOrderedElements.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/IOrderedEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/IOrderedEntity.java?rev=916855&r1=916854&r2=916855&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/IOrderedEntity.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/IOrderedEntity.java Fri Feb 26 23:16:13 2010
@@ -30,11 +30,11 @@
 
     public void setEntities(List<INameEntity> entities);
 
-    public void addEntities(INameEntity entity);
-    
-    public INameEntity removeEntities(int location);
+    public void addEntity(INameEntity newElement);
+
+    public INameEntity removeEntity(int location);
     
-    public void insertEntities(int location, INameEntity entity);
+    public void insertEntity(int location, INameEntity entity);
 
     public String toString();
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/OrderedElementEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/OrderedElementEntity.java?rev=916855&r1=916854&r2=916855&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/OrderedElementEntity.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/OrderedElementEntity.java Fri Feb 26 23:16:13 2010
@@ -27,14 +27,14 @@
 import javax.persistence.OrderColumn;
 
 @Entity
-public class OrderedElementEntity implements java.io.Serializable {
+public class OrderedElementEntity implements IOrderedElements, java.io.Serializable {
 
     @Id
     private int id;
 
     @ElementCollection
     @OrderColumn
-    private List<String> listElements;  
+    private List<String> elements;  
     
     public int getId() {
         return id;
@@ -45,36 +45,36 @@
     }
 
     public List<String> getListElements() {
-        return listElements;
+        return elements;
     }
 
     public void setListElements(List<String> elements) {
-        this.listElements = elements;
+        this.elements = elements;
     }
 
     public void addListElements(String element) {
-        if( listElements == null) {
-            listElements = new ArrayList<String>();
+        if( elements == null) {
+            elements = new ArrayList<String>();
         }
-        listElements.add(element);
+        elements.add(element);
     }
     
     public String removeListElements(int location) {
         String rtnVal = null;
-        if( listElements != null) {
-            rtnVal = listElements.remove(location);
+        if( elements != null) {
+            rtnVal = elements.remove(location);
         }
         return rtnVal;
     }
     
     public void insertListElements(int location, String name) {
-        if( listElements == null) {
-            listElements = new ArrayList<String>();
+        if( elements == null) {
+            elements = new ArrayList<String>();
         }
-        listElements.add(location, name);
+        elements.add(location, name);
     }
 
     public String toString() {
-        return "OrderedElementEntity[" + id + "]=" + listElements;
+        return "OrderedElementEntity[" + id + "]=" + elements;
     }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/OrderedManyToManyEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/OrderedManyToManyEntity.java?rev=916855&r1=916854&r2=916855&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/OrderedManyToManyEntity.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/OrderedManyToManyEntity.java Fri Feb 26 23:16:13 2010
@@ -34,7 +34,7 @@
 
     @ManyToMany
     @OrderColumn
-    private List<INameEntity> om2mEntities;
+    private List<INameEntity> entities;
 
     
     public int getId() {
@@ -46,36 +46,36 @@
     }
 
     public List<INameEntity> getEntities() {
-        return om2mEntities;
+        return entities;
     }
 
     public void setEntities(List<INameEntity> entities) {
-        this.om2mEntities = entities;
+        this.entities = entities;
     }
 
-    public void addEntities(INameEntity entity) {
-        if( om2mEntities == null) {
-            om2mEntities = new ArrayList<INameEntity>();
+    public void addEntity(INameEntity entity) {
+        if( entities == null) {
+            entities = new ArrayList<INameEntity>();
         }
-        om2mEntities.add(entity);
+        entities.add(entity);
     }
-    
-    public INameEntity removeEntities(int location) {
+        
+    public INameEntity removeEntity(int location) {
         INameEntity rtnVal = null;
-        if( om2mEntities != null) {
-            rtnVal = om2mEntities.remove(location);
+        if( entities != null) {
+            rtnVal = entities.remove(location);
         }
         return rtnVal;
     }
     
-    public void insertEntities(int location, INameEntity entity) {
-        if( om2mEntities == null) {
-            om2mEntities = new ArrayList<INameEntity>();
+    public void insertEntity(int location, INameEntity entity) {
+        if( entities == null) {
+            entities = new ArrayList<INameEntity>();
         }
-        om2mEntities.add(location, entity);
+        entities.add(location, entity);
     }
 
     public String toString() {
-        return "OrderedManyToManyEntity[" + id + "]=" + om2mEntities;
+        return "OrderedManyToManyEntity[" + id + "]=" + entities;
     }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/OrderedOneToManyEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/OrderedOneToManyEntity.java?rev=916855&r1=916854&r2=916855&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/OrderedOneToManyEntity.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/OrderedOneToManyEntity.java Fri Feb 26 23:16:13 2010
@@ -34,7 +34,7 @@
 
     @OneToMany
     @OrderColumn
-    private List<INameEntity> oo2mEntities;
+    private List<INameEntity> entities;
 
     
     public int getId() {
@@ -46,36 +46,36 @@
     }
 
     public List<INameEntity> getEntities() {
-        return oo2mEntities;
+        return entities;
     }
 
     public void setEntities(List<INameEntity> names) {
-        this.oo2mEntities = names;
+        this.entities = names;
     }
 
-    public void addEntities(INameEntity name) {
-        if( oo2mEntities == null) {
-            oo2mEntities = new ArrayList<INameEntity>();
+    public void addEntity(INameEntity name) {
+        if( entities == null) {
+            entities = new ArrayList<INameEntity>();
         }
-        oo2mEntities.add(name);
+        entities.add(name);
     }
-    
-    public INameEntity removeEntities(int location) {
+        
+    public INameEntity removeEntity(int location) {
         INameEntity rtnVal = null;
-        if( oo2mEntities != null) {
-            rtnVal = oo2mEntities.remove(location);
+        if( entities != null) {
+            rtnVal = entities.remove(location);
         }
         return rtnVal;
     }
     
-    public void insertEntities(int location, INameEntity name) {
-        if( oo2mEntities == null) {
-            oo2mEntities = new ArrayList<INameEntity>();
+    public void insertEntity(int location, INameEntity name) {
+        if( entities == null) {
+            entities = new ArrayList<INameEntity>();
         }
-        oo2mEntities.add(location, name);
+        entities.add(location, name);
     }
 
     public String toString() {
-        return "OrderedOneToManyEntity[" + id + "]=" + oo2mEntities;
+        return "OrderedOneToManyEntity[" + id + "]=" + entities;
     }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/XMLOrderedElementEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/XMLOrderedElementEntity.java?rev=916855&r1=916854&r2=916855&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/XMLOrderedElementEntity.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/XMLOrderedElementEntity.java Fri Feb 26 23:16:13 2010
@@ -21,11 +21,11 @@
 import java.util.ArrayList;
 import java.util.List;
 
-public class XMLOrderedElementEntity implements java.io.Serializable {
+public class XMLOrderedElementEntity implements IOrderedElements, java.io.Serializable {
 
     private int id;
 
-    private List<String> listElements;  
+    private List<String> elements;  
     
     public int getId() {
         return id;
@@ -36,36 +36,36 @@
     }
 
     public List<String> getListElements() {
-        return listElements;
+        return elements;
     }
 
     public void setListElements(List<String> elements) {
-        this.listElements = elements;
+        this.elements = elements;
     }
 
     public void addListElements(String element) {
-        if( listElements == null) {
-            listElements = new ArrayList<String>();
+        if( elements == null) {
+            elements = new ArrayList<String>();
         }
-        listElements.add(element);
+        elements.add(element);
     }
     
     public String removeListElements(int location) {
         String rtnVal = null;
-        if( listElements != null) {
-            rtnVal = listElements.remove(location);
+        if( elements != null) {
+            rtnVal = elements.remove(location);
         }
         return rtnVal;
     }
     
     public void insertListElements(int location, String name) {
-        if( listElements == null) {
-            listElements = new ArrayList<String>();
+        if( elements == null) {
+            elements = new ArrayList<String>();
         }
-        listElements.add(location, name);
+        elements.add(location, name);
     }
 
     public String toString() {
-        return "XMLOrderedElementEntity[" + id + "]=" + listElements;
+        return "XMLOrderedElementEntity[" + id + "]=" + elements;
     }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/XMLOrderedManyToManyEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/XMLOrderedManyToManyEntity.java?rev=916855&r1=916854&r2=916855&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/XMLOrderedManyToManyEntity.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/XMLOrderedManyToManyEntity.java Fri Feb 26 23:16:13 2010
@@ -25,7 +25,7 @@
 
     private int id;
 
-    private List<INameEntity> xom2mEntities;
+    private List<INameEntity> entities;
 
     
     public int getId() {
@@ -37,36 +37,36 @@
     }
 
     public List<INameEntity> getEntities() {
-        return xom2mEntities;
+        return entities;
     }
 
     public void setEntities(List<INameEntity> entities) {
-        this.xom2mEntities = entities;
+        this.entities = entities;
     }
 
-    public void addEntities(INameEntity entity) {
-        if( xom2mEntities == null) {
-            xom2mEntities = new ArrayList<INameEntity>();
+    public void addEntity(INameEntity entity) {
+        if( entities == null) {
+            entities = new ArrayList<INameEntity>();
         }
-        xom2mEntities.add(entity);
+        entities.add(entity);
     }
     
-    public INameEntity removeEntities(int location) {
+    public INameEntity removeEntity(int location) {
         INameEntity rtnVal = null;
-        if( xom2mEntities != null) {
-            rtnVal = xom2mEntities.remove(location);
+        if( entities != null) {
+            rtnVal = entities.remove(location);
         }
         return rtnVal;
     }
     
-    public void insertEntities(int location, INameEntity entity) {
-        if( xom2mEntities == null) {
-            xom2mEntities = new ArrayList<INameEntity>();
+    public void insertEntity(int location, INameEntity entity) {
+        if( entities == null) {
+            entities = new ArrayList<INameEntity>();
         }
-        xom2mEntities.add(location, entity);
+        entities.add(location, entity);
     }
 
     public String toString() {
-        return "XMLOrderedManyToManyEntity[" + id + "]=" + xom2mEntities;
+        return "XMLOrderedManyToManyEntity[" + id + "]=" + entities;
     }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/XMLOrderedOneToManyEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/XMLOrderedOneToManyEntity.java?rev=916855&r1=916854&r2=916855&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/XMLOrderedOneToManyEntity.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/entities/XMLOrderedOneToManyEntity.java Fri Feb 26 23:16:13 2010
@@ -25,7 +25,7 @@
 
     private int id;
 
-    private List<INameEntity> xoo2mEntities;
+    private List<INameEntity> entities;
 
     
     public int getId() {
@@ -37,36 +37,36 @@
     }
 
     public List<INameEntity> getEntities() {
-        return xoo2mEntities;
+        return entities;
     }
 
     public void setEntities(List<INameEntity> entities) {
-        this.xoo2mEntities = entities;
+        this.entities = entities;
     }
 
-    public void addEntities(INameEntity entity) {
-        if( xoo2mEntities == null) {
-            xoo2mEntities = new ArrayList<INameEntity>();
+    public void addEntity(INameEntity entity) {
+        if( entities == null) {
+            entities = new ArrayList<INameEntity>();
         }
-        xoo2mEntities.add(entity);
+        entities.add(entity);
     }
     
-    public INameEntity removeEntities(int location) {
+    public INameEntity removeEntity(int location) {
         INameEntity rtnVal = null;
-        if( xoo2mEntities != null) {
-            rtnVal = xoo2mEntities.remove(location);
+        if( entities != null) {
+            rtnVal = entities.remove(location);
         }
         return rtnVal;
     }
     
-    public void insertEntities(int location, INameEntity entity) {
-        if( xoo2mEntities == null) {
-            xoo2mEntities = new ArrayList<INameEntity>();
+    public void insertEntity(int location, INameEntity entity) {
+        if( entities == null) {
+            entities = new ArrayList<INameEntity>();
         }
-        xoo2mEntities.add(location, entity);
+        entities.add(location, entity);
     }
 
     public String toString() {
-        return "XMLOrderedOneToManyEntity[" + id + "]=" + xoo2mEntities;
+        return "XMLOrderedOneToManyEntity[" + id + "]=" + entities;
     }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestIndex.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestIndex.java?rev=916855&r1=916854&r2=916855&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestIndex.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestIndex.java Fri Feb 26 23:16:13 2010
@@ -18,25 +18,99 @@
  */
 package org.apache.openjpa.persistence.jpql.expressions;
 
+import java.lang.reflect.Constructor;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 import javax.persistence.EntityManager;
+import javax.persistence.Query;
 
+import org.apache.openjpa.lib.log.Log;
+import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
+import org.apache.openjpa.persistence.OpenJPAPersistence;
+import org.apache.openjpa.persistence.jpql.entities.INameEntity;
+import org.apache.openjpa.persistence.jpql.entities.IOrderedElements;
+import org.apache.openjpa.persistence.jpql.entities.IOrderedEntity;
+import org.apache.openjpa.persistence.jpql.entities.OrderedElementEntity;
+import org.apache.openjpa.persistence.jpql.entities.OrderedManyToManyEntity;
+import org.apache.openjpa.persistence.jpql.entities.OrderedOneToManyEntity;
+import org.apache.openjpa.persistence.jpql.entities.UnorderedNameEntity;
+import org.apache.openjpa.persistence.jpql.entities.XMLOrderedElementEntity;
+import org.apache.openjpa.persistence.jpql.entities.XMLOrderedManyToManyEntity;
+import org.apache.openjpa.persistence.jpql.entities.XMLOrderedOneToManyEntity;
+import org.apache.openjpa.persistence.jpql.entities.XMLUnorderedNameEntity;
 import org.apache.openjpa.persistence.proxy.TreeNode;
+import org.apache.openjpa.persistence.test.JPAEntityClassEnum;
 import org.apache.openjpa.persistence.test.SingleEMFTestCase;
 
 /**
- * Tests index function
+ * Test JPQL Index function on O2M, M2M and Element collections using annotations and XML.
  *  
- * @author Catalina Wei
+ * @author Catalina Wei, Albert Lee, Donald Woods
  */
 public class TestIndex extends SingleEMFTestCase {
+    
+    private OpenJPAEntityManagerFactorySPI emf2 = null;
+    private Log log = null;
+    
+    private enum JPQLIndexEntityClasses implements JPAEntityClassEnum {
+        OrderedElementEntity(OrderedElementEntity.class),
+        OrderedOneToManyEntity(OrderedOneToManyEntity.class),
+        OrderedManyToManyEntity(OrderedManyToManyEntity.class),
+        XMLOrderedElementEntity(XMLOrderedElementEntity.class),
+        XMLOrderedOneToManyEntity(XMLOrderedOneToManyEntity.class),
+        XMLOrderedManyToManyEntity(XMLOrderedManyToManyEntity.class),
+        UnorderedNameEntity(UnorderedNameEntity.class),
+        XMLUnorderedNameEntity(XMLUnorderedNameEntity.class);
+
+        private Class<?> clazz;
+        private String fullEntityName;
+        private String entityName;
+
+        JPQLIndexEntityClasses(Class<?> clazz) {
+            this.clazz = clazz;
+            fullEntityName = clazz.getName();
+            entityName = fullEntityName.substring(getEntityClassName()
+                .lastIndexOf('.') + 1);
+        }
+
+        public Class<?> getEntityClass() {
+            return clazz;
+        }
+
+        public String getEntityClassName() {
+            return fullEntityName;
+        }
+
+        public String getEntityName() {
+            return entityName;
+        }
+    }
+
+    private static final String[] Element_Names = { "A_Element", "B_Element",
+        "C_Element", "D_Element", "E_Element", "F_Element", };
+
+    @Override
     public void setUp() {
-        super.setUp(CLEAR_TABLES, TreeNode.class);
+        super.setUp(CLEAR_TABLES, TreeNode.class, 
+            OrderedElementEntity.class, UnorderedNameEntity.class,
+            OrderedOneToManyEntity.class, OrderedManyToManyEntity.class);
+            // XMLOrderedOneToManyEntity.class, XMLOrderedManyToManyEntity.class,
+            // XMLOrderedElementEntity.class, XMLUnorderedNameEntity.class);
+
+        // create our EMF
+        emf2 = (OpenJPAEntityManagerFactorySPI) OpenJPAPersistence.createEntityManagerFactory(
+                "JPQLIndex",
+                "org/apache/openjpa/persistence/jpql/expressions/persistence.xml");
+        assertNotNull(emf2);
+
+        log =  emf2.getConfiguration().getLog("test");
     }
-    
-    public void testQueryIndex() {
-        persistTree();
+        
+    public void testO2MTreeQueryIndex() {
+        int[] fanOuts = {2,3,4};
+        createTreeNodeEntities(fanOuts);
         EntityManager em = emf.createEntityManager();
         String query = "SELECT index(c) from TreeNode t, in (t.childern) c" +
             " WHERE index(c) = 2"; 
@@ -48,28 +122,45 @@
         em.close();                
     }
 
-    public void createTree() {
-        TreeNode root = new TreeNode();
-        root.setName("0");
-        int[] fanOuts = {1,2,3};
-        root.createTree(fanOuts);
-        assertArrayEquals(fanOuts, root.getFanOuts());
+    public void testO2MQueryIndex() {
+        createEntities(JPQLIndexEntityClasses.OrderedOneToManyEntity, UnorderedNameEntity.class);
+        verifyEntities(JPQLIndexEntityClasses.OrderedOneToManyEntity, UnorderedNameEntity.class);
     }
 
-    public void persistTree() {
-        int[] fanOuts = {2,3,4};
-        create(fanOuts);
+    public void testO2MXMLQueryIndex() {
+        createEntities(JPQLIndexEntityClasses.XMLOrderedOneToManyEntity, XMLUnorderedNameEntity.class);
+        verifyEntities(JPQLIndexEntityClasses.XMLOrderedOneToManyEntity, XMLUnorderedNameEntity.class);
+    }
+
+    /* TODO
+    public void testM2MQueryIndex() {
+    }
+    */
+
+    /* TODO
+    public void testM2MXMLQueryIndex() {
+    }
+    */
+
+    public void testElementQueryIndex() {
+        createEntities(JPQLIndexEntityClasses.OrderedElementEntity, String.class);
+        verifyEntities(JPQLIndexEntityClasses.OrderedElementEntity, String.class);
+    }
+
+    public void testElementXMLQueryIndex() {
+        createEntities(JPQLIndexEntityClasses.XMLOrderedElementEntity, String.class);
+        verifyEntities(JPQLIndexEntityClasses.XMLOrderedElementEntity, String.class);
     }
 
     /**
-     * Create a uniform tree with given fan out.
-     * Persist.
+     * Create and persist a uniform OneToMany tree with given fan out.
      */
-    TreeNode create(int[] original) {
+    private TreeNode createTreeNodeEntities(int[] original) {
         TreeNode root = new TreeNode();
         root.createTree(original);
+        assertArrayEquals(original, root.getFanOuts());
         
-        EntityManager em = emf.createEntityManager();
+        EntityManager em = emf2.createEntityManager();
         em.getTransaction().begin();
         em.persist(root);
         em.getTransaction().commit();
@@ -81,9 +172,250 @@
     /**
      *  Asserts the given arrays have exactly same elements at the same index.
      */
-    void assertArrayEquals(int[] a, int[] b) {
+    private void assertArrayEquals(int[] a, int[] b) {
         assertEquals(a.length, b.length);
         for (int i = 0; i<a.length; i++)
             assertEquals(a[i], b[i]);
     }
+    
+    private <C,E> void createEntities(JPQLIndexEntityClasses entityType, Class<E> elementClass)
+    {
+        if (IOrderedEntity.class.isAssignableFrom(entityType.getEntityClass())) {
+            if (INameEntity.class.isAssignableFrom(elementClass)) {
+                log.trace("** Test INameEntity modifications on IOrderedEntity.");
+                createOrderedEntities(entityType, (Class<INameEntity>)elementClass);
+            } else {
+                fail("createEntities(IOrderedEntity) - Unexpected elementClass=" + elementClass.getSimpleName());
+            }
+        } else if (IOrderedElements.class.isAssignableFrom(entityType.getEntityClass())) {
+            if (String.class.isAssignableFrom(elementClass)) {
+                log.trace("** Test String modifications on IOrderedElements.");
+                createOrderedElements(entityType);
+            } else {
+                fail("createEntities(IOrderedElements) - Unexpected elementClass=" + elementClass.getSimpleName());
+            }
+        } else {
+            fail("createEntities() - Unexpected entityType=" + entityType.getEntityName());            
+        }
+    }
+        
+    private void createOrderedEntities(JPQLIndexEntityClasses entityType, Class<INameEntity> elementClass)
+    {
+        EntityManager em = null;
+        
+        try {
+            Class<IOrderedEntity> entityClass =
+                (Class<IOrderedEntity>)Class.forName(entityType.getEntityClassName());
+            String entityClassName = entityType.getEntityName();
+            String elementClassName = elementClass.getName().substring(
+                elementClass.getName().lastIndexOf('.') + 1);
+            Integer entityId = 1;
+            
+            IOrderedEntity newEntity = (IOrderedEntity)constructNewEntityObject(entityType);
+            newEntity.setId(entityId);
+            // create the entity elements to add
+            Constructor<INameEntity> elementConstrctor = elementClass.getConstructor(String.class);
+            List<INameEntity> newElements = new ArrayList<INameEntity>();
+            for (int i=0; i<Element_Names.length; i++) {
+                newElements.add(elementConstrctor.newInstance(Element_Names[i]));
+            }
+            
+            // add the entities
+            log.trace("Adding " + newElements.size() + " of " + elementClassName + " to " + entityClassName);
+            em = emf2.createEntityManager();
+            em.getTransaction().begin();
+            for (INameEntity newElement : newElements)
+            {
+                /* For Many to Many cases
+                    jpaRW.getEm().persist(newElementB);
+                    if (elementClass == OrderedNameEntity.class || elementClass == XMLOrderedNameEntity.class) {
+                        if( listFieldName.charAt(1) == 'o') {
+                            setColumnMethod.invoke(new2Boy, newEntity);
+                        } else {
+                            addColumnsMethod.invoke(new2Boy, newEntity);
+                        }
+                    }
+                */
+                em.persist(newElement);
+                newEntity.addEntity((INameEntity)newElement);
+            }
+            em.persist(newEntity);
+            em.getTransaction().commit();
+            em.clear();
+
+            // verify the entities were stored
+            log.trace("Verifing the entity was stored");
+            IOrderedEntity findEntity = em.find(entityClass, entityId);
+            assertNotNull("Found entity just created", findEntity);
+            assertEquals("Verify entity id = " + entityId, entityId.intValue(), findEntity.getId());
+            assertEquals("Verify entity name = " + entityClass.getName(), entityClass.getName(),
+                findEntity.getClass().getName());
+
+        } catch (Throwable t) {
+            log.error(t);
+            throw new RuntimeException(t);
+        } finally {
+            if (em != null) {
+                if (em.getTransaction().isActive()) {
+                    em.getTransaction().rollback();
+                }
+                em.close();
+                em = null;
+            }
+        }
+    }
+    
+    private void createOrderedElements(JPQLIndexEntityClasses entityType)
+    {
+        EntityManager em = null;
+        
+        try {
+            Class<IOrderedElements> entityClass =
+                (Class<IOrderedElements>)Class.forName(entityType.getEntityClassName());
+            String entityClassName = entityType.getEntityName();
+            Integer entityId = 1;
+            
+            IOrderedElements newEntity = (IOrderedElements)constructNewEntityObject(entityType);
+            newEntity.setId(entityId);
+            List<String> namesList = new ArrayList<String>();
+            for (int i=0; i<Element_Names.length; i++) {
+                namesList.add(Element_Names[i]);
+            }
+            newEntity.setListElements(namesList);
+            // add the entity
+            em = emf2.createEntityManager();
+            em.getTransaction().begin();
+            em.persist(newEntity);
+            em.getTransaction().commit();
+            em.clear();
+
+            // verify the entity was stored
+            log.trace("Verifing the entity was stored");
+            IOrderedElements findEntity = em.find(entityClass, entityId);
+            assertNotNull("Found entity just created", findEntity);
+            assertEquals("Verify entity id = " + entityId, entityId.intValue(), findEntity.getId());
+            assertEquals("Verify entity name = " + entityClass.getName(), entityClass.getName(),
+                findEntity.getClass().getName());
+
+        } catch (Throwable t) {
+            log.error(t);
+            throw new RuntimeException(t);
+        } finally {
+            if (em != null) {
+                if (em.getTransaction().isActive()) {
+                    em.getTransaction().rollback();
+                }
+                em.close();
+                em = null;
+            }
+        }
+    }
+    
+    private <C,E> void verifyEntities(JPQLIndexEntityClasses entityType, Class<E> elementClass)
+    {
+        if (IOrderedEntity.class.isAssignableFrom(entityType.getEntityClass())) {
+            if (INameEntity.class.isAssignableFrom(elementClass)) {
+                log.trace("** Verify INameEntity modifications on IOrderedEntity.");
+                verifyOrderedEntities(entityType, (Class<INameEntity>)elementClass);
+            } else {
+                fail("verifyEntities(IOrderedEntity) - Unexpected elementClass=" + elementClass.getSimpleName());
+            }
+        } else if (IOrderedElements.class.isAssignableFrom(entityType.getEntityClass())) {
+            if (String.class.isAssignableFrom(elementClass)) {
+                log.trace("** Test String modifications on IOrderedElements.");
+                verifyOrderedElements(entityType);
+            } else {
+                fail("verifyEntities(IOrderedElements) - Unexpected elementClass=" + elementClass.getSimpleName());
+            }
+        } else {
+            fail("verifyEntities() - Unexpected entityType=" + entityType.getEntityName());            
+        }
+    }
+    
+    private <E> void verifyOrderedEntities(JPQLIndexEntityClasses entityType, Class<INameEntity> elementClass)
+    {
+        try {
+            Class<IOrderedEntity> entityClass = (Class<IOrderedEntity>)Class.forName(entityType.getEntityClassName());
+            String entityClassName = entityType.getEntityName();
+            entityClassName = entityClassName.substring(entityClassName.lastIndexOf('.') + 1);
+
+            if (log.isTraceEnabled()) {
+                log.trace("Query " + entityClassName + " and verify 'entities' collection has "
+                    + Element_Names.length + " elements in this order: "
+                    + Arrays.toString(Element_Names));
+            }
+            
+            EntityManager em = emf2.createEntityManager();
+            em.clear();
+            int idx = 0;
+            for (String expectedEntityName : Element_Names) {
+                Query q = em.createQuery("select w from " + entityClassName
+                    + " o join o.entities w where index(w) = " + idx);
+                List<E> res = (List<E>)q.getResultList();
+                assertEquals("  Verify query returns 1 element for index " + idx, 1, res.size());
+                if (res.size() == 1) {
+                    Object oo = res.get(0);
+                    assertEquals("  Verify element type is " + elementClass.getName(), elementClass.getName(),
+                        oo.getClass().getName());
+                    String name;
+                    try {
+                        name = (String) elementClass.getMethod("getName").invoke(oo);
+                        assertEquals("  Verify element value is '"
+                            + expectedEntityName + "'", expectedEntityName, name);
+                    } catch (Exception e) {
+                        log.error("  Caught unexpected exception:" + e.getMessage());
+                        throw new RuntimeException(e);
+                    }
+                }
+                ++idx;
+            }
+        } catch (Exception e) {
+            log.error(e);
+            throw new RuntimeException(e);
+        }
+    }
+    
+    private <E> void verifyOrderedElements(JPQLIndexEntityClasses entityType)
+    {
+        try {
+            Class<IOrderedEntity> entityClass = (Class<IOrderedEntity>)Class.forName(entityType.getEntityClassName());
+            String entityClassName = entityType.getEntityName();
+            entityClassName = entityClassName.substring(entityClassName.lastIndexOf('.') + 1);
+
+            if (log.isTraceEnabled()) {
+                log.trace("Query " + entityClassName + " and verify 'elements' collection has "
+                    + Element_Names.length + " elements in this order: "
+                    + Arrays.toString(Element_Names));
+            }
+            
+            EntityManager em = emf2.createEntityManager();
+            em.clear();
+            int idx = 0;
+            for (String expectedEntityName : Element_Names) {
+                Query q = em.createQuery("select w from " + entityClassName
+                    + " o join o.elements w where index(w) = " + idx);
+                List<E> res = (List<E>)q.getResultList();
+                assertEquals("  Verify query returns 1 element for index " + idx, 1, res.size());
+                if (res.size() == 1) {
+                    Object oo = res.get(0);
+                    assertEquals("  Verify element type is String", String.class.getName(),
+                        oo.getClass().getName());
+                    String name;
+                    try {
+                        name = (String) oo.toString();
+                        assertEquals("  Verify element value is '"
+                            + expectedEntityName + "'", expectedEntityName, name);
+                    } catch (Exception e) {
+                        log.error("  Caught unexpected exception:" + e.getMessage());
+                        throw new RuntimeException(e);
+                    }
+                }
+                ++idx;
+            }
+        } catch (Exception e) {
+            log.error(e);
+            throw new RuntimeException(e);
+        }
+    }
+    
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/AbstractPersistenceTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/AbstractPersistenceTestCase.java?rev=916855&r1=916854&r2=916855&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/AbstractPersistenceTestCase.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/AbstractPersistenceTestCase.java Fri Feb 26 23:16:13 2010
@@ -23,6 +23,8 @@
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.sql.SQLException;
@@ -615,4 +617,49 @@
         }
     }
 
+    protected Class<?> resolveEntityClass(JPAEntityClassEnum enumerationRef)
+        throws ClassNotFoundException
+    {
+        if (enumerationRef == null)
+        {
+            throw new IllegalArgumentException("Null value passed into the constructNewEntityObject method.");
+        }
+        String className = enumerationRef.getEntityClassName();
+        if (className == null)
+        {
+            throw new IllegalArgumentException("Enumeration toString() method implementation returned a null value.");
+        }
+
+        return Class.forName(className);
+    }
+
+    protected Object constructNewEntityObject(JPAEntityClassEnum enumerationRef)
+        throws ClassNotFoundException, SecurityException, NoSuchMethodException,
+        IllegalArgumentException, InstantiationException,
+        IllegalAccessException, InvocationTargetException
+    {
+        Class<?> classType = resolveEntityClass(enumerationRef);
+        Class<?> constructorArgSig[] = new Class[] {};
+        Object constructorArgs[] = new Object[] {};
+
+        Constructor<?> classConstructor = classType.getConstructor(constructorArgSig);
+        Object newEntity = classConstructor.newInstance(constructorArgs);
+
+        return newEntity;
+    }
+
+    protected Object constructNewEntityObject(Class<?> entityClass)
+        throws SecurityException, NoSuchMethodException,
+        IllegalArgumentException, InstantiationException,
+        IllegalAccessException, InvocationTargetException
+    {
+        Class<?> constructorArgSig[] = new Class[] {};
+        Object constructorArgs[] = new Object[] {};
+
+        Constructor<?> classConstructor = entityClass.getConstructor(constructorArgSig);
+        Object newEntity = classConstructor.newInstance(constructorArgs);
+
+        return newEntity;
+    }
+
 }

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/JPAEntityClassEnum.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/JPAEntityClassEnum.java?rev=916855&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/JPAEntityClassEnum.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/JPAEntityClassEnum.java Fri Feb 26 23:16:13 2010
@@ -0,0 +1,25 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.openjpa.persistence.test;
+
+public interface JPAEntityClassEnum {
+    public String getEntityClassName();
+    public String getEntityName();
+}
+

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

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=916855&r1=916854&r2=916855&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 Fri Feb 26 23:16:13 2010
@@ -47,6 +47,7 @@
         <mapping-file>org/apache/openjpa/persistence/jdbc/order/order-orm.xml</mapping-file>
         <mapping-file>org/apache/openjpa/persistence/jdbc/order/order-orm-2.xml</mapping-file>
         <mapping-file>org/apache/openjpa/persistence/jdbc/order/order-orm-3.xml</mapping-file>
+        <mapping-file>org/apache/openjpa/persistence/jpql/expressions/orm.xml</mapping-file>
         <mapping-file>org/apache/openjpa/persistence/inheritance/orm.xml</mapping-file>
         <mapping-file>org/apache/openjpa/persistence/orm.xml</mapping-file>
         <mapping-file>org/apache/openjpa/persistence/embed/embed-assoc-over-orm.xml</mapping-file>
@@ -284,37 +285,55 @@
             <property name="openjpa.jdbc.SynchronizeMappings"
                   value="buildSchema"/>
         </properties>
-	</persistence-unit>
+    </persistence-unit>
 	
-	<persistence-unit name="delimited-identifiers-seq-gen-xml">
+    <persistence-unit name="delimited-identifiers-seq-gen-xml">
     	<mapping-file>META-INF/delimited-identifiers-seq-gen-xml-orm.xml</mapping-file>
     	<properties>
             <property name="openjpa.jdbc.SynchronizeMappings"
                   value="buildSchema"/>
         </properties>
-	</persistence-unit>
+    </persistence-unit>
 	
-	<persistence-unit name="delimited-identifiers-inheritance-xml">
+    <persistence-unit name="delimited-identifiers-inheritance-xml">
     	<mapping-file>META-INF/delimited-identifiers-inheritance-xml-orm.xml</mapping-file>
     	<properties>
             <property name="openjpa.jdbc.SynchronizeMappings"
                   value="buildSchema"/>
         </properties>
-	</persistence-unit>
+    </persistence-unit>
 	
-	<persistence-unit name="delimited-identifiers-joins-xml">
+    <persistence-unit name="delimited-identifiers-joins-xml">
     	<mapping-file>META-INF/delimited-identifiers-joins-orm.xml</mapping-file>
     	<properties>
             <property name="openjpa.jdbc.SynchronizeMappings"
                   value="buildSchema"/>
         </properties>
-	</persistence-unit>
+    </persistence-unit>
 	
-	<persistence-unit name="delimited-identifiers-result-set-xml">
+    <persistence-unit name="delimited-identifiers-result-set-xml">
     	<mapping-file>META-INF/delimited-identifiers-result-set-orm.xml</mapping-file>
     	<properties>
             <property name="openjpa.jdbc.SynchronizeMappings"
                   value="buildSchema"/>
         </properties>
-	</persistence-unit>
+    </persistence-unit>
+
+    <persistence-unit name="JPQLIndex">
+        <mapping-file>org/apache/openjpa/persistence/jpql/expressions/orm.xml</mapping-file>
+
+        <class>org.apache.openjpa.persistence.jpql.entities.OrderedElementEntity</class>
+        <class>org.apache.openjpa.persistence.jpql.entities.XMLOrderedElementEntity</class>
+        <class>org.apache.openjpa.persistence.jpql.entities.OrderedManyToManyEntity</class>
+        <class>org.apache.openjpa.persistence.jpql.entities.XMLOrderedManyToManyEntity</class>
+        <class>org.apache.openjpa.persistence.jpql.entities.OrderedOneToManyEntity</class>
+        <class>org.apache.openjpa.persistence.jpql.entities.XMLOrderedOneToManyEntity</class>
+        <class>org.apache.openjpa.persistence.jpql.entities.UnorderedNameEntity</class>
+        <class>org.apache.openjpa.persistence.jpql.entities.XMLUnorderedNameEntity</class>
+        <properties>
+            <property name="openjpa.jdbc.SynchronizeMappings"
+                value="buildSchema" />
+        </properties>
+    </persistence-unit>
+
 </persistence>

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jpql/expressions/orm.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jpql/expressions/orm.xml?rev=916855&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jpql/expressions/orm.xml (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jpql/expressions/orm.xml Fri Feb 26 23:16:13 2010
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<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">
+
+    <entity class="org.apache.openjpa.persistence.jpql.entities.XMLOrderedManyToManyEntity">
+        <attributes>
+            <id name="id" />
+            <many-to-many name="entities">
+                <order-column/>
+            </many-to-many>
+        </attributes>
+    </entity>
+
+    <entity class="org.apache.openjpa.persistence.jpql.entities.XMLOrderedOneToManyEntity">
+        <attributes>
+            <id name="id" />
+            <one-to-many name="entities">
+                <order-column/>
+            </one-to-many>
+        </attributes>
+    </entity>
+
+    <entity class="org.apache.openjpa.persistence.jpql.entities.XMLOrderedElementEntity">
+        <attributes>
+            <id name="id" />
+            <element-collection name="elements">
+                <order-column />
+            </element-collection>
+        </attributes>
+    </entity>
+
+    <entity class="org.apache.openjpa.persistence.jpql.entities.XMLUnorderedNameEntity">
+        <attributes>
+            <id name="id" />
+            <basic name="name" />
+        </attributes>
+    </entity>
+
+</entity-mappings>

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jpql/expressions/persistence.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jpql/expressions/persistence.xml?rev=916855&r1=916854&r2=916855&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jpql/expressions/persistence.xml (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jpql/expressions/persistence.xml Fri Feb 26 23:16:13 2010
@@ -23,11 +23,12 @@
 	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
 	version="2.0">
 
-    <persistence-unit name="JPQLIndex" transaction-type="RESOURCE_LOCAL">
+    <persistence-unit name="JPQLIndex">
         <description>PU for JPQL Index testing</description>
         <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
         <mapping-file>org/apache/openjpa/persistence/jpql/expressions/orm.xml</mapping-file>
 
+        <class>org.apache.openjpa.persistence.proxy.TreeNode</class>
         <class>org.apache.openjpa.persistence.jpql.entities.OrderedElementEntity</class>
         <class>org.apache.openjpa.persistence.jpql.entities.XMLOrderedElementEntity</class>
         <class>org.apache.openjpa.persistence.jpql.entities.OrderedManyToManyEntity</class>
@@ -38,8 +39,8 @@
         <class>org.apache.openjpa.persistence.jpql.entities.XMLUnorderedNameEntity</class>
         <properties>
             <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />
-            <!-- property name="openjpa.Log" value="SQL=TRACE"/ -->
-            <property name="openjpa.RuntimeUnenhancedClasses" value="unsupported"/>
+            <!-- <property name="openjpa.Log" value="SQL=TRACE"/> -->
+            <!-- <property name="openjpa.RuntimeUnenhancedClasses" value="unsupported"/> -->
         </properties>
     </persistence-unit>
 



Mime
View raw message