I always confuse in mapping ie Using of @OneToOne , @PrimaryKeyJoinColumn , @JoinColumn. On which side of entity class these annotations are used. And how to mark the entity class as Parent and Child class ?
Guddu Ali wrote:I always confuse in mapping ie Using of @OneToOne , @PrimaryKeyJoinColumn , @JoinColumn. On which side of entity class these annotations are used. And how to mark the entity class as Parent and Child class ?
Then you should definitely bookmark the Java Persistence WikiBook. It's an awesome resource with tons of code examples (using both XML and annotations). Here you'll find the OneToOne relationship.