Examples of tuple()


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

        // Get results using Tuple
        CriteriaBuilder qb = em.getCriteriaBuilder();
        CriteriaQuery<Tuple> criteriaQuery = qb.createTupleQuery();
        Root<Order> order = criteriaQuery.from(Order.class);
        Join<Item, Producer> producer = order.join(Order_.items).join(Item_.producer);
        criteriaQuery.select(qb.tuple(order, producer));
        criteriaQuery.where(qb.equal(order.get(Order_.filled), Boolean.TRUE));
        TypedQuery<Tuple> eq = em.createQuery(criteriaQuery);
        List<Tuple> criteriaResults = eq.getResultList();

        // Get results using custom class
View Full Code Here

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

        Predicate whereClause = cb.and(cb.lessThanOrEqualTo(requestDate, to), cb.greaterThanOrEqualTo(requestDate, from));
        if (spec != null) {
            whereClause = cb.and(whereClause, spec.toPredicate(requestRoot, cbQuery, cb));
        }
        final CompoundSelection<Tuple> selection = cb.tuple(requestDateByType, cb.count(requestRoot));
        cbQuery.select(selection)
                .where(whereClause)
                .groupBy(requestDateByType)
                .orderBy(cb.desc(requestDateByType));
View Full Code Here

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

                break;
            default:
                throw new IllegalArgumentException("Not a valid value: " + direction);
        }

        query.select(cb.tuple(path, cb.count(root)))
                .where(predicate)
                .groupBy(path)
                .orderBy(order);

        return Lists.transform(_EntityManager.createQuery(query).getResultList(), new Function<Tuple, Pair<T, Integer>>() {
View Full Code Here

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

        // Get results using Tuple
        CriteriaBuilder qb = em.getCriteriaBuilder();
        CriteriaQuery<Tuple> criteriaQuery = qb.createTupleQuery();
        Root<Order> order = criteriaQuery.from(Order.class);
        Join<Item, Producer> producer = order.join(Order_.items).join(Item_.producer);
        criteriaQuery.select(qb.tuple(order, producer));
        criteriaQuery.where(qb.equal(order.get(Order_.filled), Boolean.TRUE));
        TypedQuery<Tuple> eq = em.createQuery(criteriaQuery);
        List<Tuple> criteriaResults = eq.getResultList();

        // Get results using custom class
View Full Code Here

Examples of javax.persistence.criteria.QueryBuilder.tuple()

        // Get results using Tuple
        QueryBuilder qb = em.getQueryBuilder();
        CriteriaQuery<Tuple> criteriaQuery = qb.createTupleQuery();
        Root<Order> order = criteriaQuery.from(Order.class);
        Join<Item, Producer> producer = order.join(Order_.items).join(Item_.producer);
        criteriaQuery.select(qb.tuple(order, producer));
        criteriaQuery.where(qb.equal(order.get(Order_.filled), Boolean.TRUE));
        TypedQuery<Tuple> eq = em.createQuery(criteriaQuery);
        List<Tuple> criteriaResults = eq.getResultList();

        // Get results using custom class
View Full Code Here

Examples of kodkod.instance.TupleFactory.tuple()

        removePartition(domain.min());
       
        final TupleFactory f = bounds.universe().factory();
       
        if (aggressive) {
          bounds.boundExactly(first, f.setOf(f.tuple(1, domain.min())));
          bounds.boundExactly(last, f.setOf(f.tuple(1, domain.max())));
          bounds.boundExactly(ordered, bounds.upperBound(total.ordered()));
          bounds.boundExactly(relation, f.setOf(2, ordering));
         
          return Formula.TRUE;
View Full Code Here

Examples of kodkod.instance.TupleFactory.tuple()

       
        final TupleFactory f = bounds.universe().factory();
       
        if (aggressive) {
          bounds.boundExactly(first, f.setOf(f.tuple(1, domain.min())));
          bounds.boundExactly(last, f.setOf(f.tuple(1, domain.max())));
          bounds.boundExactly(ordered, bounds.upperBound(total.ordered()));
          bounds.boundExactly(relation, f.setOf(2, ordering));
         
          return Formula.TRUE;
         
View Full Code Here

Examples of kodkod.instance.TupleFactory.tuple()

        } else {
          final Relation firstConst = Relation.unary("SYM_BREAK_CONST_"+first.name());
          final Relation lastConst = Relation.unary("SYM_BREAK_CONST_"+last.name());
          final Relation ordConst = Relation.unary("SYM_BREAK_CONST_"+ordered.name());
          final Relation relConst = Relation.binary("SYM_BREAK_CONST_"+relation.name());
          bounds.boundExactly(firstConst, f.setOf(f.tuple(1, domain.min())));
          bounds.boundExactly(lastConst, f.setOf(f.tuple(1, domain.max())));
          bounds.boundExactly(ordConst, bounds.upperBound(total.ordered()));
          bounds.boundExactly(relConst, f.setOf(2, ordering));
         
          return Formula.and(first.eq(firstConst), last.eq(lastConst), ordered.eq(ordConst), relation.eq(relConst));
View Full Code Here

Examples of kodkod.instance.TupleFactory.tuple()

          final Relation firstConst = Relation.unary("SYM_BREAK_CONST_"+first.name());
          final Relation lastConst = Relation.unary("SYM_BREAK_CONST_"+last.name());
          final Relation ordConst = Relation.unary("SYM_BREAK_CONST_"+ordered.name());
          final Relation relConst = Relation.binary("SYM_BREAK_CONST_"+relation.name());
          bounds.boundExactly(firstConst, f.setOf(f.tuple(1, domain.min())));
          bounds.boundExactly(lastConst, f.setOf(f.tuple(1, domain.max())));
          bounds.boundExactly(ordConst, bounds.upperBound(total.ordered()));
          bounds.boundExactly(relConst, f.setOf(2, ordering));
         
          return Formula.and(first.eq(firstConst), last.eq(lastConst), ordered.eq(ordConst), relation.eq(relConst));
//          return first.eq(firstConst).and(last.eq(lastConst)).and( ordered.eq(ordConst)).and( relation.eq(relConst));
View Full Code Here

Examples of kodkod.instance.TupleFactory.tuple()

       // Form the list
       list.add(head);
       while(true) {
          // Find head.next
          Tuple headnext = null;
          for(Tuple x: b) if (x.atom(0)==head.atom(0)) { headnext = f.tuple(x.atom(1)); break; }
          // If we've reached the end of the chain, and indeed we've formed exactly n elements (and all are in u), we're done
          if (headnext==null) return list.size()==n ? list : null;
          // If we've accumulated more than n elements, or if we reached an element not in u, then we declare failure
          if (list.size()==n || !u.contains(headnext)) return null;
          // Move on to the next step
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.