Is there any way to change a class definition (especifically a query definition during the compilation time)?
The idea is:
I have an abstract class with a parameter where I will define the ROWSPEC of a query and some methods to populate e temporary table
The implementation class will override the parameter, specifying the ROWSPEC of this implementation, and the methods will populate the rows in the same format as the ROWSPEC.
I want to change the ROWSPEC of the inherit query according to the implementation of the overriden parameter.
What I've already tried to change the parameter definition (of the query):
- Create a macro, thinking about the possibility of running it before the compilation
- Override the ClassMethod CreateProjection from the class %Projection.AbstractProjection
- Run a method in a objectgenerator
It seems that Caché compiles the queries before compiling the classes, because in all these cases, the query compiled code only generated the ROWSPEC as expected in the second compilation (where the class definition were changed and saved by the first compilation)
Any ideas if this is possible to be done without having to compile twice?
Basically I "just" need to have something executed before the compilation, but right after the beggining of the compile process
Another question (this would be the simplest solution):
Is it possible to execute some callback whenever a class definition is saved?