Hibernate Search). Although I found success with it, I wanted to
automate the process of passing the fields that are indexed and their
respective index names. Hibernate Search uses a bunch of annotations
in the getter to specify their index name and filters used.
I want to go through all the 'Field' annotation present in every
method defined inside my class and get the value of the 'name' field
from it. Sometimes 'Field' is present inside as a nested annotation
Here the tricky part is where you've to set
- YourAnnotation ann = method.getAnnotation(YourAnnotation.class)
and get an the annotation object from it.
Here is an example problem:
Here is the solution:
And here is my output...