setting attributes in many to many relations
in my problem i have two entities A , B they have many to many relation
pesodo code
class A
{
//Code
....
Set<B> bs;
}
class B
{
//Code
....
Set<A> as;
}
Session Bean:-
A a = new A();
Set<B> bs = new Set<B>();
bs.add();
a.setBs(B);
entityManager.persist(a);
this is not a real code!!!
i run this code
it added to dataBase the attributes that have one to one mapping or one many, but it didn't add the many to many relation and many to one
i hope that any one understand this problem
i am struggling on it
if any one have a sample code it would be great
Thank's in advance

