use of com.liferay.roster.model.RosterMember in project liferay-ide by liferay.
the class RosterMemberPersistenceImpl method findByUuid_Last.
/**
* Returns the last roster member 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 last matching roster member
* @throws NoSuchRosterMemberException if a matching roster member could not be found
*/
@Override
public RosterMember findByUuid_Last(String uuid, OrderByComparator<RosterMember> orderByComparator) throws NoSuchRosterMemberException {
RosterMember rosterMember = fetchByUuid_Last(uuid, orderByComparator);
if (rosterMember != null) {
return rosterMember;
}
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 NoSuchRosterMemberException(msg.toString());
}
use of com.liferay.roster.model.RosterMember in project liferay-ide by liferay.
the class RosterMemberPersistenceTest method testFetchByPrimaryKeyMissing.
@Test
public void testFetchByPrimaryKeyMissing() throws Exception {
long pk = RandomTestUtil.nextLong();
RosterMember missingRosterMember = _persistence.fetchByPrimaryKey(pk);
Assert.assertNull(missingRosterMember);
}
use of com.liferay.roster.model.RosterMember in project liferay-ide by liferay.
the class RosterMemberPersistenceTest method testRemove.
@Test
public void testRemove() throws Exception {
RosterMember newRosterMember = addRosterMember();
_persistence.remove(newRosterMember);
RosterMember existingRosterMember = _persistence.fetchByPrimaryKey(newRosterMember.getPrimaryKey());
Assert.assertNull(existingRosterMember);
}
use of com.liferay.roster.model.RosterMember in project liferay-ide by liferay.
the class RosterMemberPersistenceTest method testDynamicQueryByProjectionExisting.
@Test
public void testDynamicQueryByProjectionExisting() throws Exception {
RosterMember newRosterMember = addRosterMember();
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(RosterMember.class, _dynamicQueryClassLoader);
dynamicQuery.setProjection(ProjectionFactoryUtil.property("rosterMemberId"));
Object newRosterMemberId = newRosterMember.getRosterMemberId();
dynamicQuery.add(RestrictionsFactoryUtil.in("rosterMemberId", new Object[] { newRosterMemberId }));
List<Object> result = _persistence.findWithDynamicQuery(dynamicQuery);
Assert.assertEquals(1, result.size());
Object existingRosterMemberId = result.get(0);
Assert.assertEquals(existingRosterMemberId, newRosterMemberId);
}
use of com.liferay.roster.model.RosterMember in project liferay-ide by liferay.
the class RosterMemberPersistenceTest method testDynamicQueryByPrimaryKeyMissing.
@Test
public void testDynamicQueryByPrimaryKeyMissing() throws Exception {
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(RosterMember.class, _dynamicQueryClassLoader);
dynamicQuery.add(RestrictionsFactoryUtil.eq("rosterMemberId", RandomTestUtil.nextLong()));
List<RosterMember> result = _persistence.findWithDynamicQuery(dynamicQuery);
Assert.assertEquals(0, result.size());
}
Aggregations