Package in.partake.model.dto

Examples of in.partake.model.dto.UserCalendarLink


*/
public class UserCalendarLinkTestDataProvider extends TestDataProvider<UserCalendarLink> {
    @Override
    public UserCalendarLink create(long pkNumber, String pkSalt, int objNumber) {
        UUID uuid = new UUID(pkNumber, pkSalt.hashCode());
        return new UserCalendarLink(uuid.toString(), "" + objNumber);
    }
View Full Code Here


    @Override
    public List<UserCalendarLink> createSamples() {
        List<UserCalendarLink> list = new ArrayList<UserCalendarLink>();

        list.add(new UserCalendarLink("id", "userId"));
        list.add(new UserCalendarLink("id1", "userId"));
        list.add(new UserCalendarLink("id", "userId2"));

        return list;
    }
View Full Code Here

    @Override
    public void createFixtures(PartakeConnection con, IPartakeDAOs daos) throws DAOException {
        IUserCalendarLinkageAccess dao = daos.getCalendarAccess();
        dao.truncate(con);

        dao.put(con, new UserCalendarLink(DEFAULT_CALENDAR_ID, DEFAULT_USER_ID));
        dao.put(con, new UserCalendarLink(ENROLLED_USER_CALENDAR_ID, EVENT_ENROLLED_USER_ID));
    }
View Full Code Here

    protected String loadCalendarIdFromUser(final String userId) throws DAOException, PartakeException {
        return new DBAccess<String>() {
            @Override
            protected String doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
                UserCalendarLink linkage = daos.getCalendarAccess().findByUserId(con, userId);
                if (linkage == null)
                    return null;
                return linkage.getId();
            }
        }.execute();
    }
View Full Code Here

    }

    @Override
    protected UserCalendarLink create(long pkNumber, String pkSalt, int objNumber) {
        UUID id = new UUID(pkNumber, ("calendarLinkage" + pkSalt).hashCode());
        return new UserCalendarLink(id.toString(), "calendarLinkage" + objNumber);
    }
View Full Code Here

    protected String doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
        daos.getCalendarAccess().removeByUserId(con, user.getId());

        // 新しくカレンダー id を作成して保存
        String calendarId = daos.getCalendarAccess().getFreshId(con);
        UserCalendarLink embryo = new UserCalendarLink(calendarId, user.getId());
        daos.getCalendarAccess().put(con, embryo);

        return calendarId;
    }
View Full Code Here

    }

    @Override
    protected Calendar doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
        // CalendarLinkage should have cache.
        UserCalendarLink calendarLinkage = daos.getCalendarAccess().find(con, calendarId);
        if (calendarLinkage == null)
            throw new PartakeException(UserErrorCode.INVALID_NOTFOUND);

        User user = daos.getUserAccess().find(con, calendarLinkage.getUserId());
        if (user == null)
            throw new PartakeException(UserErrorCode.INVALID_NOTFOUND);

        Calendar calendar = CalendarUtil.createCalendarSkeleton();
View Full Code Here

import in.partake.model.dao.postgres9.Postgres9IndexDao;
import in.partake.model.dto.UserCalendarLink;

class EntityCalendarLinkageMapper extends Postgres9EntityDataMapper<UserCalendarLink> {
    public UserCalendarLink map(ObjectNode obj) {
        return new UserCalendarLink(obj).freeze();
    }
View Full Code Here

TOP

Related Classes of in.partake.model.dto.UserCalendarLink

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.