Hi guys,
I've looked over the manual and the forum, and I'm still confused on how to get this to work.
Let's say I have two tables and want this setup:
Table 1 --> Table 3 < -- Table 2
In this case, Table 1 and Table 2 have a many to many relationship with Table 3 being the mediator.
I need Table 3 set up where it has these fields: Table1_id Table2_id column1; column2;
So basically, table 3 not only links table 1 and table 2 but it also has extra columns. I know Hibernate creates Table 3, the linking table, for me automatically. Is it possible to create a Java POJO for table 3 so it can hold those extra columns? And if yes, would I just create properties in there called Table1_id and Table2_id? I actually tried this but I couldn't get it to work, so I am hoping one of the gurus on this forum can help me.
How would I go about doing this?
For my project, I am not worried at all about retrieving the data, since the database is being used by a different program. I just need to populate the database.
|