Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Foreign key contraints from optional bundles
Foreign key contraints from optional bundles [message #494637] Sun, 01 November 2009 14:31 Go to next message
Eclipse UserFriend
Originally posted by: d.van.buuren.domedia-it.nl

Hi there,

Just returned from ESE where I attented a presentation about Eclipselink.

I'm currently exploring the possibilities of eclipselink for our
application (OSGi based).

We need the possibility to start extra (say optional) bundles that must
be able to create a foreign key contraint to objects from within the
core product. Say we export the package in one of the core bundles where
a User implementation resides in and we want to contribute a bundle
with a class that needs to be persisted with a reference to a User.

Is this possible?
Can someone point out how to accomplish this?

Thanks in advance for your answer.

Dobias
Re: Foreign key contraints from optional bundles [message #494821 is a reply to message #494637] Mon, 02 November 2009 19:26 Go to previous messageGo to next message
Shaun Smith is currently offline Shaun SmithFriend
Messages: 197
Registered: July 2009
Senior Member
Hi Dobias,

Great to hear you were inspired to give EclipseLink in OSGi a try!

If you want to create a new application that uses existing Entities along with a new Entities you can certainly do so.

Say you have:

Bundle A:
src\<A Entities>
META-INF\persistence.xml

Bundle B:
src\<B Entities>

Bundle C:
META-INF\persistence.xml
META-INF\orm.xml

If Bundle C has visibility of A and B then C's persistence.xml could include Entities from A and B. This approach composes together the original with the additional Entities.

Augmenting Bundle A's persistence unit is problematic for a number of reasons. Hopefully the composition solution works for you.

--Shaun
Re: Foreign key contraints from optional bundles [message #494844 is a reply to message #494821] Mon, 02 November 2009 22:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: d.van.buuren.domedia-it.nl

Hello Shaun,

Thanks for your answer. I'm glad something like this can be done. I will
have a look at the xml configuration options and give it a try later on.
Do i understand you correctly that i cannot use the annotated way of
configuring my entities?

Dobias
Re: Foreign key contraints from optional bundles [message #495044 is a reply to message #494844] Tue, 03 November 2009 16:00 Go to previous message
Shaun Smith is currently offline Shaun SmithFriend
Messages: 197
Registered: July 2009
Senior Member
Quote:
Do i understand you correctly that i cannot use the annotated way of
configuring my entities?



You can definitely use annotations.

--Shaun
Previous Topic:Query historical data with JPA
Next Topic:Classloading issue w/ TempEquinoxEntityLoader
Goto Forum:
  


Current Time: Fri Nov 28 06:15:24 GMT 2014

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

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