Deleting or changing a field of all the entities of some type is fairly easy, using the DELETE and UPDATE clauses, but I would like to know - is there an elegant and efficient way of invocing some method on all persisted entities of some type?
For instance, suppose every entity object should do some operations before it gets deleted, and at some point we want to delete all those entities. It could be usefull if we could invoke some "doBeforeDie" method before the deletion.
One way to achive this could be retrieving one object at a time and invoke the method (using "retrieval by navigation and access"), but I suspect it's not an efficient solution.
Any alternatives?