Search in sources :

Example 1 with QueryRoot

use of org.apache.deltaspike.data.impl.builder.part.QueryRoot in project deltaspike by apache.

the class MethodQueryBuilder method createJpaQuery.

private Query createJpaQuery(CdiQueryInvocationContext context) {
    Parameters params = context.getParams();
    QueryRoot root = context.getRepositoryMethodMetadata().getQueryRoot();
    String jpqlQuery = context.applyQueryStringPostProcessors(root.getJpqlQuery());
    context.setQueryString(jpqlQuery);
    params.updateValues(root.getParameterUpdates());
    Query result = params.applyTo(context.getEntityManager().createQuery(jpqlQuery));
    return context.applyRestrictions(result);
}
Also used : Parameters(org.apache.deltaspike.data.impl.param.Parameters) QueryRoot(org.apache.deltaspike.data.impl.builder.part.QueryRoot) Query(javax.persistence.Query)

Aggregations

Query (javax.persistence.Query)1 QueryRoot (org.apache.deltaspike.data.impl.builder.part.QueryRoot)1 Parameters (org.apache.deltaspike.data.impl.param.Parameters)1