I am assigned a task to develop a custom annotation for database connectivity
Now at a very basic level i have created one annotation but it is not fulfilling my this requirement..can anyone guide me how to develop this type of annotation? I surfed and come to know that to inject an entity like in built annotations we have to use reflections. is it so ?
and there is no tutorial available for this kind of annotation also..
some expert please guide me regarding this ..
I don't know if that's been updated to handle annotations though.
If not, then there are a few methods you need to learn after reading it:
- isAnnotationPresent checks if a specific annotation is present
- getAnnotation returns a specific annotation (or null if not present).
In your case, once you have a java.lang.reflect.Field for field "con" you get its annotation like this: