I have two classes mapped OneToMany, ManyToOne, and i get exception:
org.hibernate.AnnotationException: mappedBy reference an unknown target entity property:
entity_package.TicketEntity.ownerEntity in entity_package.UserEntity.ownedTickets
here is the code :
public class UserEntity implements Serializable {
@OneToMany(mappedBy="ownerEntity")
public List<TicketEntity> getOwnedTickets() {
return tickets;
}
public void setOwnedTickets(List<TicketEntity> tickets) {
this.tickets = tickets;
}
and …
public class TicketEntity implements Serializable {
private UserEntity ownerEntity;
@ManyToOne
@JoinColumn(name="owner_id")
public UserEntity getOwner() {
return ownerEntity;
}
public void setOwner(UserEntity owner) {
this.ownerEntity = owner;
}
whats wrong ?
The property name is
owneras defined by the annotated getter. Use: