query.append("ORDER BY ");
query.append("userId DESC").append(", ");
query.append("createDate DESC");
}
Query q = session.createQuery(query.toString());
int queryPos = 0;
q.setString(queryPos++, userId);
List list = new ArrayList();
if (getDialect().supportsLimit()) {
q.setMaxResults(end - begin);
q.setFirstResult(begin);
Iterator itr = q.list().iterator();
while (itr.hasNext()) {
PasswordTrackerHBM passwordTrackerHBM = (PasswordTrackerHBM)itr.next();
list.add(PasswordTrackerHBMUtil.model(passwordTrackerHBM));
}
}
else {
ScrollableResults sr = q.scroll();
if (sr.first() && sr.scroll(begin)) {
for (int i = begin; i < end; i++) {
PasswordTrackerHBM passwordTrackerHBM = (PasswordTrackerHBM)sr.get(0);
list.add(PasswordTrackerHBMUtil.model(