Search in sources :

Example 1 with RosterImpl

use of com.liferay.roster.model.impl.RosterImpl 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 RosterImpl

use of com.liferay.roster.model.impl.RosterImpl in project liferay-ide by liferay.

the class RosterPersistenceImpl method toUnwrappedModel.

protected Roster toUnwrappedModel(Roster roster) {
    if (roster instanceof RosterImpl) {
        return roster;
    }
    RosterImpl rosterImpl = new RosterImpl();
    rosterImpl.setNew(roster.isNew());
    rosterImpl.setPrimaryKey(roster.getPrimaryKey());
    rosterImpl.setUuid(roster.getUuid());
    rosterImpl.setRosterId(roster.getRosterId());
    rosterImpl.setCreateDate(roster.getCreateDate());
    rosterImpl.setModifiedDate(roster.getModifiedDate());
    rosterImpl.setClubId(roster.getClubId());
    rosterImpl.setName(roster.getName());
    return rosterImpl;
}
Also used : RosterImpl(com.liferay.roster.model.impl.RosterImpl)

Example 3 with RosterImpl

use of com.liferay.roster.model.impl.RosterImpl in project liferay-ide by liferay.

the class RosterPersistenceImpl method create.

/**
 * Creates a new roster with the primary key. Does not add the roster to the database.
 *
 * @param rosterId the primary key for the new roster
 * @return the new roster
 */
@Override
public Roster create(long rosterId) {
    Roster roster = new RosterImpl();
    roster.setNew(true);
    roster.setPrimaryKey(rosterId);
    String uuid = PortalUUIDUtil.generate();
    roster.setUuid(uuid);
    return roster;
}
Also used : Roster(com.liferay.roster.model.Roster) RosterImpl(com.liferay.roster.model.impl.RosterImpl)

Example 4 with RosterImpl

use of com.liferay.roster.model.impl.RosterImpl 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 = &#63;.
 *
 * @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)

Aggregations

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