Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » multiple xml-mappings from fragments?
multiple xml-mappings from fragments? [message #385496] Mon, 23 February 2009 14:11 Go to next message
Lars Fischer is currently offline Lars Fischer
Messages: 105
Registered: July 2009
Senior Member
Hello experts,

I'm new in using eclipselink and would like to run it in a Spring DM
environment.

I would like to have a modular application structure, which could be
extended by just adding additional bundles. So I tried to use fragments,
which are providing additional xml-mappings to enable additional entities.

My project bundles structure looks lite this:

* core.domain
- bundle exporting some abstract and tooling classes
* core.persistence
- bundle wich uses spring dm to instantiate the
EclipseLinkJpaVendorAdapter and LocalContainerEntityManagerFactoryBean
to create a EntityManagerFactory for all components

* component_a.domain
- bundle exporting domain-classes of component_a

* component_a.persistence
- fragment with eclipselink-orm.xml for defining entities of
component_a - depends on component_a.domain
- host is core.persistence
- depends on component_a.domain

* component_b.domain
- similar to component_a.domain
* component_b.persistence
- similar to component_a.persistence


Can I define in the persistence.xml (placed in core.persistence) that
every eclipselink-orm.xml from the multiple fragments have to be loaded?

Using only component_a with eclipselink-orm.xml and persistence.xml in
it, this is working.
Using component_a and component_b together the mapping of component_a is
not loaded.

regards,
Lars
Re: multiple xml-mappings from fragments? [message #385498 is a reply to message #385496] Tue, 24 February 2009 13:56 Go to previous messageGo to next message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Do you list each orm.xml file explicitly in the persistence.xml, and give
each a unique path?

---
James
http://www.nabble.com/EclipseLink---Users-f26658.html


James : Wiki : Book : Blog : Twitter
Re: multiple xml-mappings from fragments? [message #385499 is a reply to message #385498] Wed, 25 February 2009 09:17 Go to previous messageGo to next message
Lars Fischer is currently offline Lars Fischer
Messages: 105
Registered: July 2009
Senior Member
Hello James,

Am 24.02.2009 14:56, schrieb James:
> Do you list each orm.xml file explicitly in the persistence.xml, and
> give each a unique path?

This is one problem I have seen. I think I have to place the
persistence.xml in the core.persistence bundle. The additional orm.xml
files should be placed in the additional fragments.

Do I have to change the persistence.xml when adding new fragments? Or
can I specify that every xyz-orm.xml will be used?

Or can I have also additional persistence.xml-files in the fragments
containing the same persistence-unit to configure the new orm.xml?

regards,
Lars
Re: multiple xml-mappings from fragments? [message #385500 is a reply to message #385499] Wed, 25 February 2009 13:14 Go to previous messageGo to next message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

I would assume that you have to explicitly list each orm.xml in the
persistence.xml.


James : Wiki : Book : Blog : Twitter
Re: multiple xml-mappings from fragments? [message #385501 is a reply to message #385500] Wed, 25 February 2009 13:52 Go to previous messageGo to next message
Lars Fischer is currently offline Lars Fischer
Messages: 105
Registered: July 2009
Senior Member
Am 25.02.2009 14:14, schrieb James:
> I would assume that you have to explicitly list each orm.xml in the
> persistence.xml.

hmm, thats what I suspected. But this does not look like a good solution
to me. If I decide to deploy a new component as fragment, then I won't
edit the host-bundle. For this I can have one non expandable persistence
bundle which always has to be updated.

There is no such thing like the rcp-extensionpoints for eclipselink?

Thank you,
Lars
Re: multiple xml-mappings from fragments? [message #387089 is a reply to message #385501] Tue, 14 April 2009 19:17 Go to previous message
No real name is currently offline No real name
Messages: 2
Registered: July 2009
Junior Member
>> I would assume that you have to explicitly list each orm.xml in the
>> persistence.xml.
>
> hmm, thats what I suspected. But this does not look like a good solution
> to me. If I decide to deploy a new component as fragment, then I won't
> edit the host-bundle. For this I can have one non expandable persistence
> bundle which always has to be updated.
>
> There is no such thing like the rcp-extensionpoints for eclipselink?

Have you found a solution to your problem? I just ran into a similar
problem, when a spread my entities over several model-bundles.

regards,
Christian
Previous Topic:Having clause - more unexpected pickiness
Next Topic:@ManyToOne relation problem
Goto Forum:
  


Current Time: Wed Oct 22 22:30:00 GMT 2014

Powered by FUDForum. Page generated in 0.13452 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software