Hi Pinaki, the meaning of the YPDatabaseItem is to hide out all database relevant variables like the primary key id and the db version field. further it simplifies some methods in my reader and writer class, because i can use generified access to the classes. Each Class except YPDatabaseItem has its own table. openJPA built the design for that database structure from this mapping file. i just refined the field length and set some indexes... with other JPA frameworks it works also fine. i just have these referencing problems with openJPA. I intend to have a table for YPInstanceItem, YPEntityClass, YPParameter, the association table between entity and parameter and the 2 other "single" opbjects.
well in general it works... there were some calculations before using the parent instance, but somewhen it stops because of a NullPointerException. it looks like a data container ran into an overflow, threw away some database objects and didn't reload them as they were accessed. as i wrote before: when i load them, everything is well referenced. i have breakpoints in setInstanceParent (never hit), field instanceParent changes (never hit) and while loading i have a breakpoint that should hit, when instanceParent is null but its no root element (also never hit). i just suddenly hits a general NullPointerException breakpoint when a method is trying to access a missing reference. the object is each time a different one, so its not restricted to a special instance or object. when i look into the database i always see the references well defined. i also tried to exchange the JPA implementator. with e*** ;-) there are no problems like this. anyways i need to get it running with openJPA. newly occured is: the entities collection also disappeared?! so i tried a synthetic test setup where i load many YPInstanceItem objects into a set and print out in a loop if it has a parent or not and if it is a root element. the first items were complete, but after some items (i guess 100... need to count) the references were missing again... for each following object... if you think, using <inheritance> and <discriminator...> could help in that way, can you give an example, where i need to put this <inheritance> and <discriminator...> stuff? can you please make an example for the superclass and one derived class? its openJPA 1.2.2 by the way... thanks a lot for helping! Gerald -- View this message in context: http://openjpa.208410.n2.nabble.com/Parent-reference-is-loaded-but-disappears-while-working-with-the-object-tp5728025p5740577.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
