@Override
	public CommerceNotificationTemplateUserSegmentRel[] findByCommerceUserSegmentEntryId_PrevAndNext(
		long commerceNotificationTemplateUserSegmentRelId,
		long commerceUserSegmentEntryId,
		OrderByComparator<CommerceNotificationTemplateUserSegmentRel> orderByComparator)
		throws NoSuchNotificationTemplateUserSegmentRelException {
		CommerceNotificationTemplateUserSegmentRel commerceNotificationTemplateUserSegmentRel =
			findByPrimaryKey(commerceNotificationTemplateUserSegmentRelId);

		Session session = null;

		try {
			session = openSession();

			CommerceNotificationTemplateUserSegmentRel[] array = new CommerceNotificationTemplateUserSegmentRelImpl[3];

			array[0] = getByCommerceUserSegmentEntryId_PrevAndNext(session,
					commerceNotificationTemplateUserSegmentRel,
					commerceUserSegmentEntryId, orderByComparator, true);

			array[1] = commerceNotificationTemplateUserSegmentRel;

			array[2] = getByCommerceUserSegmentEntryId_PrevAndNext(session,
					commerceNotificationTemplateUserSegmentRel,
					commerceUserSegmentEntryId, orderByComparator, false);

			return array;
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}
@ Override public CommerceNotificationTemplateUserSegmentRel [ ] findByCommerceUserSegmentEntryId_PrevAndNext ( long commerceNotificationTemplateUserSegmentRelId , long commerceUserSegmentEntryId , OrderByComparator < CommerceNotificationTemplateUserSegmentRel > orderByComparator ) throws NoSuchNotificationTemplateUserSegmentRelException { CommerceNotificationTemplateUserSegmentRel commerceNotificationTemplateUserSegmentRel = findByPrimaryKey ( commerceNotificationTemplateUserSegmentRelId ) ; Session session = null ; try { session = openSession ( ) ; CommerceNotificationTemplateUserSegmentRel [ ] array = new CommerceNotificationTemplateUserSegmentRelImpl [ 3 ] ; array [ 0 ] = getByCommerceUserSegmentEntryId_PrevAndNext ( session , commerceNotificationTemplateUserSegmentRel , commerceUserSegmentEntryId , orderByComparator , true ) ; array [ 1 ] = commerceNotificationTemplateUserSegmentRel ; array [ 2 ] = getByCommerceUserSegmentEntryId_PrevAndNext ( session , commerceNotificationTemplateUserSegmentRel , commerceUserSegmentEntryId , orderByComparator , false ) ; return array ; } catch ( Exception e ) { throw processException ( e ) ; } finally { closeSession ( session ) ; } }
Returns the commerce notification template user segment rels before and after the current commerce notification template user segment rel in the ordered set where commerceUserSegmentEntryId = &#63;.

@param commerceNotificationTemplateUserSegmentRelId the primary key of the current commerce notification template user segment rel
@param commerceUserSegmentEntryId the commerce user segment entry ID
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the previous, current, and next commerce notification template user segment rel
@throws NoSuchNotificationTemplateUserSegmentRelException if a commerce notification template user segment rel with the primary key could not be found