Usually, When you are using Many-to-Many
, you need to create additional table for this relationship. But now, I do not have any idea why you are using one-to-many with creating new table (why? it is unnecessary). And the answer will be yes, you can join some additional columns to your table with @JoinColumn
annotation. And pay attention if you really need bidirectional relationship :) Good luck
edited:
Is there an elegant way to do this with Java, without adding additional
fields through altering tables?
What do you mean by saying 'altering'? Don't you let Hibernate to create it auto with using hbm2dll?