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

Lets take a step back.

A question I neglected to ask is: Why do all your persistence units have to be merged together? Are there relationships between them? If not, why not, simply build a facade over the set of persistence units that lets you transparently access them?

As for the extension feature, at it's base, it doesn't have to be about dynamically making changes. It simply lets you specify an orm.xml file that exists outside of your persistence unit that can be used to add mappings. You can either specify a URL for a file that is directly available, or a URL that goes to a webservice that will construct the XML and return it. It is totally up to you.

As for the extension mechanism, there is no specific documentation, but the basic idea is you create an implementer of our MetadataSource class (likely actually a subclass of our XMLMetadataSource class) Take a look at these two classes for an example that provides a WebService to read extensions and a Metadatasource to get them:

https://fisheye2.atlassian.com/browse/eclipselink/trunk/examples/my-sports/MySports/src/example/mysports/admin/AdminMetadataSource.java?hb=true

https://fisheye2.atlassian.com/browse/eclipselink/trunk/examples/my-sports/MySports/src/example/mysports/admin/RESTAdminServerConnector.java?r=9600

-Tom



On 02/03/2012 12:01 PM, Geronimo Ma. Hernandez wrote:
On Friday 02 March 2012 - 16:30:54, Tom Ware wrote:
It's true we don't do discovery of new classes.

Hm, I don't need to support dynamic change of number of classes.

The number of entities depends on the installation - and which kind of
extensions are installed.
The number of entities may vary on each installation and an installation may
change by installing another extension too.

So I think, I have to determine the entities at runtime, but I don't (want or
need to) support change of number of entities during runtime.

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.

That sounds very interesting.
I beg your pardon, but wiki looks pretty poor on that item and a quick search
did not serve desired informations ...

... do you have a link, where I can learn more on that item?


kind regards

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


Back to the top