Search in sources :

Example 21 with NoSuchArtistException

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

the class ArtistPersistenceImpl method findByUuid_C_PrevAndNext.

/**
 * Returns the artists before and after the current artist in the ordered set where uuid = ? and companyId = ?.
 *
 * @param artistId the primary key of the current artist
 * @param uuid the uuid
 * @param companyId the company 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[] findByUuid_C_PrevAndNext(long artistId, String uuid, long companyId, OrderByComparator orderByComparator) throws NoSuchArtistException, SystemException {
    Artist artist = findByPrimaryKey(artistId);
    Session session = null;
    try {
        session = openSession();
        Artist[] array = new ArtistImpl[3];
        array[0] = getByUuid_C_PrevAndNext(session, artist, uuid, companyId, orderByComparator, true);
        array[1] = artist;
        array[2] = getByUuid_C_PrevAndNext(session, artist, uuid, companyId, 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 22 with NoSuchArtistException

use of org.liferay.jukebox.NoSuchArtistException 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 = &#63;.
 *
 * @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 23 with NoSuchArtistException

use of org.liferay.jukebox.NoSuchArtistException 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 24 with NoSuchArtistException

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

the class ArtistPersistenceImpl method findByCompanyId_Last.

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

Example 25 with NoSuchArtistException

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

the class ArtistPersistenceImpl method remove.

/**
 * Removes the artist with the primary key from the database. Also notifies the appropriate model listeners.
 *
 * @param primaryKey the primary key of the artist
 * @return the artist that was removed
 * @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 remove(Serializable primaryKey) throws NoSuchArtistException, SystemException {
    Session session = null;
    try {
        session = openSession();
        Artist artist = (Artist) session.get(ArtistImpl.class, primaryKey);
        if (artist == null) {
            if (_log.isWarnEnabled()) {
                _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
            }
            throw new NoSuchArtistException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
        }
        return remove(artist);
    } catch (NoSuchArtistException nsee) {
        throw nsee;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : Artist(org.liferay.jukebox.model.Artist) NoSuchArtistException(org.liferay.jukebox.NoSuchArtistException) 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)

Aggregations

NoSuchArtistException (org.liferay.jukebox.NoSuchArtistException)30 Artist (org.liferay.jukebox.model.Artist)30 StringBundler (com.liferay.portal.kernel.util.StringBundler)17 Session (com.liferay.portal.kernel.dao.orm.Session)13 SystemException (com.liferay.portal.kernel.exception.SystemException)13 ArtistImpl (org.liferay.jukebox.model.impl.ArtistImpl)13