This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Dout in @JoinColumn annotation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Dout in @JoinColumn annotation" Watch "Dout in @JoinColumn annotation" New topic
Author

Dout in @JoinColumn annotation

Satyajeet Kadam
Ranch Hand

Joined: Oct 19, 2006
Posts: 215
I am having Person table that is having one to one relationship with PersonDetail table.
Person.java


Perondetails


personDetailId is primary key in the Persondetail class and it is mapped to the personDetailId in Peron class which is foregin key.



I am getting the exception as below


Q1) Please kindly let me know what has gone wrong in using @JoinColumn?
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1638
    
  23

Hi,

Q1) Please kindly let me know what has gone wrong in using @JoinColumn?

The problem is not with the @JoinColumn, but with the @OneToOne annotation. Just place the @OneToOne above the getter:

Regards,
Frits
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dout in @JoinColumn annotation
 
Similar Threads
jpa problem
java.sql.SQLData - Oracle object mapping problem
org.hibernate.AnnotationException: mappedBy reference an unknown target entity property
Foreign key value null if nullable true in @OneToMany assoc
Value for JoinColumn in ManyToOne is getting inserted as Null