permaculture playing cards*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes @ManyToOne & @JoinColumn 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 "@ManyToOne & @JoinColumn" Watch "@ManyToOne & @JoinColumn" New topic
Author

@ManyToOne & @JoinColumn

Musab Al-Rawi
Ranch Hand

Joined: Aug 06, 2007
Posts: 231
I am new to EJB and JPA and I need your help please.

Suppose that we have two Entities A (mapped to DB table A with Pk field named id)
and B (mapped to a DB table B with FK a_id that references A.id in a many to one relationship)

in entity class A I have:


in entity class B I have:


Based on my understanding that should work but Eclipse is giving me referenced column "id" in join column"a_id" cannot be resolved.
I checked eclipse's manual and it says that i need to make sure that the column exists in DB and it does, so why am I getting that error?

Your help is greatly appreciated,
Musab


SCBCD - SCWCD - SCJD - SCJP - OCA
Musab Al-Rawi
Ranch Hand

Joined: Aug 06, 2007
Posts: 231
I posted this topic here, please answer it there (if you want to) as I think it would be more appropriate.
[ September 23, 2008: Message edited by: Musab Al-Rawi ]
 
Consider Paul's rocket mass heater.
 
subject: @ManyToOne & @JoinColumn
 
Similar Threads
Many to One instead of One to One relationship
JPA self refrencing relationship problem...HELP Needed
@ManyToMany, @ManyToOne, Join Tables
@ManyToOne & @JoinColumn
One to one mapping issue