I know you can't change annotation parameters dynamically at run-time. I know the value at compile-time but not within the scope of the annotated type. I also have no controll over the annotation itself.
I want to use this for JPA, so I'll use it in the example as well:
I have a base program defining an entity A
:
@Entity
@Inheritance(strategy=JOINED) //default strategy
public class A { }
Now I have a flavor built on top of that program, i.e. it uses the base program like a library but both are compiled together. The flavor extends A
and it should be able to determine its inheritance strategy, i.e. override the parameter value of @Inhertitance
of type A
.
Is there a way to accomplish this without messing with the byte code?