Thomas Mahler wrote:

Hi Aaron,

Aaron Longwell wrote:

I've looked through the docs for this, but they are, forgive me, rather unclear.

I have an m:n relationship of Bands and Performances.

I want a cascading delete to occur so that whenever the Band is deleted, it's corresponding performances are also deleted.

However, when a performance is deleted, I do not want the corresponding Band to be deleted because that Band may have other performances.

My Band class-descriptor has a collection descriptor called performances.... do I put the auto-delete here?


Yes.

I have set this up... and it is not deleting the records. Oddly, if I do it the other way around, where I put auto-delete on my performance object's reference to the band, then deleting that performance also deletes it's corresponding band. In other words, auto-delete is working from the n side, but not the 1 side.... Auto-Delete is working for reference descriptors but not collection descriptors.


As a workaround, I am manually deleting the performances by doing a deleteByQuery before doing a delete.



Do I need to put an auto-delete anywhere on the performance?

No.


I am unclear as to whether the auto-delete attribute says, delete the class-descriptor which contains this attribute when this reference is deleted.... or if it says, delete this reference if the class-descriptor containing it is deleted.


auto-delete="true" on a reference- or collection-descriptor says:
if an instance of this class is deleted, also delete the referenced object(s) defined by the reference- or class-descriptor.


cheers,
Thomas


Thanks for the help, Aaron


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to