protected com.liferay.portal.model.Portlet[] findByG_C_PrevAndNext(
PortletPK portletPK, String groupId, String companyId,
OrderByComparator obc) throws NoSuchPortletException, SystemException {
com.liferay.portal.model.Portlet portlet = findByPrimaryKey(portletPK);
int count = countByG_C(groupId, companyId);
Session session = null;
try {
session = openSession();
StringBuffer query = new StringBuffer();
query.append(
"FROM Portlet IN CLASS com.liferay.portal.ejb.PortletHBM WHERE ");
query.append("groupId = ?");
query.append(" AND ");
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++, groupId);
q.setString(queryPos++, companyId);
com.liferay.portal.model.Portlet[] array = new com.liferay.portal.model.Portlet[3];