Jonathan Gallimore created TOMEE-2295:
-----------------------------------------

             Summary: Persistence Unit mapping-file ignored by CmpJpaConversion
                 Key: TOMEE-2295
                 URL: https://issues.apache.org/jira/browse/TOMEE-2295
             Project: TomEE
          Issue Type: Bug
    Affects Versions: 7.1.0, 7.0.5, 8.0.0-M1, 1.7.5
            Reporter: Jonathan Gallimore
            Assignee: Jonathan Gallimore
             Fix For: 8.0.0-Final, 1.7.6, 7.0.6, 7.1.1


The CmpJpaConversion code enables TomEE to run CMP entity beans by converting 
them to JPA "on the fly". It does this by using a persistence unit it creates 
on the app module named "cmp", and generating an orm.xml file for the 
persistence component to use.

 

However, if you create a persistence.xml file and a custom orm.xml file (using 
the `openejb.descriptors.output=true` system property, for example) and 
reference the custom orm.xml in persistence.xml, it is ignored.

 

One possible workaround is to remove the mapping file reference from 
persistence.xml and package it in the artifact as META-INF/openejb-cmp-orm.xml 
(or WEB-INF/openejb-cmp-orm.xml for .war files): 
[https://github.com/apache/tomee/blob/0165264d37f9cb6ce6d2585f2f6b0fbd926ad5c4/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java#L553]
 and 
[https://github.com/apache/tomee/blob/0165264d37f9cb6ce6d2585f2f6b0fbd926ad5c4/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/cmp/CmpMappingTest.java#L45]

 

However, it should be possible to also check for the presence of an existing 
mapping file on the cmp persistence unit, and use that as opposed to generating 
a new one.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to