Search in sources :

Example 1 with NoSuchRosterException

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

the class RosterPersistenceImpl method findByUuid_PrevAndNext.

/**
 * Returns the rosters before and after the current roster in the ordered set where uuid = ?.
 *
 * @param rosterId the primary key of the current roster
 * @param uuid the uuid
 * @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[] findByUuid_PrevAndNext(long rosterId, String uuid, OrderByComparator<Roster> orderByComparator) throws NoSuchRosterException {
    Roster roster = findByPrimaryKey(rosterId);
    Session session = null;
    try {
        session = openSession();
        Roster[] array = new RosterImpl[3];
        array[0] = getByUuid_PrevAndNext(session, roster, uuid, orderByComparator, true);
        array[1] = roster;
        array[2] = getByUuid_PrevAndNext(session, roster, uuid, 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 2 with NoSuchRosterException

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

the class RosterPersistenceImpl method findByClubId_Last.

/**
 * Returns the last roster in the ordered set where clubId = &#63;.
 *
 * @param clubId the club ID
 * @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 findByClubId_Last(long clubId, OrderByComparator<Roster> orderByComparator) throws NoSuchRosterException {
    Roster roster = fetchByClubId_Last(clubId, orderByComparator);
    if (roster != null) {
        return roster;
    }
    StringBundler msg = new StringBundler(4);
    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
    msg.append("clubId=");
    msg.append(clubId);
    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)

Example 3 with NoSuchRosterException

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

the class RosterPersistenceImpl method remove.

/**
 * Removes the roster with the primary key from the database. Also notifies the appropriate model listeners.
 *
 * @param primaryKey the primary key of the roster
 * @return the roster that was removed
 * @throws NoSuchRosterException if a roster with the primary key could not be found
 */
@Override
public Roster remove(Serializable primaryKey) throws NoSuchRosterException {
    Session session = null;
    try {
        session = openSession();
        Roster roster = (Roster) session.get(RosterImpl.class, primaryKey);
        if (roster == null) {
            if (_log.isWarnEnabled()) {
                _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
            }
            throw new NoSuchRosterException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
        }
        return remove(roster);
    } catch (NoSuchRosterException nsee) {
        throw nsee;
    } 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) NoSuchRosterException(com.liferay.roster.exception.NoSuchRosterException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 4 with NoSuchRosterException

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

the class RosterPersistenceImpl method findByClubId_First.

/**
 * Returns the first roster in the ordered set where clubId = &#63;.
 *
 * @param clubId the club ID
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the first matching roster
 * @throws NoSuchRosterException if a matching roster could not be found
 */
@Override
public Roster findByClubId_First(long clubId, OrderByComparator<Roster> orderByComparator) throws NoSuchRosterException {
    Roster roster = fetchByClubId_First(clubId, orderByComparator);
    if (roster != null) {
        return roster;
    }
    StringBundler msg = new StringBundler(4);
    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
    msg.append("clubId=");
    msg.append(clubId);
    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)

Example 5 with NoSuchRosterException

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

the class RosterPersistenceImpl method findByUuid_First.

/**
 * Returns the first 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 first matching roster
 * @throws NoSuchRosterException if a matching roster could not be found
 */
@Override
public Roster findByUuid_First(String uuid, OrderByComparator<Roster> orderByComparator) throws NoSuchRosterException {
    Roster roster = fetchByUuid_First(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