About Question enthuware.oce-jpad.v6.2.578 :
Posted: Wed Sep 02, 2015 5:11 pm
On this option:
Are said: Since it is specified in the problem statement that Customer/Order is a unidirectional relationship, you should assume that there is no customer field in Order. Therefore, you cannot join order with customer. Had the relationship been bidirectional, this would have been a valid option.
But, asc() and desc() methods are available in CriteriaBuilder and not on Path?
Code: Select all
CriteriaQuery q = cb.createQuery();
Root<Order> c = q.from(Order.class);
Join<Order, Customer> o = c.join(Order_.customer);
q.orderBy(cb.asc(o.get(Order_.quantity)).asc(c.get(Customer_.name)));
q.select(cb.tuple(o, c.get(Customer_.name)));
But, asc() and desc() methods are available in CriteriaBuilder and not on Path?