i have three entities as below:
- Property
- Property_Document
- Property_User
Property
and Property_Document
have a One to Many relationship.
Property
and Property_User
has One to One relationship.
At the database level, Property_User has foreign key "property_id", back to the Property table.
I am using annotations to define the mappings and relationships between the entities.
Property.java
public class Property {
//.....
@OneToMany(cascade=CascadeType.ALL)
@JoinColumn(name="property_id")
private List<PropertyDocuments> docs;
@OneToOne(cascade=CascadeType.ALL)
private PropertyUser owner;
//....
}
PropertyUser.java
public class PropertyUser {
@Id
private int id;
@column
private String name;
//......
}
When it fetches the property, document list fetches successfully but when it tries to fetch the user information it shows below error message.
column: owner_id doesn't exist.
Please help. Thanks.