Search in sources :

Example 1 with ClubImpl

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

the class ClubPersistenceImpl method toUnwrappedModel.

protected Club toUnwrappedModel(Club club) {
    if (club instanceof ClubImpl) {
        return club;
    }
    ClubImpl clubImpl = new ClubImpl();
    clubImpl.setNew(club.isNew());
    clubImpl.setPrimaryKey(club.getPrimaryKey());
    clubImpl.setUuid(club.getUuid());
    clubImpl.setClubId(club.getClubId());
    clubImpl.setCreateDate(club.getCreateDate());
    clubImpl.setModifiedDate(club.getModifiedDate());
    clubImpl.setName(club.getName());
    return clubImpl;
}
Also used : ClubImpl(com.liferay.roster.model.impl.ClubImpl)

Example 2 with ClubImpl

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

the class ClubPersistenceImpl method findByUuid_PrevAndNext.

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

Example 3 with ClubImpl

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

the class ClubPersistenceImpl method create.

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

Aggregations

ClubImpl (com.liferay.roster.model.impl.ClubImpl)3 Club (com.liferay.roster.model.Club)2 Session (com.liferay.portal.kernel.dao.orm.Session)1 NoSuchClubException (com.liferay.roster.exception.NoSuchClubException)1