Examples of Postgres9Connection


Examples of in.partake.model.dao.postgres9.Postgres9Connection

        }
    }

    @Override
    public void truncate(PartakeConnection con) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;
        entityDao.truncate(pcon);
        indexDao.truncate(pcon);
    }
View Full Code Here

Examples of in.partake.model.dao.postgres9.Postgres9Connection

        indexDao.truncate(pcon);
    }

    @Override
    public void put(PartakeConnection con, UserSentMessage t) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;

        // TODO: Why User does not have createdAt and modifiedAt?
        Postgres9Entity entity = new Postgres9Entity(t.getId(), CURRENT_VERSION, t.toJSON().toString().getBytes(UTF8), null, TimeUtil.getCurrentDateTime());
        if (entityDao.exists(pcon, t.getId()))
            entityDao.update(pcon, entity);
View Full Code Here

Examples of in.partake.model.dao.postgres9.Postgres9Connection

        return entityDao.exists((Postgres9Connection) con, id);
    }

    @Override
    public void remove(PartakeConnection con, UUID id) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;
        entityDao.remove(pcon, id);
        indexDao.remove(pcon, "id", id);
    }
View Full Code Here

Examples of in.partake.model.dao.postgres9.Postgres9Connection

        this.mapper = new EntityEventMapper();
    }

    @Override
    public void initialize(PartakeConnection con) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;
        entityDao.initialize(pcon);

        if (!existsTable(pcon, INDEX_TABLE_NAME)) {
            indexDao.createIndexTable(pcon, "CREATE TABLE " + INDEX_TABLE_NAME +
                    "(id TEXT PRIMARY KEY, ownerId TEXT NOT NULL, draft BOOL NOT NULL, isPrivate BOOL NOT NULL, beginDate TIMESTAMP NOT NULL)");
View Full Code Here

Examples of in.partake.model.dao.postgres9.Postgres9Connection

        }
    }

    @Override
    public void truncate(PartakeConnection con) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;
        entityDao.truncate(pcon);
        indexDao.truncate(pcon);
        editorIndexDao.truncate(pcon);
    }
View Full Code Here

Examples of in.partake.model.dao.postgres9.Postgres9Connection

        editorIndexDao.truncate(pcon);
    }

    @Override
    public void put(PartakeConnection con, Event event) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;

        Postgres9Entity entity = new Postgres9Entity(event.getId(), CURRENT_VERSION, event.toJSON().toString().getBytes(UTF8), null, TimeUtil.getCurrentDateTime());
        if (entityDao.exists(pcon, event.getId()))
            entityDao.update(pcon, entity);
        else
View Full Code Here

Examples of in.partake.model.dao.postgres9.Postgres9Connection

        updateIndex(con, event);
    }

    @Override
    public void updateIndex(PartakeConnection con, Event event) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;

        indexDao.put(pcon,
                new String[] {"id", "ownerId", "draft", "isPrivate", "beginDate" },
                new Object[] { event.getId(), event.getOwnerId(), event.isDraft(), !StringUtils.isEmpty(event.getPasscode()), event.getBeginDate() });
View Full Code Here

Examples of in.partake.model.dao.postgres9.Postgres9Connection

        return entityDao.exists((Postgres9Connection) con, id);
    }

    @Override
    public void remove(PartakeConnection con, String id) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;
        entityDao.remove(pcon, id);
        indexDao.remove(pcon, "id", id);
        editorIndexDao.remove(pcon, "id", id);
    }
View Full Code Here

Examples of in.partake.model.dao.postgres9.Postgres9Connection

        return entityDao.count((Postgres9Connection) con);
    }

    @Override
    public int count(PartakeConnection con, EventFilterCondition condition) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;
        switch (condition) {
        case ALL_EVENTS:
            return entityDao.count(pcon);
        case DRAFT_EVENT_ONLY:
            return indexDao.count(pcon, new String[] { "draft" }, new Object[] { true });
View Full Code Here

Examples of in.partake.model.dao.postgres9.Postgres9Connection

        throw new PartakeRuntimeException(ServerErrorCode.LOGIC_ERROR);
    }

    @Override
    public int countEventsByOwnerId(PartakeConnection con, String userId, EventFilterCondition criteria) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;
        switch (criteria) {
        case ALL_EVENTS:
            return indexDao.count(pcon, "ownerId", userId);
        case DRAFT_EVENT_ONLY:
            return indexDao.count(pcon, new String[] { "ownerId", "draft" }, new Object[] { userId, true });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.