Delete Rule Cascade with Deny on reverse relationship always fails.
-------------------------------------------------------------------

         Key: CAY-615
         URL: http://issues.apache.org/cayenne/browse/CAY-615
     Project: Cayenne
        Type: Improvement

  Components: Cayenne Core Library  
    Versions: 1.2 [STABLE]    
    Reporter: Mike Kienenberger
 Assigned to: Mike Kienenberger 


Delete Rule Cascade with Deny on reverse relationship always fails.

On 7/27/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> Does the Deny still happen if the only
> reverse-relationship value is the cascading original object to be
> deleted?


On 7/27/06, Andrus Adamchik <[EMAIL PROTECTED]> wrote:
> Doesn't look like DataContextDeleteAction is smart about it:
> 
>             if (relatedObjects.size() == 0) {
>                  continue;
>              }
> 
>              // process DENY rule first...
>              if (relationship.getDeleteRule() == DeleteRule.DENY) {
>                  object.setPersistenceState(oldState);
> 
>                  String message = relatedObjects.size() == 1
>                          ? "1 related object"
>                          : relatedObjects.size() + " related objects";
>                  throw new DeleteDenyException(object,
> relationship.getName(), message);
>              }
> 
> To handle cascade/deny combination we may need to change this code to
> check that at least one object in 'relatedObjects' collection is
> itself not deleted.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/cayenne/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to