Search in sources :

Example 6 with NoSuchRosterException

use of com.liferay.roster.exception.NoSuchRosterException in project liferay-ide by liferay.

the class RosterPersistenceImpl method findByClubId_PrevAndNext.

/**
 * Returns the rosters before and after the current roster in the ordered set where clubId = ?.
 *
 * @param rosterId the primary key of the current roster
 * @param clubId the club ID
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next roster
 * @throws NoSuchRosterException if a roster with the primary key could not be found
 */
@Override
public Roster[] findByClubId_PrevAndNext(long rosterId, long clubId, OrderByComparator<Roster> orderByComparator) throws NoSuchRosterException {
    Roster roster = findByPrimaryKey(rosterId);
    Session session = null;
    try {
        session = openSession();
        Roster[] array = new RosterImpl[3];
        array[0] = getByClubId_PrevAndNext(session, roster, clubId, orderByComparator, true);
        array[1] = roster;
        array[2] = getByClubId_PrevAndNext(session, roster, clubId, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : Roster(com.liferay.roster.model.Roster) RosterImpl(com.liferay.roster.model.impl.RosterImpl) NoSuchRosterException(com.liferay.roster.exception.NoSuchRosterException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 7 with NoSuchRosterException

use of com.liferay.roster.exception.NoSuchRosterException in project liferay-ide by liferay.

the class RosterPersistenceImpl method findByUuid_Last.

/**
 * Returns the last roster in the ordered set where uuid = &#63;.
 *
 * @param uuid the uuid
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the last matching roster
 * @throws NoSuchRosterException if a matching roster could not be found
 */
@Override
public Roster findByUuid_Last(String uuid, OrderByComparator<Roster> orderByComparator) throws NoSuchRosterException {
    Roster roster = fetchByUuid_Last(uuid, orderByComparator);
    if (roster != null) {
        return roster;
    }
    StringBundler msg = new StringBundler(4);
    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
    msg.append("uuid=");
    msg.append(uuid);
    msg.append(StringPool.CLOSE_CURLY_BRACE);
    throw new NoSuchRosterException(msg.toString());
}
Also used : Roster(com.liferay.roster.model.Roster) NoSuchRosterException(com.liferay.roster.exception.NoSuchRosterException) StringBundler(com.liferay.portal.kernel.util.StringBundler)

Aggregations

NoSuchRosterException (com.liferay.roster.exception.NoSuchRosterException)7 Roster (com.liferay.roster.model.Roster)7 StringBundler (com.liferay.portal.kernel.util.StringBundler)4 Session (com.liferay.portal.kernel.dao.orm.Session)3 RosterImpl (com.liferay.roster.model.impl.RosterImpl)3