}
}
private javax.persistence.Query createJpaQuery(Query query, QueryInvocationContext context) {
EntityManager entityManager = context.getEntityManager();
Parameters params = context.getParams();
javax.persistence.Query result = null;
if (isNotEmpty(query.named())) {
result = params.applyTo(entityManager.createNamedQuery(query.named()));
} else if (isNotEmpty(query.sql())) {
result = params.applyTo(entityManager.createNativeQuery(query.sql()));
} else {
result = params.applyTo(entityManager.createQuery(query.value()));
}
return applyRestrictions(context, result);
}