You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Nima Kaviani <ni...@gmail.com> on 2012/03/28 00:24:13 UTC

Separate Modules for JPA Bean entities in Aries Applications

Hi guys,

First of all, hats off for the great job with Aries. I have recently come
across the project and have found it very interesting.

I am playing with the Aries Trader application and have a question
regarding the JPA entities. I realized all the implementations for JPA
entities in the Trader application are put together under an "entities"
bundle along with the persistence.xml file. Would there be a way to
separate these entities from one another and place them into separate
bundles? I did the separation for the code units but I am not sure if
persistence.xml can be modified or replicated so that I can define separate
metadata for each of the entities and then make it recognizable to the JPA
container.

If you wonder why I need this, I am trying to use something like Apache CXF
to separate the bean entities and distribute them (along with their DB
tables) across multiple machines, for which I need the bean entities to be
placed into separate modules.

Would be great if someone could shed some light on the feasibility of what
I am trying to do.

thanks,
-Nima

-- 
http://nima.magic.ubc.ca

Re: Separate Modules for JPA Bean entities in Aries Applications

Posted by David Jencks <da...@yahoo.com>.
I'm not 100% sure I understand your intent.

If  a jpa class has a reference to another jpa class, they need to be used with the same persistence.xml (and, in aries,  be in the same bundle).  Jpa doesn't deal with relationships between entities in different persistence units.

If you can partition the entity classes  into sets that don't refer to each other, then you can have a persistence.xml (and a bundle) for each set.

I haven't looked at trader recently enough to recall if there are any partitions like this.

hope this relates to what you are asking about...
david jencks

On Mar 27, 2012, at 3:24 PM, Nima Kaviani wrote:

> Hi guys,
> 
> First of all, hats off for the great job with Aries. I have recently come across the project and have found it very interesting.
> 
> I am playing with the Aries Trader application and have a question regarding the JPA entities. I realized all the implementations for JPA entities in the Trader application are put together under an "entities" bundle along with the persistence.xml file. Would there be a way to separate these entities from one another and place them into separate bundles? I did the separation for the code units but I am not sure if persistence.xml can be modified or replicated so that I can define separate metadata for each of the entities and then make it recognizable to the JPA container.
> 
> If you wonder why I need this, I am trying to use something like Apache CXF to separate the bean entities and distribute them (along with their DB tables) across multiple machines, for which I need the bean entities to be placed into separate modules.
> 
> Would be great if someone could shed some light on the feasibility of what I am trying to do.
> 
> thanks,
> -Nima
> 
> -- 
> http://nima.magic.ubc.ca