This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "@ManyToOne & @JoinColumn" Watch "@ManyToOne & @JoinColumn" New topic

@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 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 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 ]
I agree. Here's the link:
subject: @ManyToOne & @JoinColumn
jQuery in Action, 3rd edition