File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes why referencedColumnName element missing in Joined table startegy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "why referencedColumnName element missing in Joined table startegy" Watch "why referencedColumnName element missing in Joined table startegy" New topic
Author

why referencedColumnName element missing in Joined table startegy

Karnati Sudhakar
Ranch Hand

Joined: Aug 26, 2008
Posts: 270

Hi All,

In EJB in Action book on page number 288 the Joined Table strategy is explained and it is implemented by the OnetoOne relationships between the Child and parent class.

Here the code given on this page



I just want to know why the referencedColumnName element is missing in the @PrimarykeyJoinColumn annnotation.

Regards
Sudhakar


Regards
Sudhakar
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
Don't worry, even if referenceColumnName attribute is missing. It will join with the primary key's of other table's. It's a default behaviour.


SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
Mellon Sun
Ranch Hand

Joined: Feb 20, 2003
Posts: 126
http://www.coderanch.com/t/418895/java-EJB-SCBCD/certification/type-JoinColumn

It seems like referencedColumnName element can be missing in @OneToOne @JoinColumn too. What confusing me is when I point out the referencedColumnName I encounter an error because the referenced column is generated with a wrong type.


SCJP,SCWCD1.3,SCWCD1.4,SCJD,SCBCD5,SCEA5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why referencedColumnName element missing in Joined table startegy