@Override
	public CPSpecificationOption[] findByCPOptionCategoryId_PrevAndNext(
		long CPSpecificationOptionId, long CPOptionCategoryId,
		OrderByComparator<CPSpecificationOption> orderByComparator)
		throws NoSuchCPSpecificationOptionException {
		CPSpecificationOption cpSpecificationOption = findByPrimaryKey(CPSpecificationOptionId);

		Session session = null;

		try {
			session = openSession();

			CPSpecificationOption[] array = new CPSpecificationOptionImpl[3];

			array[0] = getByCPOptionCategoryId_PrevAndNext(session,
					cpSpecificationOption, CPOptionCategoryId,
					orderByComparator, true);

			array[1] = cpSpecificationOption;

			array[2] = getByCPOptionCategoryId_PrevAndNext(session,
					cpSpecificationOption, CPOptionCategoryId,
					orderByComparator, false);

			return array;
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}
@ Override public CPSpecificationOption [ ] findByCPOptionCategoryId_PrevAndNext ( long CPSpecificationOptionId , long CPOptionCategoryId , OrderByComparator < CPSpecificationOption > orderByComparator ) throws NoSuchCPSpecificationOptionException { CPSpecificationOption cpSpecificationOption = findByPrimaryKey ( CPSpecificationOptionId ) ; Session session = null ; try { session = openSession ( ) ; CPSpecificationOption [ ] array = new CPSpecificationOptionImpl [ 3 ] ; array [ 0 ] = getByCPOptionCategoryId_PrevAndNext ( session , cpSpecificationOption , CPOptionCategoryId , orderByComparator , true ) ; array [ 1 ] = cpSpecificationOption ; array [ 2 ] = getByCPOptionCategoryId_PrevAndNext ( session , cpSpecificationOption , CPOptionCategoryId , orderByComparator , false ) ; return array ; } catch ( Exception e ) { throw processException ( e ) ; } finally { closeSession ( session ) ; } }
Returns the cp specification options before and after the current cp specification option in the ordered set where CPOptionCategoryId = &#63;.

@param CPSpecificationOptionId the primary key of the current cp specification option
@param CPOptionCategoryId the cp option category ID
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the previous, current, and next cp specification option
@throws NoSuchCPSpecificationOptionException if a cp specification option with the primary key could not be found