[JIRA] Created: (CAY-756) When clases are explicitly listed DataMap complains about duplicate entries

From: Dain Sundstrom (JIRA) ("Dain)
Date: Fri Feb 16 2007 - 19:59:49 EST

  • Next message: Andrus Adamchik (JIRA): "[JIRA] Created: (CAY-757) JPA enhancer should enhance undeclared classes"

    When clases are explicitly listed DataMap complains about duplicate entries
    ---------------------------------------------------------------------------

                     Key: CAY-756
                     URL: https://issues.apache.org/cayenne/browse/CAY-756
                 Project: Cayenne
              Issue Type: Bug
              Components: Cayenne JPA
                Reporter: Dain Sundstrom
             Assigned To: Andrus Adamchik

    The enhancer seems to need to have all classes explicitly listed in the persistence.xml file. I would expect the enhancer to enhance any class that has mapping metadata or if exclude-unlisted is false any class with..ntity annotation. Anyway, I listed my classes in the persistence unit, but then I get the following exception:

    java.lang.IllegalArgumentException: An attempt to override entity 'Employee
            at org.apache.cayenne.map.DataMap.addObjEntity(DataMap.java:622)
            at org.apache.cayenne.jpa.bridge.DataMapConverter$JpaEntityVisitor.createObject(DataMapConverter.java:505)
            at org.apache.cayenne.jpa.bridge.DataMapConverter$NestedVisitor.onStartNode(DataMapConverter.java:690)
            at org.apache.cayenne.util.TraversalUtil.traverse(TraversalUtil.java:92)
            at org.apache.cayenne.util.TraversalUtil.traverse(TraversalUtil.java:113)
            at org.apache.cayenne.util.TraversalUtil.traverse(TraversalUtil.java:80)
            at org.apache.cayenne.jpa.bridge.DataMapConverter.toDataMap(DataMapConverter.java:93)
            at org.apache.cayenne.jpa.Provider.createContainerEntityManagerFactory(Provider.java:250)
            at org.apache.openejb.core.cmp.jpa.JpaTest.createEntityManagerFactory(JpaTest.java:201)
            at org.apache.openejb.core.cmp.jpa.JpaTest.testJta(JpaTest.java:125)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32)

    You can reproduce this with the openejb JpaTest; just change the provider at the top of the test to cayenne.

    -- 
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
    



    This archive was generated by hypermail 2.0.0 : Fri Feb 16 2007 - 20:00:46 EST