Hi,
i have 2 class (one To Many):
Classe Vehicules
Quote:
...
private Person person;
...
private Set<Vehicules> vehicules = new HashSet<Vehicules>(0);
...
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PERS_ID", nullable = false)
public Person getPerson() {
return this.Person;
}
public void setPerson(Person person) {
this.person = person;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "Vehicules")
public Set<Vehicules> getVehicules() {
return this.Vehicules;
}
public void setVehicules(Set<Vehicules> vehicules) {
this.vehicules = vehicules;
}
and class Person
Quote:
...
private Set<Vehicules> vehicules = new HashSet<Vehicules>(0);
@OneToMany(fetch = FetchType.LAZY, mappedBy = "Person")
public Set<Vehicules> getVehicules() {
return this.vehicules;
}
public void setVehicules(Set<Vehicules> vehicules) {
this.vehicules = vehicules;
}
and with a junit test case (with getPerson for example), i always have this error :
nested exception is org.hibernate.AnnotationException: mappedBy reference an unknown target
entity property: package.domain.Vehicules.Person in package.domain.Person.Vehicules
for me, all is mapped correctly, if you have any idea...
Thanks