Hello there,

As you can see below my table 'iconList' has an identity 'iconListId' that
is generated using a key generator. This primary key is at the same time
used as the foreign key in one-to-many relationship table. Right now when
I am trying to write such objects (to an SAP DB), I am getting this
exception:
Exception in thread "main" org.telecare.exception.JdoCastorException:
Nested error: com.sap.dbtech.jdbc.exceptions.DatabaseException: SAP DBTech
SQL: [350] Referential integrity violated:FK_ICONLISTID,TELECARE,ICON
Your help would be appreciated!

Thanks,


Ps:

this is a piece of my mapping file:

<class name="Device"...

</class>

<class name="IconList" identity="iconListId" key-generator="MAX"
depends="Device">        <map-to table="iconList"/>

        <field name="iconListId" type="integer" direct="true">
            <sql name="iconListId" type="integer"/>
        </field>

        <field name="UDN" type="string" direct="true" >
            <sql name="UDN" type="varchar"/>
        </field>

        <field name="value" type="Icon" collection="arraylist" direct="true">
            <bind-xml name="icon" node="element"/>
            <sql many-key="iconListId"/>
        </field>

    </class>

    <class name="Icon"  identity="iconId" key-generator="MAX"
    depends="IconList">        <map-to table="Icon"/>

        <field name="iconId" type="integer" direct="true">
            <sql name="iconId" type="integer"/>
        </field>

        <field name="iconListId" type="integer" direct="true">
            <sql name="iconListId" type="integer"/>
        </field>

        <field name="mimeType" type="string" direct="true">
            <bind-xml name="mimetype" node="element"/>
            <sql name="mimetype" type="varchar"/>
        </field>

    </class>

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to