示例#1
0
  @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());
  }
示例#2
0
  @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());
  }