Hi, What goes into the value column?
> Should I define the mapping as A (OneToMany) A_B (ManyToOne) B and > create an object for A_B? If so, how do I do that? You certainly could take that approach. You'd just set up a pair of one-to-many relations from A to A_B and B to A_B; you wouldn't need to do anything special to make it work. -Patrick On 9/6/07, Christian Defoy <[EMAIL PROTECTED]> wrote: > Hello, > > I have two objects, A and B, that are involved in a many to many > relationship. That portion works ok if class A contains: > > @ManyToMany( fetch=FetchType.EAGER, cascade=CascadeType.ALL ) > @JoinTable( name="a_b", [EMAIL PROTECTED]( name="a_id", > referencedColumnName="a_id" ), > [EMAIL PROTECTED]( name="b_id", > referencedColumnName="b_id" )) > private Set<B> mappedBs; > > My problem is that the relationship between A and B must contain an > additional value. The join table between A and B looks like this: > > create table A_B > ( > a_id integer not null, > b_id integer not null, > value integer > ); > > Should I define the mapping as A (OneToMany) A_B (ManyToOne) B and > create an object for A_B? If so, how do I do that? > > Thanks in advance! > > Christian > -- Patrick Linskey 202 669 5907
