I have implemented a xwiki based application  in which there are two main
classes "A" and "B". Those classes have a one-to-many relationship where
one "A" can be associated with many "B"s. (Just like presented in
https://www.xwiki.org/xwiki/bin/view/FAQ/HowToCreateAOneToManyRelationshipInXWiki
)

The main thing is that when I delete a page which contains and represents
an "A" object, associated with many "B"s, those "B" pages still contain the
reference to the no longer present "A" object. Therefore, I was hopping to
find some kind of "onDelete" event triggered when a page is deleted so I
could clean those dead references.

Just to clarify: "B" objects have an attribute called "A-reference" where
the doc.fullName of an "A" page is stored. If I could trigger a method when
this "A" object is deleted I would be able to perform an HQL query in order
to list those pages associated with the deleted "A" page and set a null
value to the "A-reference" attribute.

Would appreciate any thoughts and hints on how to solve this because I'm
out of ideas and found no documentation on such event/trigger/method.

Thanks!

Francisco Barretto

Reply via email to