查询语句:
SELECT n0.*,t0.* FROM T_NAME n0 LEFT 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). 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("---------------left join----------"); for(Map map : list) { System.out.println(map); }
结果