cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Dahbura <>
Subject Question about removing detail records under a master record (master object with detail objects!)
Date Wed, 25 May 2011 19:54:47 GMT
I have an object called event that contains eventMenu as an array of objects. event is a table
in my database and eventMenu is a table. Each of the objects are working fine for inserts
and queries... 

However if I want to delete an eventitem I tried calling event.removeFromEventmenuArray(obj).
Then calling context.commitChanges(); 

What happens is the Cayenne marks the fkey in eventMenu as null instead of deleting the eventMenu
row from the database. I have tried all the possible delete rules (I tried cascade, tried
no action, all of them). I cannot get the ORM to delete the row from the detail record. 

All the foreign key records are setup correctly and if I delete the event it cascade deletes
the eventMenu rows as I want. 

Any ideas, if I try to delete the eventMenu manually this works okay, but it seems to me the
event object should respect the remove operation and do this upon a commit? 

Am I misunderstanding how to do this? 


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message