I have 2 tables joined together with a linking table. I can successfully make these calls:

getChildLitGenreIterator().getQuery()
getChildLitGenreIterator().add(childLitGenreId=currGenreId)
getChildLitGenreIterator().delete(childLitGenreId=currGenreId)

Now I'm trying to setup the deletes so that all the associated entries in the link table when the main record is deleted. I have tried setting up a beforeDelete() function in the main table record, like this:

   <cffunction name="BeforeDelete" access="public">
       <!--- before delete, remove any links --->
       <cfset getChildLitGenreIterator().deleteAll()>
   </cffunction>

I added some debug code to confirm that the beforedelete() is actually firing, but this is not working as I expect. The main record gets deleted, but the entries in the link table remain. I have also tried using the link iterator (when would I use that?), getChildLitGenreIterator().deleteAll(), but that doesn't work either.

Any ideas on what I'm doing wrong? Is there a better way to do this?

Thanks,
Mark



-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/


Reply via email to