Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » jpa entities in different bundles under virgo
jpa entities in different bundles under virgo [message #676867] Mon, 06 June 2011 19:25 Go to next message
attila Mising name is currently offline attila Mising name
Messages: 45
Registered: April 2010
Member
Hi,

Did anybody try under Virgo to split a jpa entities bundle in more bundles ?

For example there are 2 bundles jpa-bundle1 with Entity1 and jpa-bundle2 with Entity2
Entity2 has a reference field to Entity1. Both entities should be part of the same persistence unit.

Now i'd like to create an EntityManager in bundle-3 and pass it to other bundles (bundle 4,5 .. ) without explicitly import the jpa bundles in bundle-3

Any comments ?

Thank you
Re: jpa entities in different bundles under virgo [message #683347 is a reply to message #676867] Mon, 13 June 2011 15:01 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 272
Registered: January 2010
Senior Member
Hi attila,

What you probably need to do is an extender bundle as bundle-3 (the one that publishes EntityManager). Once deployed such bundle will need to listen for bundle events and make a decision on when to publish EntityManager once all of the requirements for a complete persistence unit are met. This is fairly tricky as bundle can come and go at any time.

Can you please explain why you would not want to import jpa1 and jpa2 packages into bundle-3?

Another approach is to use virgo scoped deployment where entities referenced in the persistence.xml will be visible on TCCL.

Regards,
Dmitry
Re: jpa entities in different bundles under virgo [message #685495 is a reply to message #683347] Fri, 17 June 2011 16:20 Go to previous message
attila Mising name is currently offline attila Mising name
Messages: 45
Registered: April 2010
Member
Thank you Dmitry,

the goal of this approach is something like this:

provider 1 creates base application with jpa-bundle 1
provider 2 creates extension for application with jpa-bundle 2

and the final user/customer presumably without much technical skills should be able to activate or not the extension.

Of course if there is an extension at model level is very likely to be also at the other layers (service, user-interface , etc) and then it can publish its own service/entityManager and notify the base application's extension points in a way or other. This works fine, i was just interested about other options.

The first idea i thought of was something similar to your event listener proposal and somehow i didn't feel very comfortable even to try it Smile.

I don't see however what you mean with the second one Embarrassed , could you please give me a hint/link ?


Thank you

[Updated on: Fri, 17 June 2011 16:36]

Report message to a moderator

Previous Topic:Tips on How to Integrate Felix GoGo, SSH, dan Gemini Blueprint to Eclipse Virgo
Next Topic:Tomcat 7.0 Released
Goto Forum:
  


Current Time: Sat Oct 25 06:34:03 GMT 2014

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

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