I try to generate the expression with annotation below:
@NamedQueries({@NamedQuery(name = "E.findAll", query = "SELECT e FROM E e")})
I tried the code below:
.addAnnotation(AnnotationSpec.builder(NamedQueries.class)
.addMember( AnnotationSpec.builder(NamedQuery.class)
.addMember("name", "$S", "E.findAll")
.addMember("query", "$S", "SELECT e FROM E e)
.build()).build())
but since addMember
requires string; this expression gives error. So how can i obtain a recursive expression.
Is it possible to build another annotation inside an annotation?