db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Markus.Lau...@bedag.ch>
Subject Problem with Inheritance and autoincrement=false
Date Thu, 09 Jun 2005 09:45:46 GMT

We use inheritance Mapping as described in
So ClassB inhertits from ClassA. The only difference i see to the
example is that my classB doesn't have a field id because it inherits
ist from classA.

It is mapped in the the following way in class B:

<reference-descriptor name="super"
auto-retrieve="true" auto-update="true" auto-delete="true">
<foreignkey field-ref="id" /> 

With autoincrement=true this works fine. The Id is automatically created
and the classB stored on two tables.
For migrating from an older system we now have to set the id manually,
so we set autoincrement=false for both classes.
The result is, that the Record in TableB is inserted correctly but when
storing the Record in TableA the ID is null, so a sql exception is
thrown because the primary key must not be null.

Does anyone have a solution for this?

Thanks, Markus

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message