Package javax.persistence.criteria

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


        // Get results using custom class
        CriteriaQuery<OrderProducer> constructQuery = qb.createQuery(OrderProducer.class);
        Root<Order> order2 = constructQuery.from(Order.class);
        Join<Item, Producer> producer2 = order.join(Order_.items).join(Item_.producer);
        constructQuery.select(qb.construct(OrderProducer.class, order2, producer2));
        constructQuery.where(qb.equal(order2.get(Order_.filled), Boolean.TRUE));
        TypedQuery<OrderProducer> typedQuery = em.createQuery(constructQuery);
        List<OrderProducer> constructResults = typedQuery.getResultList();

        assertEquals(N_ORDERS / 2 * N_ITEMS_PER_ORDER, jpqlResults.size());
View Full Code Here


        // Get results using custom class
        CriteriaQuery<OrderProducer> constructQuery = qb.createQuery(OrderProducer.class);
        Root<Order> order2 = constructQuery.from(Order.class);
        Join<Item, Producer> producer2 = order.join(Order_.items).join(Item_.producer);
        constructQuery.select(qb.construct(OrderProducer.class, order2, producer2));
        constructQuery.where(qb.equal(order2.get(Order_.filled), Boolean.TRUE));
        TypedQuery<OrderProducer> typedQuery = em.createQuery(constructQuery);
        List<OrderProducer> constructResults = typedQuery.getResultList();

        assertEquals(N_ORDERS / 2 * N_ITEMS_PER_ORDER, jpqlResults.size());
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.