Hi, I thank you for this solution which appears tempting, but my superior want imperatively that I use EJB3 with JBoss 4.0.4 and hibernate. would have an other solution? I thank you in advance
Um, my solution is using EJB3 and Hibernate. Check out the documentation on mapping Many to Many.
Mark
Dupon David
Greenhorn
Joined: Aug 11, 2006
Posts: 19
posted
0
Hi, In fact, the annotation @ManyToMany does not function for my case, because my table WASNMI is not simply a table of joint, but it contains of another fields that the foreign keys.
I implemented as follows:
TermSource and SnomedInter must have a collection of TermProj, and not of TermProPK. In the same way, TermProj must only have a direct bond towards 1 TermSource and 1 SnomedInter in addition. It is HIBERNATE which is given the responsability to manage the keys themselves! Us, only the objects are managed.
TermSource :
SnomedInter :
TermProjPk :
TermProj :
it remains me to be known how I can reach a SnomedInter object to leave a TermSource object!! I tested implementer as follows:
an idea?
[ November 17, 2006: Message edited by: Dupon David ]
[ November 17, 2006: Message edited by: Dupon David ] [ November 17, 2006: Message edited by: Dupon David ]
Mike Keith
author
Ranch Hand
Joined: Jul 14, 2005
Posts: 304
posted
0
David,
You keep looking for an answer, but you don't seem to be paying attention to the answers you are getting. You certainly didn't seem to even look past the basic chapter on OR mapping in our JPA book. Take a look in Chapter 8. There is a "Mapping Relationship State" section there that discusses your exact association table situation.