Hi,

I had a similar problem. You may want to have a look at the "Problem mapping
inheritance hierarchy using joined tables for subclasses" thread on this
list (last post 2003-12-05) or at the "Extents and the various inheritance
hierarchy mappings" thread at the dev-list. I do not think, this is fixed in
rc5. If you want to materialize the sub-class, it needs to be declared as
extent of the superclass. Yet, it is not possible to use extent defintions
for joined subclasses if primary keys serve as foreign key in the subclass.
It may work if you have an additional foreign-key column in your subclass
(making the primary keys unique).

Peter

> Hi,
> I'm trying to map inheritance to multiple joined tables, but something is
> going wrong.
> It inserts ok, but when loading, it materializes the superclass, instead
> of subclass.
> Important:
> 1) I am NOT using extents;
> 2) I am not declaring attributes (_id, in this case, which is is primary
> key and serves also as foreign key) in the subclass in the object model.
> 3) I have tried the anonymous field approach, but it materializes the
> superclass too.

> I believe I am facing a configuration mistake, so these are the
> class-descriptors:

> <!--SUPERCLASS -->
> <class-descriptor class="com.jma.interescola.core.User" table="user_1">

>  <field-descriptor id="1" name="_id" column="id" jdbc-type="INTEGER"
>  primarykey="true" autoincrement="true"/>
>  <field-descriptor id="2" name="_name" column="name" jdbc-type="VARCHAR"/>

> </class-descriptor>

> <!--SUBLASS -->
> <class-descriptor class="com.jma.interescola.core.Student"
> table="student">
>  <field-descriptor id="1" name="_id" column="id" jdbc-type="INTEGER"
>  primarykey="true" autoincrement="true"/>

>  <reference-descriptor auto-retrieve="true" auto-update="true"
>  auto-delete="true" name="super"
>  class-ref="com.jma.interescola.core.User">
>   <foreignkey field-ref="_id"/>
>  </reference-descriptor>
> </class-descriptor>

> Please, any help or suggestion would be great.
> If this is a bug, anyone knows if the release rc5 fixed it?
> Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to