@Override
	public CommerceOrderItem fetchByCPInstanceId_Last(long CPInstanceId,
		OrderByComparator<CommerceOrderItem> orderByComparator) {
		int count = countByCPInstanceId(CPInstanceId);

		if (count == 0) {
			return null;
		}

		List<CommerceOrderItem> list = findByCPInstanceId(CPInstanceId,
				count - 1, count, orderByComparator);

		if (!list.isEmpty()) {
			return list.get(0);
		}

		return null;
	}
@ Override public CommerceOrderItem fetchByCPInstanceId_Last ( long CPInstanceId , OrderByComparator < CommerceOrderItem > orderByComparator ) { int count = countByCPInstanceId ( CPInstanceId ) ; if ( count == 0 ) { return null ; } List < CommerceOrderItem > list = findByCPInstanceId ( CPInstanceId , count - 1 , count , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ; }
Returns the last commerce order item in the ordered set where CPInstanceId = &#63;.

@param CPInstanceId the cp instance ID
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the last matching commerce order item, or <code>null</code> if a matching commerce order item could not be found