try {
session = openSession();
Query q = session.createQuery(sql);
QueryPos qPos = QueryPos.getInstance(q);
if (certificateIDs != null) {
for (Integer certificateID : certificateIDs) {
if (certificateID != null) {
qPos.add(certificateID);
}
}
}
if (siteID != null) {
qPos.add(siteID.intValue());
}
if (!pagination) {
list = (List<LFCertificateSite>) QueryUtil.list(q,
getDialect(), start, end, false);