Seems I managed to only reply to Michiel and not to the mailing list. Here it comes...
/Bengt ---------- Forwarded message ---------- From: Bengt Rodehav <[email protected]> Date: 2012/11/30 Subject: Re: Fw: Aries JPA modular design To: Michiel Vermandel <[email protected]> Thanks for your input Chrisitano. Michiel, I totally agree with you about the modularity problem. If you test the new features I would be really interesting in your findings here on the mailing list. Still, I do actually have some modularity in my applications and I have a couple of base clases in separate bundles. Sometimes I do keep my persistence.xml in a separate jar from the entity classes and it does work. I think that maybe compile time enhancing is what makes this work. I would, however, really appreciate some documentation from the Aries people what the requirements are and what works and what doesn't. It would make life a lot ease. Right now it's a lot of trial and error. /Bengt 2012/11/29 Michiel Vermandel <[email protected]> > Thank you for your response. > > I think, not taking technical difficulties into account, that this really > limits the use of OSGi for enterprise applications... > How can an application be modular if the data model cannot be modular. > > One more remark. I spoke to Holly > Cummins<http://www.devoxx.com/display/DV12/Holly+Cummins>and Timothy > Ward <http://www.devoxx.com/display/DV12/Timothy+Ward> at devoxx2012 and > they said that with the combination of Apache Felix 4.0.3 and Aries 1.0 one > could make fragments with entities because Aries 1.0 provides Annotation > scanning. > I really hope I can test this shortly. > Will come back on this if i get there. > > Regards, > > Michiel > > ----------------- > http://www.codessentials.com - Your essential software, for free! > Follow us at http://twitter.com/#!/Codessentials > ------------------------------ > *From:* Cristiano Gavião <[email protected]> > *To:* [email protected]; Michiel Vermandel <[email protected]> > *Cc:* Bengt Rodehav <[email protected]> > *Sent:* Thursday, November 29, 2012 1:32 PM > > *Subject:* Re: Fw: Aries JPA modular design > > Hi, actual osgi jpa spec is a bit limited. > I suggest you take a look at OSGi Compendium - JPA Service Specification. > page 733 > > > > > 1. A Persistence Bundle is a normal bundle; it must follow all the > rules of OSGi and can use all OSGi constructs like Bundle-Classpath, > fragment bundles, import packages, export packages, etc. *However, > there is one limitation: any entity classes must originate in the bundle’s > JAR, it cannot come from a fragment*. This requirement is necessary to > simplify enhancing entity classes. > > regards, > > Cristiano > > 2012/11/12 Michiel Vermandel <[email protected]> > > Thanks Bengt. > > Indeed I do hope that someone can shed some more light on this topic. > Any help is greatly appreciated. > > Michiel > > > > ----------------- > http://www.codessentials.com - Your essential software, for free! > Follow us at http://twitter.com/#!/Codessentials > ------------------------------ > *From:* Bengt Rodehav <[email protected]> > *To:* "[email protected]" <[email protected]>; Michiel Vermandel < > [email protected]> > *Sent:* Friday, November 9, 2012 3:22 PM > *Subject:* Re: Fw: Aries JPA modular design > > 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 > > > > > > > > > -- > "Tudo vale a pena se a alma não é pequena..." > > >
