Search in sources :

Example 11 with NoSuchAlbumException

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

the class AlbumPersistenceImpl method findByGroupId_PrevAndNext.

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

Example 12 with NoSuchAlbumException

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

the class AlbumPersistenceImpl method findByG_A_S_PrevAndNext.

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

Example 13 with NoSuchAlbumException

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

the class AlbumPersistenceImpl method findByUuid_C_First.

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

Example 14 with NoSuchAlbumException

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

the class AlbumPersistenceImpl method findByUserId_First.

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

Example 15 with NoSuchAlbumException

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

the class AlbumPersistenceImpl method findByG_U_First.

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

Aggregations

NoSuchAlbumException (org.liferay.jukebox.NoSuchAlbumException)37 Album (org.liferay.jukebox.model.Album)37 StringBundler (com.liferay.portal.kernel.util.StringBundler)21 Session (com.liferay.portal.kernel.dao.orm.Session)16 SystemException (com.liferay.portal.kernel.exception.SystemException)16 AlbumImpl (org.liferay.jukebox.model.impl.AlbumImpl)16