this may be a noob question and i have dig through this for some time , most tutorial tell me how to get the data in one entity but what if there is another scalar (and it come from another table) ? here is my code
Quote:
String sql = "select A.*,sum(B.something)" +
" from A " +
" left join B " +
" on A.ID = B.ID " +
" group by B.something";
List l = this.getSession().createSQLQuery(sql).addEntity("a",A.class).addScalar("B.something", Hibernate.LONG).list();
then how can i iterate through l to get Entity A and sum value of B ?