openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Vorburger" <>
Subject NULL in @Id columns leads to "disappearing" objects
Date Wed, 11 Nov 2009 17:56:54 GMT
Hello again!

We are working with an existing ('legacy') DB schema where columns which
are part of a "logical" (there is no physical PRIMARY KEY CONSTRAINT)
composed primary key (mapped in JPA via an @IdClass) CAN BE NULL.
Neither the JPA Spec nor any OpenJPA documentation says that this is not
permitted or requires that all @Id field never be null...

... but OpenJPA "looses" such objects when mapping in ResultSets - i.e.
you get Query result Lists containing null elements!  Attached is a
small test case project, hopefully illustring this well (if the ZIP
makes it through the list?).

Any ideas how to "work-around" this on the (Open)JPA side (assume I
can't do much about the 10 year old legacy schema installed 120 client
sites :) ?  Can you think of any other mapping approaches than a
straightforward @IdClass as shown in the attached example? Otherwise...
do you confirm / agree that this is a bug? Easy to fix?? ;)

Regards & lot's of thanks for feedbacks,
Michael Vorburger


 This email and any files transmitted with it are CONFIDENTIAL and intended
  solely for the use of the individual or entity to which they are addressed.
 Any unauthorized copying, disclosure, or distribution of the material within
  this email is strictly forbidden.
 Any views or opinions presented within this e-mail are solely those of the
  author and do not necessarily represent those of Odyssey Financial
Technologies SA unless otherwise specifically stated.
 An electronic message is not binding on its sender. Any message referring to
  a binding engagement must be confirmed in writing and duly signed.
 If you have received this email in error, please notify the sender immediately
  and delete the original.
View raw message