protected com.liferay.portal.model.UserTracker[] findByCompanyId_PrevAndNext(
String userTrackerId, String companyId, OrderByComparator obc)
throws NoSuchUserTrackerException, SystemException {
com.liferay.portal.model.UserTracker userTracker = findByPrimaryKey(userTrackerId);
int count = countByCompanyId(companyId);
Session session = null;
try {
session = openSession();
StringBuffer query = new StringBuffer();
query.append(
"FROM UserTracker IN CLASS com.liferay.portal.ejb.UserTrackerHBM WHERE ");
query.append("companyId = ?");
query.append(" ");
if (obc != null) {
query.append("ORDER BY " + obc.getOrderBy());
}
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();