@Override
	public CommerceDiscount[] findByG_C_PrevAndNext(long commerceDiscountId,
		long groupId, String couponCode,
		OrderByComparator<CommerceDiscount> orderByComparator)
		throws NoSuchDiscountException {
		CommerceDiscount commerceDiscount = findByPrimaryKey(commerceDiscountId);

		Session session = null;

		try {
			session = openSession();

			CommerceDiscount[] array = new CommerceDiscountImpl[3];

			array[0] = getByG_C_PrevAndNext(session, commerceDiscount, groupId,
					couponCode, orderByComparator, true);

			array[1] = commerceDiscount;

			array[2] = getByG_C_PrevAndNext(session, commerceDiscount, groupId,
					couponCode, orderByComparator, false);

			return array;
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}
@ Override public CommerceDiscount [ ] findByG_C_PrevAndNext ( long commerceDiscountId , long groupId , String couponCode , OrderByComparator < CommerceDiscount > orderByComparator ) throws NoSuchDiscountException { CommerceDiscount commerceDiscount = findByPrimaryKey ( commerceDiscountId ) ; Session session = null ; try { session = openSession ( ) ; CommerceDiscount [ ] array = new CommerceDiscountImpl [ 3 ] ; array [ 0 ] = getByG_C_PrevAndNext ( session , commerceDiscount , groupId , couponCode , orderByComparator , true ) ; array [ 1 ] = commerceDiscount ; array [ 2 ] = getByG_C_PrevAndNext ( session , commerceDiscount , groupId , couponCode , orderByComparator , false ) ; return array ; } catch ( Exception e ) { throw processException ( e ) ; } finally { closeSession ( session ) ; } }
Returns the commerce discounts before and after the current commerce discount in the ordered set where groupId = &#63; and couponCode = &#63;.

@param commerceDiscountId the primary key of the current commerce discount
@param groupId the group ID
@param couponCode the coupon code
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the previous, current, and next commerce discount
@throws NoSuchDiscountException if a commerce discount with the primary key could not be found