atom feed2 messages in org.apache.incubator.aries-userRe: Separate Modules for JPA Bean ent...
FromSent OnAttachments
Nima KavianiMar 27, 2012 3:24 pm 
David JencksMar 27, 2012 4:13 pm 
Subject:Re: Separate Modules for JPA Bean entities in Aries Applications
From:David Jencks (davi@yahoo.com)
Date:Mar 27, 2012 4:13:29 pm
List:org.apache.incubator.aries-user

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.

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