@Test
public void Join_With() {
QCat cat = QCat.cat;
JPQLSerializer serializer = new JPQLSerializer(HQLTemplates.DEFAULT);
QueryMetadata md = new DefaultQueryMetadata();
md.addJoin(JoinType.DEFAULT, cat);
md.addJoin(JoinType.INNERJOIN, cat.mate);
md.addJoinCondition(cat.mate.alive);
serializer.serialize(md, false, null);
assertEquals("select cat\nfrom Cat cat\n inner join cat.mate with cat.mate.alive", serializer.toString());
}