I have to change the data type mapping for my custom query class (i am using FireDAC
). This is no problem itself, i have already created a procedure that does the job. But i hit a wall while implementing it on a big scale.
I have created a procedure in my class which gets the self.FormatOptions.MapRules
property from it's database connection component (which has the right data type mapping rules). Now i wanna change my class so every component of that class executes my procedure OnOpen
but i can't seem to find a way do assign a procedure to an event in a class.
Is there a way to do that or "inherit" that property from my database connection component when it's not the parent of my query component?
I already tried doing it with the constructor but since i don't create the query component in runtime, the constructor is not called
Since the query component is used some 500+ times in the project i don't wanna assign the procedure to the event every time by hand...