Hi Michael, On Tue, Nov 17, 2009 at 2:45 AM, Michael Vorburger < [email protected]> wrote:
> > Can we interpret No Answer on this one from anybody as a Not Support / > Not Interested / Go away? ;-) > Interested, but in the middle of other things - will take a closer look when the day job permits me (sound fair)? > If this cannot be supported (?), would it fair to suggest at least > decent error handling for null values in @Id attributes? > Agree. At first glance I think we can support this, but haven't looked at it enough to really understand the problem. > Are any clarifications needed (c.f. initially attached unit test) ? > The unit test was very helpful. In my initial read I thought you meant a completely null ID, testcase set me straight there. No easy answer for you though.. -mike > Thanks. > > > -----Original Message----- > From: Michael Vorburger [mailto:[email protected]] > Sent: Wednesday, November 11, 2009 6:57 PM > To: [email protected] > Subject: NULL in @Id columns leads to "disappearing" objects > > 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. > > ____________________________________________________________ > > • 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. >
