public void testOrderByDesc() throws Exception {
createThreePaintings();
String ejbql1 = "SELECT p FROM Painting p ORDER BY p.paintingTitle DESC";
EJBQLQuery query1 = new EJBQLQuery(ejbql1);
List<?> results1 = context.performQuery(query1);
assertEquals(3, results1.size());
assertEquals(33003, Cayenne.intPKForObject((Persistent) results1.get(0)));
assertEquals(33002, Cayenne.intPKForObject((Persistent) results1.get(1)));
assertEquals(33001, Cayenne.intPKForObject((Persistent) results1.get(2)));
String ejbql2 = "SELECT p FROM Painting p ORDER BY p.estimatedPrice DESC";
EJBQLQuery query2 = new EJBQLQuery(ejbql2);
List<?> results2 = context.performQuery(query2);
assertEquals(3, results2.size());
assertEquals(33001, Cayenne.intPKForObject((Persistent) results2.get(0)));