Two collections manyToOne to same primary key
Posted
by Ethiel
on Stack Overflow
See other posts from Stack Overflow
or by Ethiel
Published on 2010-04-12T22:04:07Z
Indexed on
2010/04/13
4:23 UTC
Read the original article
Hit count: 226
Hi, guys,
I'm coding a web page in Hibernate-JPA and Oracle.
I need the following:
I have two classes: Place and Home.
I need two collections of type Place in every Home: I do the following:
Home:
@ManyToOne
@JoinColumn(name="ID_PLACES")
private List<Places>places1;
@ManyToOne
@JoinColumn(name="ID_PLACES")
private List<Places>Places2;
However, hibernate got an exception (repeated column) and forces to me to mapping with insert and update to false.
How Can I get Two ManyToOne relationship to same primary key with insert a true?.
© Stack Overflow or respective owner