[jboss-user] [EJB 3.0] - Re: address CMP beans from session bean in other JAR but sam
sunstarnova
do-not-reply at jboss.com
Mon Nov 13 11:29:23 EST 2006
So, die Lösung ist gefunden:
-Man benötigt nur einen persistence.xml - Eintrag in dem JAR mit den Entities, die andere kann leer bleiben.
-Als Verweis benutzt man dann
| @PersistenceContext(unitName="../NAMEDESANDERENJARS.jar#PERSISTENCEUNITNAME") private EntityManager em;
|
Also z.B.
| @PersistenceContext(unitName="../teec-ios-persistence-ejb.jar#ios") private EntityManager em;
|
Das ganze ist dann in der JSR 220: Enterprise JavaBeansTM,Version 3.0 beschrieben und zwar in Abschnitt 16.10.2 (einfach suchen nach "#").
---------------------------------
UPS, just noticed I was qwriting in german - so again in english :-)
So, die Lösung ist gefunden:
-You only need a single persistence.xml - entry in the entity JAR, the other persitence.xml can stay empty.
-The reference works as follows
| @PersistenceContext(unitName="../NAMEDESANDERENJARS.jar#PERSISTENCEUNITNAME") private EntityManager em;
|
For example:
| @PersistenceContext(unitName="../teec-ios-persistence-ejb.jar#ios") private EntityManager em;
|
You can find more information here: JSR 220: Enterprise JavaBeansTM,Version 3.0 Paragraph 16.10.2 (just search for "#").
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985502#3985502
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985502
More information about the jboss-user
mailing list