You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by jgallimore <gi...@git.apache.org> on 2018/11/16 15:13:19 UTC

[GitHub] tomee pull request #199: Hacking around with loading CMP modules

GitHub user jgallimore opened a pull request:

    https://github.com/apache/tomee/pull/199

    Hacking around with loading CMP modules

    This is not intended for merge but collaboration and discussion. This PR adds a simple test to `LegacyInterfaceTest` to ensure that user-provided mappings are taken into consideration and not overwritten. These are provided programmatically, as opposed to via XML. This passes, so, so far-so good.
    
    There is an Arquillian test with the same CMP classes, and the same CMP/JPA mappings, but provided via `WEB-INF/openejb-cmp-orm.xml`. This fails with a JAXB error stating that:
    
    ```
    CmpMappingTest/WEB-INF/openejb-cmp-orm.xml: unexpected element (uri:"http://java.sun.com/xml/ns/javaee", local:"entity"). Expected elements are <{http://java.sun.com/xml/ns/persistence/orm}embeddable>,<{http://java.sun.com/xml/ns/persistence/orm}entity>,<{http://java.sun.com/xml/ns/persistence/orm}table-generator>,<{http://java.sun.com/xml/ns/persistence/orm}named-native-query>,<{http://java.sun.com/xml/ns/persistence/orm}sequence-generator>,<{http://java.sun.com/xml/ns/persistence/orm}sql-result-set-mapping>,<{http://java.sun.com/xml/ns/persistence/orm}named-query>,<{http://java.sun.com/xml/ns/persistence/orm}description>,<{http://java.sun.com/xml/ns/persistence/orm}persistence-unit-metadata>,<{http://java.sun.com/xml/ns/persistence/orm}catalog>,<{http://java.sun.com/xml/ns/persistence/orm}schema>,<{http://java.sun.com/xml/ns/persistence/orm}access>,<{http://java.sun.com/xml/ns/persistence/orm}mapped-superclass>,<{http://java.sun.com/xml/ns/persistence/orm}package>
    ```
    
    The javaee namespace here is weird. Finally, I added a unit test specifically for `ReadDescriptors` to check the `readCmpOrm()` method directly with the same XML. This also fails with the same issue.
    
    I think we likely need to change the `readCmpOrm()` method so it doesn't fiddle with the namespace.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jgallimore/tomee cmp-jpa

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tomee/pull/199.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #199
    
----
commit e8ef7742ea599f2506abac821dacb242b83919b4
Author: Jonathan Gallimore <jo...@...>
Date:   2018-11-16T12:39:20Z

    Add simple test to ensure overrides from openejb-cmp-orm.xml work

commit f668add70884ff2038e15b0eb52bff8547c7c3dc
Author: Jonathan Gallimore <jo...@...>
Date:   2018-11-16T15:06:17Z

    Adding further basic CMP tests

----


---

[GitHub] tomee pull request #199: Hacking around with loading CMP modules

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/tomee/pull/199


---