Example usage for javax.persistence.criteria Root get

List of usage examples for javax.persistence.criteria Root get

Introduction

In this page you can find the example usage for javax.persistence.criteria Root get.

Prototype

<Y> Path<Y> get(SingularAttribute<? super X, Y> attribute);

Source Link

Document

Create a path corresponding to the referenced single-valued attribute.

Usage

From source file:th.co.geniustree.dental.spec.ListSelectHealSpec.java

public static Specification<ListSelectHeal> nameLike(final String keyword) {
    return new Specification<ListSelectHeal>() {

        @Override//w  w w .j  a va  2 s  .c  o m
        public Predicate toPredicate(Root<ListSelectHeal> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
            return cb.like(cb.upper(root.get(ListSelectHeal_.name)), keyword.toUpperCase());
        }
    };
}

From source file:th.co.geniustree.dental.spec.LotSpec.java

public static Specification<Lot> nameStaffReamLike(final String keyword) {
    return new Specification<Lot>() {

        @Override//w  ww  .j av a 2s  .c  o m
        public Predicate toPredicate(Root<Lot> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
            return cb.like(cb.upper(root.get(Lot_.nameStaffReam)), keyword.toUpperCase());
        }
    };
}

From source file:carrental.repository.reservation.CarSpecification.java

public static Specification<Car> descriptionIsLike(final String description) {
    return new Specification<Car>() {
        @Override/* w  ww  .  j ava 2 s  .  co m*/
        public Predicate toPredicate(Root<Car> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder cb) {
            return cb.like(root.get("description"), description);
        }
    };
}

From source file:carrental.repository.reservation.CarSpecification.java

public static Specification<Car> colorIsLike(final String color) {
    return new Specification<Car>() {
        @Override// ww w . ja  v  a2 s.c  o  m
        public Predicate toPredicate(Root<Car> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder cb) {
            return cb.like(root.get("color"), color);
        }
    };
}

From source file:carrental.repository.reservation.CarSpecification.java

public static Specification<Car> licensePlateIs(final String licensePlate) {
    return new Specification<Car>() {
        @Override//from  w w w . j  a  v  a 2  s.c  o  m
        public Predicate toPredicate(Root<Car> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder cb) {
            return cb.like(root.get("licensePlate"), licensePlate);
        }
    };
}

From source file:th.co.geniustree.dental.spec.EmployeeSpec.java

public static Specification<Employee> nameLike(final String keyword) {
    return new Specification<Employee>() {

        @Override/*from   w w w  . j a  va  2s.c o m*/
        public Predicate toPredicate(Root<Employee> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {

            return cb.like(cb.upper(root.get(Employee_.nameTh)), keyword.toUpperCase());
        }
    };
}

From source file:th.co.geniustree.dental.spec.DoctorSpec.java

public static Specification<Doctor> mobileLike(final String keyword) {
    return new Specification<Doctor>() {

        @Override/*from  w ww. ja va  2  s  .  co m*/
        public Predicate toPredicate(Root<Doctor> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
            return cb.like(root.get(Doctor_.mobile), keyword);
        }
    };
}

From source file:th.co.geniustree.dental.spec.ProductSpec.java

public static Specification<Product> nameLike(final String keyword) {
    return new Specification<Product>() {

        @Override//from  w ww.j  a  v  a 2 s . c o m
        public Predicate toPredicate(Root<Product> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
            return cb.like(cb.upper(root.get(Product_.name)), keyword.toUpperCase());
        }
    };
}

From source file:th.co.geniustree.dental.spec.ProductSpec.java

public static Specification<Product> unitLike(final String keyword) {
    return new Specification<Product>() {

        @Override/*from  w w w. j av  a 2 s  .  com*/
        public Predicate toPredicate(Root<Product> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
            return cb.like(cb.upper(root.get(Product_.unit).get(UnitProduct_.name)), keyword.toUpperCase());
        }
    };
}

From source file:th.co.geniustree.dental.spec.ProductSpec.java

public static Specification<Product> typeProductLike(final String keyword) {
    return new Specification<Product>() {

        @Override/*from ww  w . j a  v a 2  s  .  co m*/
        public Predicate toPredicate(Root<Product> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
            return cb.like(cb.upper(root.get(Product_.typeProduct).get(TypeProduct_.name)),
                    keyword.toUpperCase());
        }
    };
}