db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Waibel <arm...@apache.org>
Subject ODMG: Classes mapped on multiple joined tables cause problems
Date Sat, 10 Dec 2005 13:23:18 GMT
Hi all,

while preparing metadata test files for refactored "super"-reference
inheritance (classes mapped "on multiple joined tables") I stumbled
across a bug.

When insert objects using multiple joined tables OJB first insert the
base object and then copy the PK's of the base object to all sub-class
objects. Thus when using "multiple joined tables"-inheritance only the
base class should declare the PK's as autoincrement values (thereby it
should work with identity column based PK's too). This part
work without problems.

The consequence is that all "new" sub-class objects will have null
PK-fields till they will be inserted. This will cause problems with the
Identity objects of the persistence capable objects, because Identity
objects base on (the top-level class and) the PK values of the
persistence capable objects (all sub-class objects have 'null' PK's till
insert). But the odmg-implementation needs Identity for all "new"
objects before insert of the objects. This could affect all API's using 
some kind of "unit of work" (ODMG, OTM?, JDO?), the PB-api should not be 

Thus we need different kinds of Identity objects - Identity for
persistent objects and Identity for transient objects. A solution for 
all transient objects will be to generate a "transient Identity" object 
and after insert these transient Identity objects will be discarded and 
replaced by a persistent Identity objects.
Currently I try to implement such a solution.


To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org

View raw message