This content has been marked as final.
Show 2 replies
-
1. Re: Many to many plus additional value
alximik Feb 7, 2006 3:34 AM (in response to chrismalan)Try this
@Entity public class Flights_Customers{ @ManyToOne private Flight flight; @ManyToOne private Customer customer; ........... } @Entity public class Customer{ @OneToMany(mappedBy="customer") private Collection<Flights_Customers> flights_Customers; ........... } @Entity public class Flight{ @OneToMany(mappedBy="flight") private Collection<Flights_Customers> flights_Customers; }
-
2. Re: Many to many plus additional value
chrismalan Feb 7, 2006 11:33 AM (in response to chrismalan)Thanks Alximik,
I suppose one will then get all the customers for a flight (or vice versa) straight from the relationship table. I am quite sure this may actually work.
Thanks again.
Chris