I want to connect table based on one direction join, here is my code:
Class Person {
@id
String person_sk;
int person_id;
String Person_name;
@OneToMany
@joinColumn (name="person_reference_id")
List<address> getAddresses() {}
}
class Address
{
@id
int person_reference_id (referred from Person);
@id
int address_id;
@id
int phone_id;
String street_name, zip_code;
}
Now when I do getAddress, it does not work, because my join is based on person_ref_id and @id (primaryKey) column in Person class is person_sk.
If I use referencedColumn then also it doesn't work.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…