I noticed that if I create an annotation:
public @interface NullableTypeOverride { NullableType hibernateTypeOverride(); }
I have limited annotation attribute capabilities. The above code will not work because annotations accept only primitive String or Class types for their attributes.
So, in this case, I cannot use this annotation as follows:
@NullableTypeOverride(hibernateTypeOverride = Hibernate.INTEGER) private Long distance;
I assume it has something to do with compile time and runtime, but I'm not quite sure. So what is the reason for this limitation and how can I get around it?
source share