查询语句:
SELECT n0.*,t0.* FROM T_NAME n0 RIGHT JOIN T_TITLE t0 ON n0.ID = t0.SID
IMultiQuery multiQuery = new MultiQueryImpl(); AliasTable nameTable = multiQuery.table(Name.class); AliasTable titleTable = multiQuery.join(Title.class); multiQuery.join( new Join(titleTable, JoinType.RIGHT_JOIN). on(nameTable.c(Name.T_ID), titleTable.c(Title.T_SID))); multiQuery.createQuery(Map.class, nameTable.c(Expression.EXPRESSION_ALL), titleTable.c(Expression.EXPRESSION_ALL)); List<Map> list = nameService.query(multiQuery); System.out.println("---------------right join----------"); for(Map map : list) { System.out.println(map); }
结果: