Package in.partake.model.dao.postgres9

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


        indexDao.truncate(pcon);
    }

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

        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

        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);
    }
View Full Code Here

        return new MapperDataIterator<Postgres9Entity, UserTicket>(mapper, entityDao.getIterator((Postgres9Connection) con));
    }

    @Override
    public UserTicket findByTicketIdAndUserId(PartakeConnection con, UUID ticketId, String userId) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;
        String id = indexDao.find(pcon, "id", new String[] { "userId", "ticketId" }, new Object[] { userId, ticketId.toString() });
        if (id == null)
            return null;

        return find(con, id);
View Full Code Here

        return find(con, id);
    }

    @Override
    public void removeByEventTicketIdAndUserId(PartakeConnection con, UUID eventTicketId, String userId) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;
        String id = indexDao.find(pcon, "id", new String[] { "userId", "ticketId" }, new Object[] { userId, eventTicketId.toString() });
        if (id == null)
            return;

        remove(con, id);
View Full Code Here

        this.mapper = new EntityEventActivityMapper();
    }

    @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, eventId TEXT NOT NULL, createdAt TIMESTAMP NOT NULL)");
            indexDao.createIndex(pcon, "CREATE INDEX " + INDEX_TABLE_NAME + "EventId" + " ON " + INDEX_TABLE_NAME + "(eventId, createdAt)");
View Full Code Here

        }
    }

    @Override
    public void truncate(PartakeConnection con) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;

        entityDao.truncate(pcon);
        indexDao.truncate(pcon);
    }
View Full Code Here

        indexDao.truncate(pcon);
    }

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

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

        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);
    }
View Full Code Here

public class Postgres9DBService implements IDBService {
    private PartakeConnectionPool pool;
    private PartakeDAOFactory factory;

    public Postgres9DBService() {
        pool = new Postgres9ConnectionPool();
        factory = new Postgres9DAOFactory();
    }
View Full Code Here

TOP

Related Classes of in.partake.model.dao.postgres9.Postgres9Connection

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.