« Return to Thread: Join Table with additional columns: One SQL Select to fetch data?

Join Table with additional columns: One SQL Select to fetch data?

by Joe Mc. :: Rate this Message:

Reply to Author | View in Thread

Hi,

I am playing with additional columns in join tables.
The following example:
Customer visits some Courses
This n-m-Relation contains additional attributes in the n-m-table (join table), for example: note, year etc.

One solution is to use @OneToMany and @ManyToOne with a concret join table in Java, insteed of @ManyToMany.
In this Association class, is it possible to hold the additional columns
This solution is fine and worked.

In @ManyToMany is it possible to tell EclipseLink, that he use only ONE Select statement, to get all the data from the different tables (with outer joins etc.).
Is it possible to do this now with the OneToMany and ManyToOne?

At the moment I get a join of Customer and Courses. And EclipseLink fires for every Course, the customer holds, an additional SQL SELECT statement to get the data :-(

I general: I want the same SQL SELECT statement as in the ManyToMany case. Is it possible?


Thanks for any advice!

Regards

M.Joe

 « Return to Thread: Join Table with additional columns: One SQL Select to fetch data?