Nils Liebelt wrote:
The problem seems to be that for storing/materializing an instance of Individual, a concrete instance of the type referenced by the super-reference is needed. But since this class is abstract, no such object can be built. While this scenario may sound feasible in Java terms (because the fields of Contact are duplicated in Individual), when mapped to a reference OJB's behaviour actually makes sense because the mapping is a 'normal' reference. Only there is no concrete field to implement the reference on the Java side, but rather an anonymous field is used by OJB to store the end of the reference (an instance of Contact) and the values of this object are then used for the Individual instance.Hi,
I am struggling with a simple extend of an abstract class, trying to use multiple joined tables.
I get following MetadataException: Can't create new base class object for 'za.co.ibn.datasolutions.entities.Contact'
A soon as I remove the abstract modifier everything works.
Here's my Repository:
<class-descriptor
class="za.co.ibn.datasolutions.entities.Contact"
table="Contact"
<field-descriptor
name="contactID"
column="contactID"
jdbc-type="INTEGER"
primarykey="true"
autoincrement="true"
>
</field-descriptor>
<field-descriptor
name="address"
column="address"
jdbc-type="VARCHAR"
length="254"
>
</field-descriptor>
</class-descriptor>
<class-descriptor
class="za.co.ibn.datasolutions.entities.Individual"
table="Individual"
<field-descriptor name="contactID" column="contactID" jdbc-type="INTEGER" primarykey="true" autoincrement="true" > </field-descriptor> <reference-descriptor name="super" class-ref="za.co.ibn.datasolutions.entities.Contact" auto-retrieve="true" auto-update="true" auto-delete="true" > <foreignkey field-ref="contactID"/> </reference-descriptor> </class-descriptor>
It really don't know what else to try. Did everything according to the
advanced technique tutorial.
So, I'd say there is currently no way around making Contact a concrete class.
Tom
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
