You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Matt Madhavan <ma...@gmail.com> on 2011/04/07 20:38:05 UTC
Question on Aries Extensions - JPA persistence injection etc
Hello,
I have found some references to Aries extensions like JPA annotations etc in
couple of places. For instance the IBM redbook talks about Blueprint-based
injection of persistence services:
I cannot find any information on this. Can some one point me to the right
source of documentations please?
Any information at this point will be helpful.
Thanks
Matt
Re: Question on Aries Extensions - JPA persistence injection etc
Posted by Valentin Mahrwald <vm...@googlemail.com>.
Hi Matt,
a bit is mentioned in http://aries.apache.org/modules/jpaproject.html, which is under the general Documentation -> Programming Model link.
It's not particular verbose about injection in particular though :) Basically it comes in two flavours, for both the namespace to use would be
http://aries.apache.org/xmlns/jpa/v1.1.0.
a) Container managed JPA (injecting an EntityManager)
This looks something like
<bean class="PersistenceService">
<jpa:context property="entityManager" unitname="pu" />
</bean>
for a persistence unit "pu" and a bean PersistenceService with a void setEntityManager(EntityManager em) method. Or for constructor
injection a la PersistenceService(EntityManager em):
<bean class="PersistenceService">
<jpa:context index="0" unitname="pu" />
</bean>
There is also support for using a nested map element (from the standard Blueprint namespace) to specify properties for the persistence context.
b) Application managed JPA (injecting an EntityManagerFactory)
Similar to the above:
<bean class="PersistenceService">
<jpa:unit property="entityManagerFactory" />
</bean>
for a PersistenceService bean with method setEntityManagerFactory(EntityManagerFactory). Constructor injection works as well.
By default in any of these cases transaction scope is assumed for the persistence unit. For extended persistence unit use a type="EXTENDED".
Injection by annotation on the other hand is currently not available in Aries as opposed to the feature pack that the redbook talks about.
Hope this helps,
Valentin
On 7 Apr 2011, at 19:38, Matt Madhavan wrote:
> Hello,
> I have found some references to Aries extensions like JPA annotations etc in couple of places. For instance the IBM redbook talks about Blueprint-based injection of persistence services:
>
> I cannot find any information on this. Can some one point me to the right source of documentations please?
>
> Any information at this point will be helpful.
>
> Thanks
> Matt
>