Re: objects removal

From: Andrus Adamchik (
Date: Thu Sep 16 2004 - 11:09:24 EDT

  • Next message: Tore Halset: "Re: rtrim()"

    Hi Michele,

    One thing to check is whether you have "to dep pk" set up correctly for
    DbEntities. It should be checked for these relationships: object1 ->
    object1_to_object2 and object2 -> object1_to_object2. AMong other
    things, this setting hints Cayenne how to order delete operations to
    satisfy constraints.


    On Sep 16, 2004, at 9:40 AM, Michele Cuozzo wrote:
    > Hi everybody,
    > I've got a problem with objects deletion:
    > for example I've got Object1 and Object2 classes binded with a
    > many-to-many flattened relationship ( so in the database I've got a
    > bind table object1_to_object2 not present in the ObjectEntity list of
    > my model); 
    > I've setted a delete rule that say Cascade on Object1 deletion but
    > when I try to remove an instance of Object1 I've got an SQLException
    > like the following:
    > java.sql.SQLException: ERROR:  <unnamed> referential integrity
    > violation - key in object2 still referenced from object1_to_object2
    > I'm using PostgreSQL 7.2
    > Where is the problem?
    > thanks in advance
    > Michele

    This archive was generated by hypermail 2.0.0 : Thu Sep 16 2004 - 11:09:30 EDT