Search in sources :

Example 31 with NoSuchSongException

use of org.liferay.jukebox.NoSuchSongException in project liferay-ide by liferay.

the class SongPersistenceImpl method findByG_A_A_N.

/**
 * Returns the song where groupId = ? and artistId = ? and albumId = ? and name = ? or throws a {@link org.liferay.jukebox.NoSuchSongException} if it could not be found.
 *
 * @param groupId the group ID
 * @param artistId the artist ID
 * @param albumId the album ID
 * @param name the name
 * @return the matching song
 * @throws org.liferay.jukebox.NoSuchSongException if a matching song could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public Song findByG_A_A_N(long groupId, long artistId, long albumId, String name) throws NoSuchSongException, SystemException {
    Song song = fetchByG_A_A_N(groupId, artistId, albumId, name);
    if (song == null) {
        StringBundler msg = new StringBundler(10);
        msg.append(_NO_SUCH_ENTITY_WITH_KEY);
        msg.append("groupId=");
        msg.append(groupId);
        msg.append(", artistId=");
        msg.append(artistId);
        msg.append(", albumId=");
        msg.append(albumId);
        msg.append(", name=");
        msg.append(name);
        msg.append(StringPool.CLOSE_CURLY_BRACE);
        if (_log.isWarnEnabled()) {
            _log.warn(msg.toString());
        }
        throw new NoSuchSongException(msg.toString());
    }
    return song;
}
Also used : Song(org.liferay.jukebox.model.Song) NoSuchSongException(org.liferay.jukebox.NoSuchSongException) StringBundler(com.liferay.portal.kernel.util.StringBundler)

Example 32 with NoSuchSongException

use of org.liferay.jukebox.NoSuchSongException in project liferay-ide by liferay.

the class SongPersistenceImpl method filterFindByG_A_S_PrevAndNext.

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

Example 33 with NoSuchSongException

use of org.liferay.jukebox.NoSuchSongException in project liferay-ide by liferay.

the class SongPersistenceImpl method findByG_A_First.

/**
 * Returns the first song in the ordered set where groupId = &#63; and albumId = &#63;.
 *
 * @param groupId the group ID
 * @param albumId the album ID
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the first matching song
 * @throws org.liferay.jukebox.NoSuchSongException if a matching song could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public Song findByG_A_First(long groupId, long albumId, OrderByComparator orderByComparator) throws NoSuchSongException, SystemException {
    Song song = fetchByG_A_First(groupId, albumId, orderByComparator);
    if (song != null) {
        return song;
    }
    StringBundler msg = new StringBundler(6);
    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
    msg.append("groupId=");
    msg.append(groupId);
    msg.append(", albumId=");
    msg.append(albumId);
    msg.append(StringPool.CLOSE_CURLY_BRACE);
    throw new NoSuchSongException(msg.toString());
}
Also used : Song(org.liferay.jukebox.model.Song) NoSuchSongException(org.liferay.jukebox.NoSuchSongException) StringBundler(com.liferay.portal.kernel.util.StringBundler)

Example 34 with NoSuchSongException

use of org.liferay.jukebox.NoSuchSongException in project liferay-ide by liferay.

the class SongPersistenceImpl method findByG_S_Last.

/**
 * Returns the last song in the ordered set where groupId = &#63; and status = &#63;.
 *
 * @param groupId the group ID
 * @param status the status
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the last matching song
 * @throws org.liferay.jukebox.NoSuchSongException if a matching song could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public Song findByG_S_Last(long groupId, int status, OrderByComparator orderByComparator) throws NoSuchSongException, SystemException {
    Song song = fetchByG_S_Last(groupId, status, orderByComparator);
    if (song != null) {
        return song;
    }
    StringBundler msg = new StringBundler(6);
    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
    msg.append("groupId=");
    msg.append(groupId);
    msg.append(", status=");
    msg.append(status);
    msg.append(StringPool.CLOSE_CURLY_BRACE);
    throw new NoSuchSongException(msg.toString());
}
Also used : Song(org.liferay.jukebox.model.Song) NoSuchSongException(org.liferay.jukebox.NoSuchSongException) StringBundler(com.liferay.portal.kernel.util.StringBundler)

Example 35 with NoSuchSongException

use of org.liferay.jukebox.NoSuchSongException in project liferay-ide by liferay.

the class SongPersistenceImpl method findByCompanyId_PrevAndNext.

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

Aggregations

NoSuchSongException (org.liferay.jukebox.NoSuchSongException)41 Song (org.liferay.jukebox.model.Song)41 StringBundler (com.liferay.portal.kernel.util.StringBundler)24 Session (com.liferay.portal.kernel.dao.orm.Session)17 SystemException (com.liferay.portal.kernel.exception.SystemException)17 SongImpl (org.liferay.jukebox.model.impl.SongImpl)17