@Test public void requestWihtResultAsObjects() { String sql = "select u.f_login, d.f_name " + "from users u left outer join departments d on u.fk_department = d.f_pid " + "order by u.f_login"; List<Object[]> users = H.<Object[]> sqlRequest(sql).list(); assertThat(users).hasSize(2); assertThat(users.get(0)).containsOnly("login_a", "department_a"); assertThat(users.get(1)).containsOnly("login_b", "department_b"); }
public List<T> list() { return query.list(); }
HibernateSqlRequest { public List<T> list() { return query.list(); } }
HibernateSqlRequest { public List<T> list() { return query.list(); } private  HibernateSqlRequest(String query); }
HibernateSqlRequest { public List<T> list() { return query.list(); } private  HibernateSqlRequest(String query); HibernateSqlRequest<T> p(String name, Object val); HibernateSqlRequest<T> p(String name, Object... vals); HibernateSqlRequest<T> maxResults(int maxResults); HibernateSqlRequest<T> transform(Class<?> clazz); HibernateSqlRequest<T> useTransformer(ResultTransformer transformer); T first(); List<T> list(); int count(); HibernateSqlRequest<T> addEntity(Class<?> entityType); HibernateSqlRequest<T> addEntity(String tableAlias, Class<?> entityType); HibernateSqlRequest<T> addJoin(String tableAlias, String path); HibernateSqlRequest<T> addJoin(String tableAlias, String ownerTableAlias,
            String joinPropertyName); static HibernateSqlRequest<T> create(String query); }
HibernateSqlRequest { public List<T> list() { return query.list(); } private  HibernateSqlRequest(String query); HibernateSqlRequest<T> p(String name, Object val); HibernateSqlRequest<T> p(String name, Object... vals); HibernateSqlRequest<T> maxResults(int maxResults); HibernateSqlRequest<T> transform(Class<?> clazz); HibernateSqlRequest<T> useTransformer(ResultTransformer transformer); T first(); List<T> list(); int count(); HibernateSqlRequest<T> addEntity(Class<?> entityType); HibernateSqlRequest<T> addEntity(String tableAlias, Class<?> entityType); HibernateSqlRequest<T> addJoin(String tableAlias, String path); HibernateSqlRequest<T> addJoin(String tableAlias, String ownerTableAlias,
            String joinPropertyName); static HibernateSqlRequest<T> create(String query);  }