factory.equiJoinCondition("car1", "car:maker", "car2", "car:maker"));
Column[] columns = new Column[] {factory.column("car1", null, null)};
Constraint constraint = factory.comparison(factory.propertyValue("car1", "car:maker"),
QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO,
factory.literal(session.getValueFactory().createValue("Toyota")));
Ordering[] orderings = new Ordering[] {factory.descending(factory.propertyValue("car1", "car:year"))};
Query query = factory.createQuery(join, constraint, orderings, columns);
QueryResult result = query.execute();
validateQuery().rowCount(9).hasColumns(carColumnNames("car1")).validate(query, result);
}