Package org.apache.deltaspike.data.impl.param

Examples of org.apache.deltaspike.data.impl.param.Parameters.applyTo()


    {
        Parameters params = context.getParams();
        QueryRoot root = context.getRepositoryMethod().getQueryRoot();
        String jpqlQuery = context.applyQueryStringPostProcessors(root.getJpqlQuery());
        context.setQueryString(jpqlQuery);
        Query result = params.applyTo(context.getEntityManager().createQuery(jpqlQuery));
        return applyRestrictions(context, result);
    }

}
View Full Code Here


        javax.persistence.Query result = null;
        if (isNotEmpty(query.named()))
        {
            if (!context.hasQueryStringPostProcessors())
            {
                result = params.applyTo(entityManager.createNamedQuery(query.named()));
            }
            else
            {
                javax.persistence.Query namedQuery = entityManager.createNamedQuery(query.named());
                String named = factory.extract(namedQuery);
View Full Code Here

            else
            {
                javax.persistence.Query namedQuery = entityManager.createNamedQuery(query.named());
                String named = factory.extract(namedQuery);
                String jpqlQuery = context.applyQueryStringPostProcessors(named);
                result = params.applyTo(entityManager.createQuery(jpqlQuery));
            }
        }
        else if (query.isNative())
        {
            String jpqlQuery = context.applyQueryStringPostProcessors(query.value());
View Full Code Here

            }
        }
        else if (query.isNative())
        {
            String jpqlQuery = context.applyQueryStringPostProcessors(query.value());
            result = params.applyTo(entityManager.createNativeQuery(jpqlQuery));
        }
        else
        {
            String jpqlQuery = context.applyQueryStringPostProcessors(query.value());
            context.setQueryString(jpqlQuery);
View Full Code Here

        }
        else
        {
            String jpqlQuery = context.applyQueryStringPostProcessors(query.value());
            context.setQueryString(jpqlQuery);
            result = params.applyTo(entityManager.createQuery(jpqlQuery));
        }
        return applyRestrictions(context, result);
    }

}
View Full Code Here

        QueryExtraction extract = new QueryExtraction(queryString);
        String count = extract.rewriteToCount();
        log.log(Level.FINER, "Rewrote query {0} to {1}", new Object[] { queryString, count });
        Query result = context.getEntityManager().createQuery(count);
        Parameters params = context.getParams();
        params.applyTo(result);
        return result;
    }

    private String getQueryString(CdiQueryInvocationContext context, Query query)
    {
View Full Code Here

        QueryExtraction extract = new QueryExtraction(queryString);
        String count = extract.rewriteToCount();
        log.log(Level.FINER, "Rewrote query {0} to {1}", new Object[] { queryString, count });
        Query result = context.getEntityManager().createQuery(count);
        Parameters params = context.getParams();
        params.applyTo(result);
        return result;
    }

    private String getQueryString(CdiQueryInvocationContext context, Query query)
    {
View Full Code Here

        javax.persistence.Query result = null;
        if (isNotEmpty(query.named()))
        {
            if (!context.hasQueryStringPostProcessors())
            {
                result = params.applyTo(entityManager.createNamedQuery(query.named()));
            }
            else
            {
                javax.persistence.Query namedQuery = entityManager.createNamedQuery(query.named());
                String named = factory.select(namedQuery).extractFrom(namedQuery);
View Full Code Here

            else
            {
                javax.persistence.Query namedQuery = entityManager.createNamedQuery(query.named());
                String named = factory.select(namedQuery).extractFrom(namedQuery);
                String jpqlQuery = context.applyQueryStringPostProcessors(named);
                result = params.applyTo(entityManager.createQuery(jpqlQuery));
            }
        }
        else if (query.isNative())
        {
            String jpqlQuery = context.applyQueryStringPostProcessors(query.value());
View Full Code Here

            }
        }
        else if (query.isNative())
        {
            String jpqlQuery = context.applyQueryStringPostProcessors(query.value());
            result = params.applyTo(entityManager.createNativeQuery(jpqlQuery));
        }
        else
        {
            String jpqlQuery = context.applyQueryStringPostProcessors(query.value());
            context.setQueryString(jpqlQuery);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.