I don't see how that solves my problem. I'm not deleting the parent record at all, im loading it into session scope and modifying it's it's child records via the iterator. I want to be able to delete an item from the iterator array but not delete it from the database until I save the parent record.
I have been able to do what I want but only by adding a function to the iterator that I can call before saving the parent record. This function deletes all elements in the iterator array with variables.deleted set to 1. I can only do this by adding a setter in the record object that allows me to set the variables.deleted variable to 1 without actually deleting the record. I also had to override the set/getTo method to remove the isDeleted() check. It's definitely a hack but im just playing around to see if I can get it to work as I need. It just seems strange that iterator.add() method doesn't persist a new array item to the database but delete() does. On 9/14/06, Beth Bowden <[EMAIL PROTECTED]> wrote:
Patrick, Not having cascading deletes was intentional. What I've done in your situation is define cascading deletes in the database. FWIW. Beth On 9/13/06, Patrick Lebon <[EMAIL PROTECTED]> wrote: > I'm trying to load a reactor record object that hasMany child records > and modify it in cache. I only want to persist the changes after > modifying child records (add/edit/delete etc). > > So far I can add child records to the iterator array and when I save > the main record the child objects are created or updated in the db as > expected. I am now trying to delete items from the iterator array and > have the changes take effect when I save the parent record but I can't > seem to get it working. > > iterator.add() seems to add the new record to the end of the current > array however iterator.delete() seems like it will actually delete the > child record from the database (if it exists) however I don't want > that to happen until the parent is saved, I only want to remove it > from the cached iterator array > > How would I go about removing records from the cached record iterator > so that the changes will only be modified in the database when the > parent is saved? > > I am currently using getFaqItemIterator().delete(index) from a > function in the parent record but it doesn't seem to be working. Any > thoughts? > > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- > Reactor for ColdFusion Mailing List > [email protected] > Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [email protected] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [email protected] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
