code: @Override
  	public CPDefinitionGroupedEntry[] findByCPDefinitionId_PrevAndNext(
  		long CPDefinitionGroupedEntryId, long CPDefinitionId,
  		OrderByComparator<CPDefinitionGroupedEntry> orderByComparator)
  		throws NoSuchCPDefinitionGroupedEntryException {
  		CPDefinitionGroupedEntry cpDefinitionGroupedEntry = findByPrimaryKey(CPDefinitionGroupedEntryId);
  
  		Session session = null;
  
  		try {
  			session = openSession();
  
  			CPDefinitionGroupedEntry[] array = new CPDefinitionGroupedEntryImpl[3];
  
  			array[0] = getByCPDefinitionId_PrevAndNext(session,
  					cpDefinitionGroupedEntry, CPDefinitionId,
  					orderByComparator, true);
  
  			array[1] = cpDefinitionGroupedEntry;
  
  			array[2] = getByCPDefinitionId_PrevAndNext(session,
  					cpDefinitionGroupedEntry, CPDefinitionId,
  					orderByComparator, false);
  
  			return array;
  		}
  		catch (Exception e) {
  			throw processException(e);
  		}
  		finally {
  			closeSession(session);
  		}
  	}
docs: Returns the cp definition grouped entries before and after the current cp definition grouped entry in the ordered set where CPDefinitionId = &#63;.
  
  @param CPDefinitionGroupedEntryId the primary key of the current cp definition grouped entry
  @param CPDefinitionId the cp definition ID
  @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
  @return the previous, current, and next cp definition grouped entry
  @throws NoSuchCPDefinitionGroupedEntryException if a cp definition grouped entry with the primary key could not be found