0 Replies Latest reply on Feb 7, 2013 10:02 AM by jmsamland

    ORM: Perform actions on cascaded delete

    jmsamland Level 1

      I've made a custom forums system.  Threads have messages which can have attachments.  All one to many relationship.  I have cascade="delete-orphan" on the relationships in threads to message and messages to attachments, so that if the parent is deleted, so are all the children.  But attachments also are linked to a file on the server.  I want to add code to the attachment deleting to also delete this file.  You can override the getters and setters, and I could make a deleteFile() function in Attachment.cfc, but how can I force this to fire automatically with either entityDelete(attachment) or when the delete is cascaded?