public class AnnotatedQueryBuilder extends QueryBuilder {
@Override
public Object execute(QueryInvocationContext context) {
Method method = context.getMethod();
Query query = method.getAnnotation(Query.class);
javax.persistence.Query jpaQuery = createJpaQuery(query, context);
if (returnsList(method)) {
return jpaQuery.getResultList();
} else {
return jpaQuery.getSingleResult();