Search in sources :

Example 1 with AlbumImpl

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

the class AlbumPersistenceImpl method create.

/**
 * Creates a new album with the primary key. Does not add the album to the database.
 *
 * @param albumId the primary key for the new album
 * @return the new album
 */
@Override
public Album create(long albumId) {
    Album album = new AlbumImpl();
    album.setNew(true);
    album.setPrimaryKey(albumId);
    String uuid = PortalUUIDUtil.generate();
    album.setUuid(uuid);
    return album;
}
Also used : AlbumImpl(org.liferay.jukebox.model.impl.AlbumImpl) Album(org.liferay.jukebox.model.Album)

Example 2 with AlbumImpl

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

the class AlbumPersistenceImpl method filterFindByG_LikeN_S_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 = ? and name LIKE ? and status = ?.
 *
 * @param albumId the primary key of the current album
 * @param groupId the group ID
 * @param name the name
 * @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[] filterFindByG_LikeN_S_PrevAndNext(long albumId, long groupId, String name, int status, OrderByComparator orderByComparator) throws NoSuchAlbumException, SystemException {
    if (!InlineSQLHelperUtil.isEnabled(groupId)) {
        return findByG_LikeN_S_PrevAndNext(albumId, groupId, name, status, orderByComparator);
    }
    Album album = findByPrimaryKey(albumId);
    Session session = null;
    try {
        session = openSession();
        Album[] array = new AlbumImpl[3];
        array[0] = filterGetByG_LikeN_S_PrevAndNext(session, album, groupId, name, status, orderByComparator, true);
        array[1] = album;
        array[2] = filterGetByG_LikeN_S_PrevAndNext(session, album, groupId, name, 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 3 with AlbumImpl

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

the class AlbumPersistenceImpl method findByG_U_PrevAndNext.

/**
 * Returns the albums before and after the current album in the ordered set where groupId = &#63; and userId = &#63;.
 *
 * @param albumId the primary key of the current album
 * @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 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_U_PrevAndNext(long albumId, long groupId, long userId, OrderByComparator orderByComparator) throws NoSuchAlbumException, SystemException {
    Album album = findByPrimaryKey(albumId);
    Session session = null;
    try {
        session = openSession();
        Album[] array = new AlbumImpl[3];
        array[0] = getByG_U_PrevAndNext(session, album, groupId, userId, orderByComparator, true);
        array[1] = album;
        array[2] = getByG_U_PrevAndNext(session, album, groupId, userId, 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 4 with AlbumImpl

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

the class AlbumPersistenceImpl method findByUuid_C_PrevAndNext.

/**
 * Returns the albums before and after the current album in the ordered set where uuid = &#63; and companyId = &#63;.
 *
 * @param albumId the primary key of the current album
 * @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 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[] findByUuid_C_PrevAndNext(long albumId, String uuid, long companyId, OrderByComparator orderByComparator) throws NoSuchAlbumException, SystemException {
    Album album = findByPrimaryKey(albumId);
    Session session = null;
    try {
        session = openSession();
        Album[] array = new AlbumImpl[3];
        array[0] = getByUuid_C_PrevAndNext(session, album, uuid, companyId, orderByComparator, true);
        array[1] = album;
        array[2] = getByUuid_C_PrevAndNext(session, album, uuid, companyId, 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 5 with AlbumImpl

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

the class AlbumPersistenceImpl method toUnwrappedModel.

protected Album toUnwrappedModel(Album album) {
    if (album instanceof AlbumImpl) {
        return album;
    }
    AlbumImpl albumImpl = new AlbumImpl();
    albumImpl.setNew(album.isNew());
    albumImpl.setPrimaryKey(album.getPrimaryKey());
    albumImpl.setUuid(album.getUuid());
    albumImpl.setAlbumId(album.getAlbumId());
    albumImpl.setCompanyId(album.getCompanyId());
    albumImpl.setGroupId(album.getGroupId());
    albumImpl.setUserId(album.getUserId());
    albumImpl.setUserName(album.getUserName());
    albumImpl.setCreateDate(album.getCreateDate());
    albumImpl.setModifiedDate(album.getModifiedDate());
    albumImpl.setArtistId(album.getArtistId());
    albumImpl.setName(album.getName());
    albumImpl.setYear(album.getYear());
    albumImpl.setStatus(album.getStatus());
    albumImpl.setStatusByUserId(album.getStatusByUserId());
    albumImpl.setStatusByUserName(album.getStatusByUserName());
    albumImpl.setStatusDate(album.getStatusDate());
    return albumImpl;
}
Also used : AlbumImpl(org.liferay.jukebox.model.impl.AlbumImpl)

Aggregations

AlbumImpl (org.liferay.jukebox.model.impl.AlbumImpl)17 Album (org.liferay.jukebox.model.Album)16 Session (com.liferay.portal.kernel.dao.orm.Session)15 SystemException (com.liferay.portal.kernel.exception.SystemException)15 NoSuchAlbumException (org.liferay.jukebox.NoSuchAlbumException)15