use of com.liferay.roster.exception.NoSuchRosterMemberException in project liferay-ide by liferay.
the class RosterMemberPersistenceImpl method findByUuid_PrevAndNext.
/**
* Returns the roster members before and after the current roster member in the ordered set where uuid = ?.
*
* @param rosterMemberId the primary key of the current roster member
* @param uuid the uuid
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next roster member
* @throws NoSuchRosterMemberException if a roster member with the primary key could not be found
*/
@Override
public RosterMember[] findByUuid_PrevAndNext(long rosterMemberId, String uuid, OrderByComparator<RosterMember> orderByComparator) throws NoSuchRosterMemberException {
RosterMember rosterMember = findByPrimaryKey(rosterMemberId);
Session session = null;
try {
session = openSession();
RosterMember[] array = new RosterMemberImpl[3];
array[0] = getByUuid_PrevAndNext(session, rosterMember, uuid, orderByComparator, true);
array[1] = rosterMember;
array[2] = getByUuid_PrevAndNext(session, rosterMember, uuid, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of com.liferay.roster.exception.NoSuchRosterMemberException in project liferay-ide by liferay.
the class RosterMemberPersistenceImpl method remove.
/**
* Removes the roster member with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param primaryKey the primary key of the roster member
* @return the roster member that was removed
* @throws NoSuchRosterMemberException if a roster member with the primary key could not be found
*/
@Override
public RosterMember remove(Serializable primaryKey) throws NoSuchRosterMemberException {
Session session = null;
try {
session = openSession();
RosterMember rosterMember = (RosterMember) session.get(RosterMemberImpl.class, primaryKey);
if (rosterMember == null) {
if (_log.isWarnEnabled()) {
_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
throw new NoSuchRosterMemberException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
return remove(rosterMember);
} catch (NoSuchRosterMemberException nsee) {
throw nsee;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
Aggregations