Examples of le()


Examples of javax.persistence.criteria.CriteriaBuilder.le()

    public static List<Activity> notifiablesBetween(Date start, Date end) {
        CriteriaBuilder builder = em().getCriteriaBuilder();
        CriteriaQuery<Activity> cq = builder.createQuery(Activity.class);
        Root<Activity> activity = cq.from(Activity.class);
        Predicate provider = builder.equal(activity.get(PROVIDER), ProviderType.LinkIt);
        Predicate important = builder.le(activity.<Integer>get(LEVEL), 1);
        Predicate where = builder.and(provider, important);
        if (start != null) {
            Predicate after = builder.greaterThanOrEqualTo(activity.<Date>get(AT), start);
            where = builder.and(where, after);
        }
View Full Code Here

Examples of javax.persistence.criteria.CriteriaBuilder.le()

        CriteriaBuilder builder = em().getCriteriaBuilder();
        CriteriaQuery<Activity> cq = builder.createQuery(Activity.class);
        Root<Activity> activity = cq.from(Activity.class);
        Predicate givenMember = builder.equal(activity.get("member"), m);
        Predicate chosenProviders = builder.in(activity.get(PROVIDER)).value(providers);
        Predicate important = builder.le(activity.<Integer>get(LEVEL), 3);
        if (providers != null && !providers.isEmpty()) {
            cq.where(givenMember, chosenProviders, important);
        } else {
            cq.where(givenMember, important);
        }
View Full Code Here

Examples of javax.persistence.criteria.CriteriaBuilder.le()

            CriteriaBuilder builder = em().getCriteriaBuilder();
            CriteriaQuery<Activity> cq = builder.createQuery(Activity.class);
            Root<Activity> activity = cq.from(Activity.class);
            Predicate linkedMembers = builder.in(activity.get("member")).value(m.links);
            Predicate chosenProviders = builder.in(activity.get(PROVIDER)).value(providers);
            Predicate important = builder.le(activity.<Integer>get(LEVEL), 3);
            if (providers != null && !providers.isEmpty()) {
                cq.where(linkedMembers, chosenProviders, important);
            } else {
                cq.where(linkedMembers, important);
            }
View Full Code Here

Examples of javax.persistence.criteria.CriteriaBuilder.le()

            }
            if (end != null) {
                Predicate before = builder.lessThan(activity.<Date>get(AT), end);
                where = builder.and(where, before);
            }
            where = builder.and(where, builder.le(activity.<Integer>get(LEVEL), 2));
            cq.where(where);
            cq.orderBy(builder.desc(activity.get(AT)));
            activities = em().createQuery(cq).getResultList();
        }
        return activities;
View Full Code Here

Examples of javax.persistence.criteria.CriteriaBuilder.le()

        CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder();
        CriteriaQuery<Person> personQuery = criteriaBuilder.createQuery(Person.class);
        Root<Person> from = personQuery.from(Person.class);
        personQuery.select(from.alias("p"));
        personQuery.where(criteriaBuilder.or(criteriaBuilder.equal(from.get("personName"), "vivek"),
                criteriaBuilder.le((Expression) from.get("age"), new Integer(32))));
        String actual = CriteriaQueryTranslator.translate(personQuery);
        Assert.assertEquals(expected.trim(), actual.trim());
    }

    @Test
View Full Code Here

Examples of javax.persistence.criteria.CriteriaBuilder.le()

        CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder();
        CriteriaQuery<Person> personQuery = criteriaBuilder.createQuery(Person.class);
        Root<Person> from = personQuery.from(Person.class);
        personQuery.select(from.alias("p"));
        personQuery.where(criteriaBuilder.and(criteriaBuilder.equal(from.get("personName"), "vivek"),
                criteriaBuilder.gt((Expression)from.get("age"), 32),criteriaBuilder.le((Expression)from.get("salary"), 3200.01)));
        String actual = CriteriaQueryTranslator.translate(personQuery);
        Assert.assertEquals(expected.trim(), actual.trim());
    }

    @Test
View Full Code Here

Examples of javax.persistence.criteria.CriteriaBuilder.le()

        CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder();
        CriteriaQuery<Person> personQuery = criteriaBuilder.createQuery(Person.class);
        Root<Person> from = personQuery.from(Person.class);
        personQuery.select(from.alias("p"));
        personQuery.where(criteriaBuilder.and(criteriaBuilder.equal(from.get("personName"), "vivek"),
                criteriaBuilder.gt((Expression)from.get("age"), 32),criteriaBuilder.le((Expression)from.get("salary"), 3200.01)));
        personQuery.orderBy(criteriaBuilder.desc(from.get("personName")));
        String actual = CriteriaQueryTranslator.translate(personQuery);
        Assert.assertEquals(expected.trim(), actual.trim());
    }
View Full Code Here

Examples of javax.persistence.criteria.CriteriaBuilder.le()

          } else if (t == Filter.NOT_EQUAL) {
            predicates.add(builder.notEqual(numPath, numVal));
          } else if (t == Filter.LESS_THAN) {
            predicates.add(builder.lt(numPath, numVal));
          } else if (t == Filter.LESS_THAN_EQUAL) {
            predicates.add(builder.le(numPath, numVal));
          } else if (t == Filter.GREATER_THAN) {
            predicates.add(builder.gt(numPath, numVal));
          } else if (t == Filter.GREATER_THAN_EQUAL) {
            predicates.add(builder.ge(numPath, numVal));
          }
View Full Code Here

Examples of javax.persistence.criteria.CriteriaBuilder.le()

            continue;
          } else if (t == Filter.NOT_EQUAL) {
            log.warn("Adaptrex Store Error: Filter: Float inequality not implemented: " + val);
            continue;
          } else if (t == Filter.LESS_THAN || t == Filter.LESS_THAN_EQUAL) {
            predicates.add(builder.le(numPath, numVal));
          } else if (t == Filter.GREATER_THAN || t == Filter.GREATER_THAN_EQUAL) {
            predicates.add(builder.ge(numPath, numVal));
          }         
         
        /*
 
View Full Code Here

Examples of javax.persistence.criteria.CriteriaBuilder.le()

          } else if (t == Filter.NOT_EQUAL) {
            predicates.add(builder.notEqual(numPath, numVal));
          } else if (t == Filter.LESS_THAN) {
            predicates.add(builder.lt(numPath, numVal));
          } else if (t == Filter.LESS_THAN_EQUAL) {
            predicates.add(builder.le(numPath, numVal));
          } else if (t == Filter.GREATER_THAN) {
            predicates.add(builder.gt(numPath, numVal));
          } else if (t == Filter.GREATER_THAN_EQUAL) {
            predicates.add(builder.ge(numPath, numVal));
          }
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.