I'm wondering if, instead of creating a new annotation, we could include it in the @Field annotation. Something like a dependsOn attribute taking a list of properties? If not empty, it would disable the automatic shutting down of the optimizations on @Transient fields and consider these properties.
This might not be a good idea, since we're talking about the method itself. If there are multiple @Field, you don't want to repeat the dependsOn attribute for each field... On a side-note, the shutting down of the optimizations is (and must be) global to the entity, i.e. if even one @Transient method does not document its dependencies, then when any property is dirty, it might affect the output of this method, so reindexing is needed. |