File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why referencedColumnName element missing in Joined table startegy

 
Karnati Sudhakar
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Amandeep Singh
Ranch Hand
Posts: 850
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mellon Sun
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic