On Apr 18, 2006, at 8:14 PM, Brian Rinaldi wrote: I assume in this case the cascade delete is a setting in the config? Also, why would you call delete() in one case and deleteAll() in another. Wouldn't user.delete() delete one address in the case where there is a hasOne relationship and cascade is true and all records where there is a hasMany. I assume also this would work with linking tables, user.delete() would delete records in the linking table? Doug, thanks for all your continued hard work. If you read the line carefully, it's User.getAddressIterator().deleteAll(). Internally, User.delete() would HAVE to call getAddressIterator().deleteAll() if that call were legal according to the database because there IS NO OTHER API TO DO IT other than via the gateway, to which there is no access via the Record object types. There is a getNNNIterator() for hasMany and a simple getter for a hasOne... so User.getAddress().delete() deletes a hasOne address object, whereas User.getAddressIterator().delete(x) will delete a particular object in the iterator and User.getAddressIterator().deleteAll() will delete ALL the linked records. At least this is my understanding and seems confirmed by reading the doco I generate for my Reactor objects (see my latest blog entry for more info on generating doco for the reactor-generated objects). If I'm wrong I trust someone will correct me. Doug? Sean? Laterz, J
|
- [Reactor For CF] New Commit committed Doug Hughes
- Re: [Reactor For CF] New Commit committed Sean Corfield
- RE: [Reactor For CF] New Commit committed Doug Hughes
- Re: [Reactor For CF] New Commit committed Sean Corfield
- RE: [Reactor For CF] New Commit committ... Doug Hughes
- Re: [Reactor For CF] New Commit co... Dave Shuck
- RE: [Reactor For CF] New Commi... Doug Hughes
- [Reactor For CF] cascadeDelete and casc... Jared Rypka-Hauer
- Re: [Reactor For CF] cascadeDelete... Brian Rinaldi
- Re: [Reactor For CF] cascadeDe... Chris Phillips
- Re: [Reactor For CF] cascadeDe... Jared Rypka-Hauer
- Re: [Reactor For CF] New Commit committed wikiwikiman
- RE: [Reactor For CF] New Commit committed Doug Hughes
- RE: [Reactor For CF] New Commit committed Chris Blackwell
- RE: [Reactor For CF] New Commit committed Doug Hughes
- RE: [Reactor For CF] New Commit committed João Fernandes
- Re: [Reactor For CF] New Commit committed Sam Clement
- Re: [Reactor For CF] New Commit committed Jared Rypka-Hauer
- Re: [Reactor For CF] New Commit committ... Sam Clement
- Re: [Reactor For CF] New Commit co... Sean Corfield
- Re: [Reactor For CF] New Commit co... Jared Rypka-Hauer

