The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

AntonioJSG (16) [Avatar] Offline
#1
I am using Eclipse Link 1.2. on Glassfish 2.1

I want to ask,

Why has the foreign key be part of the primary key on OneToMany relationships ?

If I try to persist an Object with a one to many relationship, if one of the referenced column names is not part of the primary key on the Many side of the relationship, the field value is not set, so a database error occurs.

I have documented it on this thread.

http://www.manning-sandbox.com/thread.jspa?threadID=36656

I do not know If I an doing something wrong or the JPA should include this kind of mapping.

Regards

Antonio