@Test public void testDefaultJoinFromEntityPath() { JoinerQueryBase<Group, Group> query = Q.from(QGroup.group).joins(QUser.user1); JoinDescription join = query.getJoins().iterator().next(); Assert.assertEquals(JoinType.LEFTJOIN, join.getJoinType()); Assert.assertEquals(QUser.user1, join.getAlias()); }
@Test public void testDefaultNestedJoinFromEntityPath() { JoinerQueryBase<Group, Group> query = Q.from(QGroup.group).joins(J.left(QUser.user1).nested(QStatus.status)); JoinDescription join = query.getJoins().iterator().next().getChildren().iterator().next(); Assert.assertEquals(JoinType.LEFTJOIN, join.getJoinType()); Assert.assertEquals(J.path(QUser.user1, QStatus.status), join.getAlias()); }