Hi, I'have a strange behaviour when I usa pagination on sqlquery...
I perform a query like "select p.code from person p, job j where p.id=j.person and p.name=:name";
Query query = cntSQL.cmdHome.getSession().createSQLQuery(sql); query.setString("name", user.getName());
nt start = (paging.getCurrentPage() - 1) * paging.getPageSize(); int end = paging.getPageSize();
query.setFirstResult(start); query.setMaxResults(end); List<String> listPerson = query.list();
The first time listPerson contains a list of user codes... But when i search for next page, the query returns a list og java Object like ["user code1", element number] (for example is page size is 10, the first time I have [a1234, a1235, ...] the second time [[a6789, 11], [a3513, 12]...])
Can anyone help me?
10x
|