Re: objects removal

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sun Oct 03 2004 - 12:01:44 EDT

  • Next message: Andrus Adamchik: "[ANN] Cayenne RC1 Release"

    ... I thought this may be helpful to others, so I figured I'd post a
    followup here...

    I looked at the mapping used by Michele and it turned out to be a bug.
    If anyone runs into problems with objects deletion for objects that
    have flattened relationships, check out this bug report - it shows some
    easy workarounds (and I will work on fixing it in the meantime):

    http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-198

    Andrus

    On Sep 16, 2004, at 11:09 AM, Andrus Adamchik wrote:
    > 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.
    >
    > Andrus
    >
    >
    > 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 : Sun Oct 03 2004 - 12:01:53 EDT