+ " ORDER BY o.quantity DESC, a.zipCode";
compare(jpql, q);
}
public void testOrderByExpression() {
DomainObject o = qb.createQueryDefinition(Order.class);
DomainObject a = o.join("customer").join("address");
SelectItem taxedCost = o.get("cost").times(1.08);
o.select(o.get("quantity"), taxedCost, a.get("zipCode"))
.where(a.get("state").equal("CA")
.and(a.get("county").equal("Santa Clara")))
.orderBy(o.get("quantity"), taxedCost, a.get("zipCode"));
String jpql = "SELECT o.quantity, o.cost*1.08 as o2, a.zipCode"
+ " FROM Order o JOIN o.customer c JOIN c.address a"
+ " WHERE a.state = 'CA' AND a.county = 'Santa Clara'"
+ " ORDER BY o.quantity, o2, a.zipCode";