use of com.liferay.roster.exception.NoSuchRosterException in project liferay-ide by liferay.
the class RosterPersistenceImpl method findByUuid_PrevAndNext.
/**
* Returns the rosters before and after the current roster in the ordered set where uuid = ?.
*
* @param rosterId the primary key of the current roster
* @param uuid the uuid
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next roster
* @throws NoSuchRosterException if a roster with the primary key could not be found
*/
@Override
public Roster[] findByUuid_PrevAndNext(long rosterId, String uuid, OrderByComparator<Roster> orderByComparator) throws NoSuchRosterException {
Roster roster = findByPrimaryKey(rosterId);
Session session = null;
try {
session = openSession();
Roster[] array = new RosterImpl[3];
array[0] = getByUuid_PrevAndNext(session, roster, uuid, orderByComparator, true);
array[1] = roster;
array[2] = getByUuid_PrevAndNext(session, roster, uuid, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of com.liferay.roster.exception.NoSuchRosterException in project liferay-ide by liferay.
the class RosterPersistenceImpl method findByClubId_Last.
/**
* Returns the last roster in the ordered set where clubId = ?.
*
* @param clubId the club ID
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching roster
* @throws NoSuchRosterException if a matching roster could not be found
*/
@Override
public Roster findByClubId_Last(long clubId, OrderByComparator<Roster> orderByComparator) throws NoSuchRosterException {
Roster roster = fetchByClubId_Last(clubId, orderByComparator);
if (roster != null) {
return roster;
}
StringBundler msg = new StringBundler(4);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("clubId=");
msg.append(clubId);
msg.append(StringPool.CLOSE_CURLY_BRACE);
throw new NoSuchRosterException(msg.toString());
}
use of com.liferay.roster.exception.NoSuchRosterException in project liferay-ide by liferay.
the class RosterPersistenceImpl method remove.
/**
* Removes the roster with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param primaryKey the primary key of the roster
* @return the roster that was removed
* @throws NoSuchRosterException if a roster with the primary key could not be found
*/
@Override
public Roster remove(Serializable primaryKey) throws NoSuchRosterException {
Session session = null;
try {
session = openSession();
Roster roster = (Roster) session.get(RosterImpl.class, primaryKey);
if (roster == null) {
if (_log.isWarnEnabled()) {
_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
throw new NoSuchRosterException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
return remove(roster);
} catch (NoSuchRosterException nsee) {
throw nsee;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of com.liferay.roster.exception.NoSuchRosterException in project liferay-ide by liferay.
the class RosterPersistenceImpl method findByClubId_First.
/**
* Returns the first roster in the ordered set where clubId = ?.
*
* @param clubId the club ID
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching roster
* @throws NoSuchRosterException if a matching roster could not be found
*/
@Override
public Roster findByClubId_First(long clubId, OrderByComparator<Roster> orderByComparator) throws NoSuchRosterException {
Roster roster = fetchByClubId_First(clubId, orderByComparator);
if (roster != null) {
return roster;
}
StringBundler msg = new StringBundler(4);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("clubId=");
msg.append(clubId);
msg.append(StringPool.CLOSE_CURLY_BRACE);
throw new NoSuchRosterException(msg.toString());
}
use of com.liferay.roster.exception.NoSuchRosterException in project liferay-ide by liferay.
the class RosterPersistenceImpl method findByUuid_First.
/**
* Returns the first roster in the ordered set where uuid = ?.
*
* @param uuid the uuid
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching roster
* @throws NoSuchRosterException if a matching roster could not be found
*/
@Override
public Roster findByUuid_First(String uuid, OrderByComparator<Roster> orderByComparator) throws NoSuchRosterException {
Roster roster = fetchByUuid_First(uuid, orderByComparator);
if (roster != null) {
return roster;
}
StringBundler msg = new StringBundler(4);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("uuid=");
msg.append(uuid);
msg.append(StringPool.CLOSE_CURLY_BRACE);
throw new NoSuchRosterException(msg.toString());
}
Aggregations