if (orderBy != null)
sb.append(" Order By ").append(orderBy);
try {
Query query = session.createQuery(sb.toString());
query.setLockMode("this", lockMode);
return query.iterate();
}
catch (Exception e) {
e.printStackTrace();
throw new PersistentException(e);
}