QCat mate_mate = new QCat("mate_mate");
mixin.from(cat);
mixin.leftJoin(cat.mate, mate);
mixin.orderBy(cat.mate.mate.name.asc());
QueryMetadata md = mixin.getMetadata();
assertEquals(Arrays.asList(
new JoinExpression(JoinType.DEFAULT, cat),
new JoinExpression(JoinType.LEFTJOIN, cat.mate.as(mate)),
new JoinExpression(JoinType.LEFTJOIN, mate.mate.as(mate_mate))),
md.getJoins());
assertEquals(Arrays.asList(mate_mate.name.asc()),
md.getOrderBy());
}