Selector s = f.selector("nodeTypeName", "x");
BindVariableValue b = f.bindVariable("var");
Constraint c = f.propertyExistence("x", "c");
PropertyValue p = f.propertyValue("x", "propertyName");
c = f.and(f.comparison(p, QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, b), c);
Ordering o = f.ascending(p);
Column col = f.column("selectorName", "propertyName", "columnName");
Ordering[] ords = new Ordering[]{o};
Column[] cols = new Column[]{col};
QueryObjectModel q = f.createQuery(s, c, ords, cols);
// assertEquals(Query.JCR_SQL2, q.getLanguage());