I'm also very interested in how to build modular applications using JPA.
Not sure if that is an Aries issue or (in my case) an OpenJPA issue. I
don't find JPA itself very supportive of this concept:

The persistence.xml mixes concerns that have to do with the actual database
settings (not the URL but the configuration of OpenJPA e g what dictionary
to use) with concerns regarding the domain model. I want to isolate
database settings to a separate bundle altogheter. I would then like
different bundles to add OpenJPA enhanced classes working against this
database (that is defined somewhere else). To me JPA seems slightly
monolithic in its design. This shows very clearly when using an OSGi
runtime.

Also, I use annotations in my persistent domain classes. However, it's do
to this in a database type independent way. I can't really switch from
Derby to SQLServer without actually changing the source code. I would like
this to be a runtimer decision and have my code support both options (e g
by having multiple versions of the annotation and some kind of qualifier
that can be specified in runtime).

Another related issue is how to distinguish between simple
out-of-contiainer unit tests and in-container integration tests. They need
different perstence.xml. What is the recommendation regarding this? In what
bundle should the persistence.xml bu put? The data source bunde (should
only be one)? The domain classes bundle (several)? Its own bundle? The
integration test bundle?

Hope you get some good replies because modularity is an extremely important
subject when using OSGi.

/Bengt




2012/11/9 Michiel Vermandel <[email protected]>

> Hi,
>
> Does anyone have an idea?
>
> Thanks
>
> -----------------
> http://www.codessentials.com - Your essential software, for free!
> Follow us at http://twitter.com/#!/Codessentials
>   ----- Forwarded Message -----
> *From:* Michiel Vermandel <[email protected]>
> *To:* "[email protected]" <[email protected]>
> *Sent:* Monday, November 5, 2012 2:22 PM
> *Subject:* Aries JPA modular design
>
> Hi,
>
> Despite many posts that touch this issue more or less it is still not
> clear to me if it is possible to create a modular model with Aries JPA.
> (modular = multiple bundles with own entities and persistence.xml that may
> have referential dependencies)
>
> Let's say I want to make an application to manage contacts.
>
> Assumtions : All data resides in one database(!).
>
> The application has one required bundle:
> Contacts - provides all usual data about contacts (for example name,
> email, phone-number)
>
> Is it possible to have a second bundle (that can be provided as a optional
> extension to the application) which contains communication information with
> the contacts?
> This bundle would contain its own Entities (CommunicationEntry,...) (and
> persistence.xml) which refer to a contact.
>
> The Application thus must be runnable with or without the second bundle.
>
> Thanks,
>
> Michiel Vermandel
>
> -----------------
> http://www.codessentials.com - Your essential software, for free!
> Follow us at http://twitter.com/#!/Codessentials
>
>
>

Reply via email to