I am trying to inherit following parameter in a java interface (an example from Spring Data JPA, but the question is generally about parameters to annotations):
public interface ItemRepository<T extends Item> extends BaseRepository<T> { public final String type = null; @Query("select distinct i from " + type + " i " + "join i.tags t " + "join fetch i.locale where t = ?1") public List<T> findByTag(Tag t); } so that in inherited interfaces I could have just:
public interface EventRepository extends ItemRepository<Event> { public final static String type = "Event"; } But unfortunately the string value of variable "type" is associated to the variable too late, so when the annotation is created, the value is still null. Can I force the compiler to associate the variable from the child interface?
Thanks