I should start out by saying that I am fairly new to Java EE and that I do not have a strong theoretical background in Java yet.
I\'m having trouble grasping how to use
You can use targetEntity property in the relationship annotation.
@Entity
public class PersonEntity implements Person {
private Long id;
private Pet pet;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Override
@OneToOne(targetEntity = PetEntity.class)
public Pet getPet() {
return pet;
}
public void setPet(Pet pet) {
this.pet = pet;
}
}