@Override
	public CommerceOrder[] findByG_U_O_PrevAndNext(long commerceOrderId,
		long groupId, long userId, int orderStatus,
		OrderByComparator<CommerceOrder> orderByComparator)
		throws NoSuchOrderException {
		CommerceOrder commerceOrder = findByPrimaryKey(commerceOrderId);

		Session session = null;

		try {
			session = openSession();

			CommerceOrder[] array = new CommerceOrderImpl[3];

			array[0] = getByG_U_O_PrevAndNext(session, commerceOrder, groupId,
					userId, orderStatus, orderByComparator, true);

			array[1] = commerceOrder;

			array[2] = getByG_U_O_PrevAndNext(session, commerceOrder, groupId,
					userId, orderStatus, orderByComparator, false);

			return array;
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}
@ Override public CommerceOrder [ ] findByG_U_O_PrevAndNext ( long commerceOrderId , long groupId , long userId , int orderStatus , OrderByComparator < CommerceOrder > orderByComparator ) throws NoSuchOrderException { CommerceOrder commerceOrder = findByPrimaryKey ( commerceOrderId ) ; Session session = null ; try { session = openSession ( ) ; CommerceOrder [ ] array = new CommerceOrderImpl [ 3 ] ; array [ 0 ] = getByG_U_O_PrevAndNext ( session , commerceOrder , groupId , userId , orderStatus , orderByComparator , true ) ; array [ 1 ] = commerceOrder ; array [ 2 ] = getByG_U_O_PrevAndNext ( session , commerceOrder , groupId , userId , orderStatus , orderByComparator , false ) ; return array ; } catch ( Exception e ) { throw processException ( e ) ; } finally { closeSession ( session ) ; } }
Returns the commerce orders before and after the current commerce order in the ordered set where groupId = &#63; and userId = &#63; and orderStatus = &#63;.

@param commerceOrderId the primary key of the current commerce order
@param groupId the group ID
@param userId the user ID
@param orderStatus the order status
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the previous, current, and next commerce order
@throws NoSuchOrderException if a commerce order with the primary key could not be found