Package javax.persistence.criteria

Examples of javax.persistence.criteria.ParameterExpression


    protected TypedQuery<Contact> getSearchQuery(ContactSearchDTO contact) {
        CriteriaBuilder criteriaBuilder = JPA.em().getCriteriaBuilder();
        CriteriaQuery<Contact> criteriaQuery = criteriaBuilder.createQuery(entityClass);
        Root<Contact> from = criteriaQuery.from(entityClass);
        CriteriaQuery<Contact> select = criteriaQuery.select(from);
        ParameterExpression fN = criteriaBuilder.parameter(String.class);
        ParameterExpression lN = criteriaBuilder.parameter(String.class);
        ParameterExpression mN = criteriaBuilder.parameter(String.class);
        ParameterExpression date = criteriaBuilder.parameter(Date.class);
        ParameterExpression mail = criteriaBuilder.parameter(String.class);
        ParameterExpression city = criteriaBuilder.parameter(String.class);
        ParameterExpression str = criteriaBuilder.parameter(String.class);
        ParameterExpression house = criteriaBuilder.parameter(String.class);
        ParameterExpression apart = criteriaBuilder.parameter(String.class);
        if (contact.getBirthDate() != null) {
            if (contact.getDirection().equals(">")) {
                select.where(criteriaBuilder.like(from.get("firstName"), fN),
                        (criteriaBuilder.like(from.get("middleName"), mN)),
                        (criteriaBuilder.like(from.get("lastName"), lN)),
View Full Code Here

TOP

Related Classes of javax.persistence.criteria.ParameterExpression

Copyright © 2018 www.massapicom. 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.