Thks Myk.
But if I want to paging the result,how to do it? I mean that could hibernate limit the result count if I query several tables?
For example: like this query:
Code:
select g.groupname, r.roleid, u.username from Group g,Role r , User u where g.groupid=1 and r.role_description='good'.
You will find that it is difficult to paging. If I query one table ,I can paging like this:
Code:
Query q=session.createQuery("from Group");
setMaxResult(..);
setFirstResult(..);
But if more than one tables:
Code:
Query q=session.createQuery("select g.groupname, r.roleid, u.username from Group g,Role r , User u where g.groupid=1 and r.role_description='good'.");
setMaxResult(..);
setFirstResult(..);
What will return ? If it return a List, what will I get in this List?
Help!