Search in sources :

Example 31 with Roster

use of com.liferay.roster.model.Roster in project liferay-ide by liferay.

the class RosterPersistenceTest method testRemove.

@Test
public void testRemove() throws Exception {
    Roster newRoster = addRoster();
    _persistence.remove(newRoster);
    Roster existingRoster = _persistence.fetchByPrimaryKey(newRoster.getPrimaryKey());
    Assert.assertNull(existingRoster);
}
Also used : Roster(com.liferay.roster.model.Roster) Test(org.junit.Test)

Example 32 with Roster

use of com.liferay.roster.model.Roster in project liferay-ide by liferay.

the class RosterModelImpl method equals.

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (!(obj instanceof Roster)) {
        return false;
    }
    Roster roster = (Roster) obj;
    long primaryKey = roster.getPrimaryKey();
    if (getPrimaryKey() == primaryKey) {
        return true;
    } else {
        return false;
    }
}
Also used : Roster(com.liferay.roster.model.Roster)

Example 33 with Roster

use of com.liferay.roster.model.Roster in project liferay-ide by liferay.

the class RosterLocalServiceImpl method addRoster.

public Roster addRoster(long clubId, String name, ServiceContext serviceContext) {
    Roster roster = rosterLocalService.createRoster(counterLocalService.increment());
    roster.setClubId(clubId);
    roster.setName(name);
    roster.setCreateDate(serviceContext.getCreateDate());
    roster.setModifiedDate(serviceContext.getModifiedDate());
    return rosterLocalService.addRoster(roster);
}
Also used : Roster(com.liferay.roster.model.Roster)

Example 34 with Roster

use of com.liferay.roster.model.Roster in project liferay-ide by liferay.

the class RosterLocalServiceImpl method updateRoster.

public Roster updateRoster(long rosterId, long clubId, String name, ServiceContext serviceContext) throws PortalException {
    Roster roster = rosterLocalService.getRoster(rosterId);
    roster.setClubId(clubId);
    roster.setName(name);
    roster.setCreateDate(serviceContext.getCreateDate());
    roster.setModifiedDate(serviceContext.getModifiedDate());
    return rosterLocalService.updateRoster(roster);
}
Also used : Roster(com.liferay.roster.model.Roster)

Aggregations

Roster (com.liferay.roster.model.Roster)34 Test (org.junit.Test)13 NoSuchRosterException (com.liferay.roster.exception.NoSuchRosterException)12 StringBundler (com.liferay.portal.kernel.util.StringBundler)10 Session (com.liferay.portal.kernel.dao.orm.Session)8 Query (com.liferay.portal.kernel.dao.orm.Query)6 RosterImpl (com.liferay.roster.model.impl.RosterImpl)6 ActionableDynamicQuery (com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery)4 QueryPos (com.liferay.portal.kernel.dao.orm.QueryPos)4 Serializable (java.io.Serializable)4 DynamicQuery (com.liferay.portal.kernel.dao.orm.DynamicQuery)3 FinderPath (com.liferay.portal.kernel.dao.orm.FinderPath)3 HashSet (java.util.HashSet)3 IntegerWrapper (com.liferay.portal.kernel.util.IntegerWrapper)1 HashMap (java.util.HashMap)1 List (java.util.List)1