• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Delete rules on flattened relationships
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delete rules on flattened relationships


  • Subject: Re: Delete rules on flattened relationships
  • From: Paul Hoadley <email@hidden>
  • Date: Thu, 10 Nov 2011 10:38:57 +1030

On 10/11/2011, at 8:25 AM, Ramsey Gurley wrote:

>> Say I have two entities, User and Role, and a joining entity UserRole to create a many-to-many relationship between them.  So I have a relationship 'userRoles' from User to UserRole (and a relationship 'userRoles' from Role back to UserRole).  I flatten the relationship on User, so I also have a 'roles' relationship on that entity.
>>
>> Say I delete a User.  I want User.userRoles to Cascade.  And I want both UserRole.user and UserRole.role to Nullify.  And at that point, isn't the work done?  So in this case, wouldn't I want No Action on User.roles?  And hence isn't this a counter-example to your advice above?  (It may well not be—tell me if I'm wrong!)
>
> I looked a second time.  The cascade is actually on the non-class property.  The flattened is nullify... so maybe it would work with no action.  I'm not recommending anything, just noting something I saw which seemed odd.

Sorry, not trying to pin you down to anything!  In my example above, because UserRole.role is Nullify, probably having User.roles set to Nullify would not make any difference.  I would have to work a bit hard to contrive an example where it mattered.  Say if UserRole.role was Cascade (obviously it wouldn't be)—then if User.roles was Nullify they would conflict, but if it was No Action, the Cascade would happen.

Obviously you could look at each flattened relationship on a case-by-case basis.  I'm just trying to tease out whether No Action would be correct 100% of the time, as long as you had the right delete rules along the chain of actual relationships that constituted the flattened relationship.


--
Paul.

http://logicsquad.net/


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Delete rules on flattened relationships
      • From: Chuck Hill <email@hidden>
    • Re: Delete rules on flattened relationships
      • From: Paul Hoadley <email@hidden>
References: 
 >Delete rules on flattened relationships (From: Paul Hoadley <email@hidden>)
 >Re: Delete rules on flattened relationships (From: Ramsey Gurley <email@hidden>)
 >Re: Delete rules on flattened relationships (From: Paul Hoadley <email@hidden>)
 >Re: Delete rules on flattened relationships (From: Ramsey Gurley <email@hidden>)

  • Prev by Date: Re: [SOLVED]: Is JDBCAdaptor generating the wrong SQL for fixed length character columns?
  • Next by Date: Anyone ever returned a .jnlp from a wocomponet?
  • Previous by thread: Re: Delete rules on flattened relationships
  • Next by thread: Re: Delete rules on flattened relationships
  • Index(es):
    • Date
    • Thread