Re: problem with flattened relationship

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Feb 05 2004 - 11:49:54 EST

  • Next message: Andrus Adamchik: "Re: problem with flattened relationship"

    Hi Steve,

    On Feb 5, 2004, at 12:07 AM, Steve Steinitz wrote:
    > <db-relationship name="userrolesArray" source="role"
    > target="userroles" toDependentPK="false" toMany="true">
    > <db-attribute-pair source="id" target="roleid"/>
    > </db-relationship>
    > <db-relationship name="userrolesArray" source="user"
    > target="userroles" toDependentPK="false" toMany="true">
    > <db-attribute-pair source="id" target="userid"/>
    > </db-relationship>

    These two relationships must be marked as "to dep PK", since the
    primary key is propagated from the source.

    > Caused by: java.sql.SQLException: ERROR: $1 referential integrity
    > violation - key in user still referenced from userroles

    The error looks like the failure is happenning on delete, not insert.
    But still, I think fixing "to dep PK" setting should take care of this.
    If the error persists, try turning on SQL logging and please send the
    queries executed before the failure.

    Thanks
    Andrus



    This archive was generated by hypermail 2.0.0 : Thu Feb 05 2004 - 11:50:02 EST