Examples of Postgres9Entity


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

    }

    @Override
    public void put(PartakeConnection con, UserOpenIDLink linkage) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;
        Postgres9Entity entity = new Postgres9Entity(linkage.getId(), CURRENT_VERSION, linkage.toJSON().toString().getBytes(UTF8), null, TimeUtil.getCurrentDateTime());

        if (entityDao.exists(pcon, linkage.getId())) {
            entityDao.update(pcon, entity);
        } else {
            entityDao.insert(pcon, entity);
View Full Code Here

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

    @Override
    public void put(PartakeConnection con, Message 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);
        else
            entityDao.insert(pcon, entity);
    }
View Full Code Here

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

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

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

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

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

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

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

    @Override
    public void put(PartakeConnection con, EventMessage 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);
        else
            entityDao.insert(pcon, entity);
        indexDao.put(pcon, new String[] { "id", "eventId", "createdAt" }, new Object[] { t.getId(), t.getEventId(), t.getCreatedAt() } );
View Full Code Here

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

        return new MessageEnvelope(obj).freeze();
    }

    @Override
    public Postgres9Entity unmap(MessageEnvelope t) throws DAOException {
        return new Postgres9Entity(t.getId(), Postgres9MessageEnvelopeDao.CURRENT_VERSION, t.toJSON().toString().getBytes(UTF8), null, TimeUtil.getCurrentDateTime());
    }
View Full Code Here

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

    public void put(PartakeConnection con, MessageEnvelope envelope) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;

        // TODO: Entity should have getId() instead of getEnvelopeId().
        // TODO: Why User does not have createdAt and modifiedAt?
        Postgres9Entity entity = new Postgres9Entity(envelope.getId(), CURRENT_VERSION, envelope.toJSON().toString().getBytes(UTF8), null, TimeUtil.getCurrentDateTime());
        if (entityDao.exists(pcon, envelope.getId()))
            entityDao.update(pcon, entity);
        else
            entityDao.insert(pcon, entity);
    }
View Full Code Here

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

            entityDao.insert(pcon, entity);
    }

    @Override
    public MessageEnvelope find(PartakeConnection con, String id) throws DAOException {
        Postgres9Entity entity = entityDao.find((Postgres9Connection) con, id);
        if (entity == null)
            return null;


        ObjectNode json;
        try {
            json = new ObjectMapper().readValue(new String(entity.getBody(), UTF8), ObjectNode.class);
        } catch (JsonParseException e) {
            throw new IllegalArgumentException(e);
        } catch (JsonMappingException e) {
            throw new IllegalArgumentException(e);
        } catch (IOException e) {
View Full Code Here

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

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

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

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

    @Override
    public void put(PartakeConnection con, UserNotification 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);
        else
            entityDao.insert(pcon, entity);
        indexDao.put(pcon, new String[] { "id", "userId", "createdAt" }, new Object[] { t.getId(), t.getUserId(), t.getCreatedAt() } );
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.