Hello.
I have three entity beans in my model (A,B) with a n/m relationship between A
and B.
How to model this properly ?
I'm currently designing A as BMP bean, B as CMP bean. So, in a bean
class, i have:
int oid
vector of B objects Bvector
ejbCreate(){
store A in main table
for every object in Bvector{
check if object already exist
if false, then create it
store an entry in crossing table
}
}
ejbRemove(){
delete entry in main table where key=oid
delete entries in crossing table where a_key=oid
}
}
ejbLoad(){
load A from main table
for every result from select request on crossing table{
look for B object using b_key just queried
}
}
ejbStore{
update entry in main table where key=oid
delete entries in crossing table where a_key=oid
for every object in Bvector{
store an entry in crossing table
}
// Quicker than comparing set of a query result with the stored references
}
All this seems to be a bit heavy... Is there any cleanest solution ? I read
from handles in EJB specification, but i didn't find any clue on how to use
them in practice.
--
Guillaume Rousse
Iremia - Universit� de la R�union
15 avenue Ren� Cassin, BP 7151
97715 Saint Denis, messagerie cedex 9
Tel:0262938330 Fax:0262938260 ICQ:10756815
And now, some words for our sponsor :
Explosives, guns, assassination, conspiracy, primers, detonators, Kakadan,
initiators, main charge, nuclear charges, ambush, sniping, motorcade, IRS,
ETA, FARC, Cuba, Castro, Che Guevara, revolution, ATTAC, BATF, jtf-6...
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".