Search in sources :

Example 1 with RosterMemberImpl

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

the class RosterMemberPersistenceImpl method toUnwrappedModel.

protected RosterMember toUnwrappedModel(RosterMember rosterMember) {
    if (rosterMember instanceof RosterMemberImpl) {
        return rosterMember;
    }
    RosterMemberImpl rosterMemberImpl = new RosterMemberImpl();
    rosterMemberImpl.setNew(rosterMember.isNew());
    rosterMemberImpl.setPrimaryKey(rosterMember.getPrimaryKey());
    rosterMemberImpl.setUuid(rosterMember.getUuid());
    rosterMemberImpl.setRosterMemberId(rosterMember.getRosterMemberId());
    rosterMemberImpl.setCreateDate(rosterMember.getCreateDate());
    rosterMemberImpl.setModifiedDate(rosterMember.getModifiedDate());
    rosterMemberImpl.setRosterId(rosterMember.getRosterId());
    rosterMemberImpl.setContactId(rosterMember.getContactId());
    return rosterMemberImpl;
}
Also used : RosterMemberImpl(com.liferay.roster.model.impl.RosterMemberImpl)

Example 2 with RosterMemberImpl

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

the class RosterMemberPersistenceImpl method findByRosterId_PrevAndNext.

/**
 * Returns the roster members before and after the current roster member in the ordered set where rosterId = ?.
 *
 * @param rosterMemberId the primary key of the current roster member
 * @param rosterId the roster ID
 * @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[] findByRosterId_PrevAndNext(long rosterMemberId, long rosterId, OrderByComparator<RosterMember> orderByComparator) throws NoSuchRosterMemberException {
    RosterMember rosterMember = findByPrimaryKey(rosterMemberId);
    Session session = null;
    try {
        session = openSession();
        RosterMember[] array = new RosterMemberImpl[3];
        array[0] = getByRosterId_PrevAndNext(session, rosterMember, rosterId, orderByComparator, true);
        array[1] = rosterMember;
        array[2] = getByRosterId_PrevAndNext(session, rosterMember, rosterId, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : RosterMember(com.liferay.roster.model.RosterMember) RosterMemberImpl(com.liferay.roster.model.impl.RosterMemberImpl) NoSuchRosterMemberException(com.liferay.roster.exception.NoSuchRosterMemberException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 3 with RosterMemberImpl

use of com.liferay.roster.model.impl.RosterMemberImpl 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 = &#63;.
 *
 * @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);
    }
}
Also used : RosterMember(com.liferay.roster.model.RosterMember) RosterMemberImpl(com.liferay.roster.model.impl.RosterMemberImpl) NoSuchRosterMemberException(com.liferay.roster.exception.NoSuchRosterMemberException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 4 with RosterMemberImpl

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

the class RosterMemberPersistenceImpl method create.

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

Aggregations

RosterMemberImpl (com.liferay.roster.model.impl.RosterMemberImpl)4 RosterMember (com.liferay.roster.model.RosterMember)3 Session (com.liferay.portal.kernel.dao.orm.Session)2 NoSuchRosterMemberException (com.liferay.roster.exception.NoSuchRosterMemberException)2