use of org.liferay.jukebox.NoSuchAlbumException in project liferay-ide by liferay.
the class AlbumPersistenceImpl method filterFindByGroupId_PrevAndNext.
/**
* Returns the albums before and after the current album in the ordered set of albums that the user has permission to view 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[] filterFindByGroupId_PrevAndNext(long albumId, long groupId, OrderByComparator orderByComparator) throws NoSuchAlbumException, SystemException {
if (!InlineSQLHelperUtil.isEnabled(groupId)) {
return findByGroupId_PrevAndNext(albumId, groupId, orderByComparator);
}
Album album = findByPrimaryKey(albumId);
Session session = null;
try {
session = openSession();
Album[] array = new AlbumImpl[3];
array[0] = filterGetByGroupId_PrevAndNext(session, album, groupId, orderByComparator, true);
array[1] = album;
array[2] = filterGetByGroupId_PrevAndNext(session, album, groupId, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of org.liferay.jukebox.NoSuchAlbumException in project liferay-ide by liferay.
the class AlbumPersistenceImpl method findByArtistId_PrevAndNext.
/**
* Returns the albums before and after the current album in the ordered set where artistId = ?.
*
* @param albumId the primary key of the current album
* @param artistId the artist 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[] findByArtistId_PrevAndNext(long albumId, long artistId, OrderByComparator orderByComparator) throws NoSuchAlbumException, SystemException {
Album album = findByPrimaryKey(albumId);
Session session = null;
try {
session = openSession();
Album[] array = new AlbumImpl[3];
array[0] = getByArtistId_PrevAndNext(session, album, artistId, orderByComparator, true);
array[1] = album;
array[2] = getByArtistId_PrevAndNext(session, album, artistId, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
Aggregations