query.append(MeetupsEntryModelImpl.ORDER_BY_JPQL);
}
String sql = query.toString();
Query q = session.createQuery(sql);
q.setFirstResult(0);
q.setMaxResults(2);
QueryPos qPos = QueryPos.getInstance(q);
qPos.add(companyId);
if (orderByComparator != null) {
Object[] values = orderByComparator.getOrderByValues(meetupsEntry);
for (Object value : values) {
qPos.add(value);
}
}
List<MeetupsEntry> list = q.list();
if (list.size() == 2) {
return list.get(1);
}
else {