query.append(MeetupsRegistrationModelImpl.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(meetupsEntryId);
if (orderByComparator != null) {
Object[] values = orderByComparator.getOrderByValues(meetupsRegistration);
for (Object value : values) {
qPos.add(value);
}
}
List<MeetupsRegistration> list = q.list();
if (list.size() == 2) {
return list.get(1);
}
else {