try {
session = openSession();
Query q = session.createQuery(sql);
QueryPos qPos = QueryPos.getInstance(q);
if (certificateID != null) {
qPos.add(certificateID.longValue());
}
if (!pagination) {
list = (List<LFCertificateUser>) QueryUtil.list(q,
getDialect(), start, end, false);