Query q = session.createQuery(query.toString());
int queryPos = 0;
q.setString(queryPos++, companyId);
com.liferay.portal.model.UserTracker[] array = new com.liferay.portal.model.UserTracker[3];
ScrollableResults sr = q.scroll();
if (sr.first()) {
while (true) {
UserTrackerHBM userTrackerHBM = (UserTrackerHBM)sr.get(0);
if (userTrackerHBM == null) {
break;
}
com.liferay.portal.model.UserTracker curUserTracker = UserTrackerHBMUtil.model(userTrackerHBM);
int value = obc.compare(userTracker, curUserTracker);
if (value == 0) {
if (!userTracker.equals(curUserTracker)) {
break;
}
array[1] = curUserTracker;
if (sr.previous()) {
array[0] = UserTrackerHBMUtil.model((UserTrackerHBM)sr.get(
0));
}
sr.next();
if (sr.next()) {
array[2] = UserTrackerHBMUtil.model((UserTrackerHBM)sr.get(
0));
}
break;
}
if (count == 1) {
break;
}
count = (int)Math.ceil(count / 2.0);
if (value < 0) {
if (!sr.scroll(count * -1)) {
break;
}
}
else {
if (!sr.scroll(count)) {
break;
}
}
}
}