Search in sources :

Example 11 with ArtistImpl

use of org.liferay.jukebox.model.impl.ArtistImpl in project liferay-ide by liferay.

the class ArtistPersistenceImpl method filterFindByGroupId_PrevAndNext.

/**
 * Returns the artists before and after the current artist in the ordered set of artists that the user has permission to view where groupId = ?.
 *
 * @param artistId the primary key of the current artist
 * @param groupId the group ID
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next artist
 * @throws org.liferay.jukebox.NoSuchArtistException if a artist with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public Artist[] filterFindByGroupId_PrevAndNext(long artistId, long groupId, OrderByComparator orderByComparator) throws NoSuchArtistException, SystemException {
    if (!InlineSQLHelperUtil.isEnabled(groupId)) {
        return findByGroupId_PrevAndNext(artistId, groupId, orderByComparator);
    }
    Artist artist = findByPrimaryKey(artistId);
    Session session = null;
    try {
        session = openSession();
        Artist[] array = new ArtistImpl[3];
        array[0] = filterGetByGroupId_PrevAndNext(session, artist, groupId, orderByComparator, true);
        array[1] = artist;
        array[2] = filterGetByGroupId_PrevAndNext(session, artist, groupId, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : Artist(org.liferay.jukebox.model.Artist) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchArtistException(org.liferay.jukebox.NoSuchArtistException) Session(com.liferay.portal.kernel.dao.orm.Session) ArtistImpl(org.liferay.jukebox.model.impl.ArtistImpl)

Example 12 with ArtistImpl

use of org.liferay.jukebox.model.impl.ArtistImpl in project liferay-ide by liferay.

the class ArtistPersistenceImpl method filterFindByG_S_PrevAndNext.

/**
 * Returns the artists before and after the current artist in the ordered set of artists that the user has permission to view where groupId = &#63; and status = &#63;.
 *
 * @param artistId the primary key of the current artist
 * @param groupId the group ID
 * @param status the status
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next artist
 * @throws org.liferay.jukebox.NoSuchArtistException if a artist with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public Artist[] filterFindByG_S_PrevAndNext(long artistId, long groupId, int status, OrderByComparator orderByComparator) throws NoSuchArtistException, SystemException {
    if (!InlineSQLHelperUtil.isEnabled(groupId)) {
        return findByG_S_PrevAndNext(artistId, groupId, status, orderByComparator);
    }
    Artist artist = findByPrimaryKey(artistId);
    Session session = null;
    try {
        session = openSession();
        Artist[] array = new ArtistImpl[3];
        array[0] = filterGetByG_S_PrevAndNext(session, artist, groupId, status, orderByComparator, true);
        array[1] = artist;
        array[2] = filterGetByG_S_PrevAndNext(session, artist, groupId, status, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : Artist(org.liferay.jukebox.model.Artist) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchArtistException(org.liferay.jukebox.NoSuchArtistException) Session(com.liferay.portal.kernel.dao.orm.Session) ArtistImpl(org.liferay.jukebox.model.impl.ArtistImpl)

Example 13 with ArtistImpl

use of org.liferay.jukebox.model.impl.ArtistImpl in project liferay-ide by liferay.

the class ArtistPersistenceImpl method findByU_G_PrevAndNext.

/**
 * Returns the artists before and after the current artist in the ordered set where userId = &#63; and groupId = &#63;.
 *
 * @param artistId the primary key of the current artist
 * @param userId the user ID
 * @param groupId the group ID
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next artist
 * @throws org.liferay.jukebox.NoSuchArtistException if a artist with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public Artist[] findByU_G_PrevAndNext(long artistId, long userId, long groupId, OrderByComparator orderByComparator) throws NoSuchArtistException, SystemException {
    Artist artist = findByPrimaryKey(artistId);
    Session session = null;
    try {
        session = openSession();
        Artist[] array = new ArtistImpl[3];
        array[0] = getByU_G_PrevAndNext(session, artist, userId, groupId, orderByComparator, true);
        array[1] = artist;
        array[2] = getByU_G_PrevAndNext(session, artist, userId, groupId, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : Artist(org.liferay.jukebox.model.Artist) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchArtistException(org.liferay.jukebox.NoSuchArtistException) Session(com.liferay.portal.kernel.dao.orm.Session) ArtistImpl(org.liferay.jukebox.model.impl.ArtistImpl)

Example 14 with ArtistImpl

use of org.liferay.jukebox.model.impl.ArtistImpl in project liferay-ide by liferay.

the class ArtistPersistenceImpl method toUnwrappedModel.

protected Artist toUnwrappedModel(Artist artist) {
    if (artist instanceof ArtistImpl) {
        return artist;
    }
    ArtistImpl artistImpl = new ArtistImpl();
    artistImpl.setNew(artist.isNew());
    artistImpl.setPrimaryKey(artist.getPrimaryKey());
    artistImpl.setUuid(artist.getUuid());
    artistImpl.setArtistId(artist.getArtistId());
    artistImpl.setCompanyId(artist.getCompanyId());
    artistImpl.setGroupId(artist.getGroupId());
    artistImpl.setUserId(artist.getUserId());
    artistImpl.setUserName(artist.getUserName());
    artistImpl.setCreateDate(artist.getCreateDate());
    artistImpl.setModifiedDate(artist.getModifiedDate());
    artistImpl.setStatus(artist.getStatus());
    artistImpl.setStatusByUserId(artist.getStatusByUserId());
    artistImpl.setStatusByUserName(artist.getStatusByUserName());
    artistImpl.setStatusDate(artist.getStatusDate());
    artistImpl.setName(artist.getName());
    artistImpl.setBio(artist.getBio());
    return artistImpl;
}
Also used : ArtistImpl(org.liferay.jukebox.model.impl.ArtistImpl)

Aggregations

ArtistImpl (org.liferay.jukebox.model.impl.ArtistImpl)14 Artist (org.liferay.jukebox.model.Artist)13 Session (com.liferay.portal.kernel.dao.orm.Session)12 SystemException (com.liferay.portal.kernel.exception.SystemException)12 NoSuchArtistException (org.liferay.jukebox.NoSuchArtistException)12