You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by David Blevins <da...@gmail.com> on 2011/12/28 21:24:40 UTC

[IDEA] Persistence xml fragments

Interesting idea to eliminate the need for <jar-file> elements in the persistence.xml file

  https://issues.apache.org/jira/browse/TOMEE-58

Would basically give you something like:

    some.jar/META-INF/persistence.xml
    red.jar/META-INF/persistence-fragment.xml
    green.jar/META-INF/persistence-fragment.xml
    blue.jar/META-INF/persistence-fragment.xml

In the simple case, the red.jar and green.jar and blue.jar would be added to the persistence.xml of some.jar as <jar-file> references in the units where they apply.

In this simple case the persistence-fragment.xml would only state the unit name and no other information.

In the more complex case, the persistence-fragment.xml might allow 'class' elements in addition to the unit name.  In that case, we simply move the class elements into main persistence.xml


-David


Re: [IDEA] Persistence xml fragments

Posted by Romain Manni-Bucau <rm...@gmail.com>.
currently it supports mapping file, class, jar file and exclude unlisted
tags.

- Romain


2011/12/29 Bakalsky, Krum <kr...@sap.com>

> Interesting idea really :)
> Maybe persistence-fragment.xml could carry as well some <mapping-file>
> tags ?
>
> -----Original Message-----
> From: David Blevins [mailto:david.blevins@gmail.com]
> Sent: Wednesday, December 28, 2011 10:25 PM
> To: dev@openejb.apache.org
> Subject: [IDEA] Persistence xml fragments
>
> Interesting idea to eliminate the need for <jar-file> elements in the
> persistence.xml file
>
>  https://issues.apache.org/jira/browse/TOMEE-58
>
> Would basically give you something like:
>
>    some.jar/META-INF/persistence.xml
>    red.jar/META-INF/persistence-fragment.xml
>    green.jar/META-INF/persistence-fragment.xml
>    blue.jar/META-INF/persistence-fragment.xml
>
> In the simple case, the red.jar and green.jar and blue.jar would be added
> to the persistence.xml of some.jar as <jar-file> references in the units
> where they apply.
>
> In this simple case the persistence-fragment.xml would only state the unit
> name and no other information.
>
> In the more complex case, the persistence-fragment.xml might allow 'class'
> elements in addition to the unit name.  In that case, we simply move the
> class elements into main persistence.xml
>
>
> -David
>
>

RE: [IDEA] Persistence xml fragments

Posted by "Bakalsky, Krum" <kr...@sap.com>.
Interesting idea really :)
Maybe persistence-fragment.xml could carry as well some <mapping-file> tags ?

-----Original Message-----
From: David Blevins [mailto:david.blevins@gmail.com] 
Sent: Wednesday, December 28, 2011 10:25 PM
To: dev@openejb.apache.org
Subject: [IDEA] Persistence xml fragments

Interesting idea to eliminate the need for <jar-file> elements in the persistence.xml file

  https://issues.apache.org/jira/browse/TOMEE-58

Would basically give you something like:

    some.jar/META-INF/persistence.xml
    red.jar/META-INF/persistence-fragment.xml
    green.jar/META-INF/persistence-fragment.xml
    blue.jar/META-INF/persistence-fragment.xml

In the simple case, the red.jar and green.jar and blue.jar would be added to the persistence.xml of some.jar as <jar-file> references in the units where they apply.

In this simple case the persistence-fragment.xml would only state the unit name and no other information.

In the more complex case, the persistence-fragment.xml might allow 'class' elements in addition to the unit name.  In that case, we simply move the class elements into main persistence.xml


-David


Re: [IDEA] Persistence xml fragments

Posted by Romain Manni-Bucau <rm...@gmail.com>.
just played a bit with it.

i added an example persistence-fragment where the classes module define a
fragment and the test-classes module the persistence unit.

- Romain


2011/12/28 David Blevins <da...@gmail.com>

> Interesting idea to eliminate the need for <jar-file> elements in the
> persistence.xml file
>
>  https://issues.apache.org/jira/browse/TOMEE-58
>
> Would basically give you something like:
>
>    some.jar/META-INF/persistence.xml
>    red.jar/META-INF/persistence-fragment.xml
>    green.jar/META-INF/persistence-fragment.xml
>    blue.jar/META-INF/persistence-fragment.xml
>
> In the simple case, the red.jar and green.jar and blue.jar would be added
> to the persistence.xml of some.jar as <jar-file> references in the units
> where they apply.
>
> In this simple case the persistence-fragment.xml would only state the unit
> name and no other information.
>
> In the more complex case, the persistence-fragment.xml might allow 'class'
> elements in addition to the unit name.  In that case, we simply move the
> class elements into main persistence.xml
>
>
> -David
>
>