• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Foreign key & EJB3

 
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm busy trying to visualize this JPA limitation:

JPA does not support unidirectional one-to-many relationships with the foreign key on the target table



So I devised the following unidirectional one-to-many relationship:


How would I go about ensuring that there IS a foreign key on the target table?Isn't this only possible by making this bi-directional?The way I understand it...the only way that a foreign key will be stored in "CHILD" table is if the Child entity has a reference to the Father entity ie. But doing this would make the relationship bi-directional,hence the limitation wouldn't apply!How else can a foreign key be specified?
 
Greenhorn
Posts: 15
Eclipse IDE Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Duran:

Reviews:

https://coderanch.com/t/163738/EJB-Certification-SCBCD/certification/EJB-Action-JPA

By.
 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks that explained it nicely
 
Dinner will be steamed monkey heads with a side of tiny ads.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!