Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] question about composite persistence unit

It's true we don't do discovery of new classes.

The default extension mechanism, however, makes use of a URL, so it's not a matter of assembling an orm.xml file in memory. It's simply a matter of building an orm.xml file, deploying it somewhere and referring to it by URL. If the URL is not enough, you can provide your own implementation of the Metadata Source that gets the xml file from some other place.

The orm files will follow JPA rules, so if you just list the new Entities in the orm.xml file (and provide nothing else), all the standard JPA mapping rules will work - they can, in effect, be just a list of the new classes you are interested in.

-Tom

On 02/03/2012 10:24 AM, Geronimo Ma. Hernandez wrote:
Hi Tom,

thank you very much for your assistance!

On Friday 02 March 2012 - 15:26:25, Tom Ware wrote:
    It is not clear to me why composite persistence units are helpful to
you. The most common use case for composite persistence units is to handle
a situation where you have multiple databases (or at least multiple
database schemas) and you want to compose entities out of those schemas.

    Based on my understanding, you may be more interested in the extension
mechanism we provide for persistence units.  Here is an example that
explains:

May be I'm looking for something in the middle.

Supposed I got things right, composite persistence units are not what I need.
Neither I want to use extensible entities.

I have entities coded following JPA standards and all I'm looking for is a way
to inform the entitymanager about those entities.

Beside the hack of assembling an xml-file in memory and pass the result to
entitymanagerfactory - is there an "officially supported" way to extend the list
of entities?
Could the names be passed as properties, or what else can I do?

kind regards

Gero
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top