Example usage for javax.persistence.criteria CriteriaBuilder equal

List of usage examples for javax.persistence.criteria CriteriaBuilder equal

Introduction

In this page you can find the example usage for javax.persistence.criteria CriteriaBuilder equal.

Prototype

Predicate equal(Expression<?> x, Object y);

Source Link

Document

Create a predicate for testing the arguments for equality.

Usage

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

public static Specification<OrderProduct> whereBill(final Integer keyword) {
    return new Specification<OrderProduct>() {
        @Override//from  ww w  .  j  a  v  a 2  s. c  o  m
        public Predicate toPredicate(Root<OrderProduct> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
            return cb.equal(root.get(OrderProduct_.bill).get(Bill_.id), keyword);
        }

    };
}

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

public static Specification<Department> idWhere(final Integer keyword) {
    return new Specification<Department>() {
        @Override//from  w  ww.  ja  v a2s .  c  om
        public Predicate toPredicate(Root<Department> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
            return cb.equal(root.get(Department_.id), keyword);
        }
    };
}

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

public static Specification<ListSelectHeal> priceLike(final Double keyword) {
    return new Specification<ListSelectHeal>() {

        @Override/*from   w  w w .j av  a  2  s .  c  o m*/
        public Predicate toPredicate(Root<ListSelectHeal> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
            return cb.equal(root.get(ListSelectHeal_.price), keyword);
        }
    };
}

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

public static Specification<Bill> sumPriceLike(final Double keyword) {
    return new Specification<Bill>() {

        @Override/*from w w  w .  ja  va2  s .  com*/
        public Predicate toPredicate(Root<Bill> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
            return cb.equal(root.get(Bill_.sumPrice), keyword);
        }
    };
}

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

public static Specification<Doctor> idWhere(final Integer keyword) {
    return new Specification<Doctor>() {
        @Override/*from w  ww.  jav  a  2  s .  co m*/
        public Predicate toPredicate(Root<Doctor> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
            return cb.equal(root.get(Employee_.id), keyword);
        }
    };
}

From source file:edu.chalmers.dat076.moviefinder.persistence.EpisodeSpecs.java

/**
 * /*www  . jav a2  s .  c o m*/
 * @param releaseYear
 * @return All Episodes released the year releaseYear
 */
public static Specification<Episode> hasReleaseYear(final int releaseYear) {
    return new Specification<Episode>() {
        @Override
        public Predicate toPredicate(Root<Episode> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
            return cb.equal(root.get(Episode_.releaseYear), releaseYear);
        }
    };
}

From source file:edu.chalmers.dat076.moviefinder.persistence.SeriesSpecs.java

/**
 * /* ww w  . j a va  2 s. c  om*/
 * @param releaseYear
 * @return All series first released the year releaseYear
 */
public static Specification<Series> hasReleaseYear(final int releaseYear) {
    return new Specification<Series>() {
        @Override
        public Predicate toPredicate(Root<Series> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
            return cb.equal(root.get(Series_.releaseYear), releaseYear);
        }
    };
}

From source file:com.gsr.myschool.server.repos.spec.UserSpec.java

public static Specification<User> isVip() {
    return new Specification<User>() {
        @Override/*w  w  w  . ja va2s .com*/
        public Predicate toPredicate(Root<User> userRoot, CriteriaQuery<?> query, CriteriaBuilder cb) {
            return cb.equal(userRoot.<Authority>get("authority"), Authority.ROLE_USER_VIP);
        }
    };
}

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

public static Specification<Staff> idWhere(final Integer keyword) {
    return new Specification<Staff>() {
        @Override/*w  ww  . ja va2 s . c om*/
        public Predicate toPredicate(Root<Staff> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
            return cb.equal(root.get(Staff_.id), keyword);
        }
    };
}

From source file:edu.chalmers.dat076.moviefinder.persistence.MovieSpecs.java

/**
 * // w  w  w. j ava2  s .  c o m
 * @param releaseYear
 * @return All movies with the release year releaseYear.
 */
public static Specification<Movie> hasReleaseYear(final int releaseYear) {
    return new Specification<Movie>() {
        @Override
        public Predicate toPredicate(Root<Movie> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
            return cb.equal(root.get(Movie_.releaseYear), releaseYear);
        }
    };
}