db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bart Molenkamp" <b.molenk...@bizzdesign.nl>
Subject Problems with extending classes
Date Mon, 26 Jul 2004 13:46:53 GMT
Hello,

I've a problem with extending classes. The "advanced technique" document
describes three ways for mapping class hierarchies. I want to use the
"Mapping Classes on Multiple Joined Tables" variant. My structure is
pretty much the same as the one described in the "advanced technique"
document, but it doesn't work. The exception I get is:

org.apache.ojb.broker.KeyConstraintViolatedException: SQL failure while
insert object data for class
com.bizzdesign.persistence.impl.ojb.metamodel.DataTypeImpl, PK of the
given object is [ name=null], object was
com.bizzdesign.persistence.impl.ojb.metamodel.DataTypeImpl@3c8308,
exception message is [Try to insert null into a non-nullable column in
statement [INSERT INTO MetaDataTypes (name) VALUES (NULL) ]]

What am I doing wrong? The repository_user.xml is specified below:

<!-- file containing the repository descriptions for user-defined types
-->
<!-- Generated by the xdoclet-ojb module -->

<class-descriptor
    class="com.bizzdesign.persistence.impl.ojb.metamodel.DataTypeImpl"
    table="MetaDataTypes"
>
    <field-descriptor
        name="name"
        column="name"
        jdbc-type="VARCHAR"
        primarykey="true"
        length="200"
    >
    </field-descriptor>
</class-descriptor>
<class-descriptor
 
class="com.bizzdesign.persistence.impl.ojb.metamodel.PrimitiveTypeImpl"
    table="MetaPrimitiveTypes"
>
    <field-descriptor
        name="dataTypeName"
        column="dataTypeName"
        jdbc-type="VARCHAR"
        primarykey="true"
        length="200"
        access="anonymous"
    >
    </field-descriptor>
    <field-descriptor
        name="behaviour"
        column="behaviour"
        jdbc-type="VARCHAR"
        primarykey="false"
 
conversion="com.bizzdesign.persistence.impl.ojb.metamodel.StringClassCon
version"
        length="200"
    >
    </field-descriptor>
    <reference-descriptor
        name="super"
 
class-ref="com.bizzdesign.persistence.impl.ojb.metamodel.DataTypeImpl"
        auto-retrieve="true"
        auto-update="true"
        auto-delete="true"
    >
        <foreignkey field-ref="dataTypeName"/>
    </reference-descriptor>
</class-descriptor>
<class-descriptor
 
class="com.bizzdesign.persistence.impl.sql.metamodel.EnumerationImpl"
    table="MetaEnumerations"
>
</class-descriptor>



Thanks in advance,
Bart.

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


Mime
View raw message