Package in.partake.model.dao.postgres9

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


        return UUID.fromString(entityDao.getFreshId((Postgres9Connection) con));
    }

    @Override
    public List<EventTicket> findEventTicketsByEventId(PartakeConnection con, String eventId) throws DAOException {
        Postgres9StatementAndResultSet psars = indexDao.select((Postgres9Connection) con,
                "SELECT id FROM " + INDEX_TABLE_NAME + " WHERE eventId = ? ORDER BY (seq, id) ASC",
                new Object[] { eventId });

        Postgres9IdMapper<EventTicket> idMapper = new Postgres9IdMapper<EventTicket>((Postgres9Connection) con, mapper, entityDao);
        return DAOUtil.convertToList(new Postgres9DataIterator<EventTicket>(idMapper, psars));
View Full Code Here


        return DAOUtil.convertToList(new Postgres9DataIterator<EventTicket>(idMapper, psars));
    }

    @Override
    public void removeByEventId(PartakeConnection con, String eventId) throws DAOException {
        Postgres9StatementAndResultSet psars = indexDao.select((Postgres9Connection) con,
                "SELECT id FROM " + INDEX_TABLE_NAME + " WHERE eventId = ? ORDER BY (seq, id) ASC",
                new Object[] { eventId });

        try {
            ResultSet rs = psars.getResultSet();
            while (rs.next()) {
                String id = rs.getString("id");
                if (id == null)
                    continue;

                remove(con, UUID.fromString(id));
            }
        } catch (SQLException e) {
            throw new DAOException(e);
        } finally {
            psars.close();
        }
    }
View Full Code Here

        return mapper.map(entityDao.find((Postgres9Connection) con, id));
    }

    @Override
    public List<UserNotification> findByUserId(PartakeConnection con, String userId, int offset, int limit) throws DAOException {
        Postgres9StatementAndResultSet psars = indexDao.select((Postgres9Connection) con,
                "SELECT id FROM " + INDEX_TABLE_NAME + " WHERE userId = ? OFFSET ? LIMIT ?",
                new Object[] { userId, offset, limit });

        Postgres9IdMapper<UserNotification> idMapper = new Postgres9IdMapper<UserNotification>((Postgres9Connection) con, mapper, entityDao);
        DataIterator<UserNotification> it = new Postgres9DataIterator<UserNotification>(idMapper, psars);
View Full Code Here

    }

    @Override
    public List<UserTwitterLink> findByScreenNamePrefix(PartakeConnection con, String screenNamePrefix, int limit) throws DAOException {
        // What happends if '%' is included in the screenNamePrefix?
        Postgres9StatementAndResultSet psars = indexDao.select((Postgres9Connection) con,
                "SELECT id FROM " + INDEX_TABLE_NAME + " WHERE screenName LIKE ? LIMIT ?",
                new Object[] { escapeForLike(screenNamePrefix) + "%", limit });

        try {
            Postgres9IdMapper<UserTwitterLink> idMapper = new Postgres9IdMapper<UserTwitterLink>((Postgres9Connection) con, mapper, entityDao);
            DataIterator<UserTwitterLink> it = new Postgres9DataIterator<UserTwitterLink>(idMapper, psars);
            return DAOUtil.convertToList(it);
        } finally {
            psars.close();
        }


    }
View Full Code Here

        remove(con, id);
    }

    @Override
    public List<UserTicket> findByTicketId(PartakeConnection con, UUID eventTicketId, int offset, int limit) throws DAOException {
        Postgres9StatementAndResultSet psars = indexDao.select((Postgres9Connection) con,
                "SELECT id FROM " + INDEX_TABLE_NAME + " WHERE ticketId = ? ORDER BY appliedAt DESC OFFSET ? LIMIT ?",
                new Object[] { eventTicketId.toString(), offset, limit });

        Postgres9IdMapper<UserTicket> idMapper = new Postgres9IdMapper<UserTicket>((Postgres9Connection) con, mapper, entityDao);
        DataIterator<UserTicket> it = new Postgres9DataIterator<UserTicket>(idMapper, psars);
View Full Code Here

        return DAOUtil.freeze(DAOUtil.convertToList(it));
    }

    @Override
    public List<UserTicket> findByEventId(PartakeConnection con, String eventId, int offset, int limit) throws DAOException {
        Postgres9StatementAndResultSet psars = indexDao.select((Postgres9Connection) con,
                "SELECT id FROM " + INDEX_TABLE_NAME + " WHERE eventId = ? ORDER BY appliedAt DESC OFFSET ? LIMIT ?",
                new Object[] { eventId, offset, limit });

        Postgres9IdMapper<UserTicket> idMapper = new Postgres9IdMapper<UserTicket>((Postgres9Connection) con, mapper, entityDao);
        DataIterator<UserTicket> it = new Postgres9DataIterator<UserTicket>(idMapper, psars);
View Full Code Here

    }


    @Override
    public List<UserTicket> findByUserId(PartakeConnection con, String userId, int offset, int limit) throws DAOException {
        Postgres9StatementAndResultSet psars = indexDao.select((Postgres9Connection) con,
                "SELECT id FROM " + INDEX_TABLE_NAME + " WHERE userId = ? ORDER BY appliedAt DESC OFFSET ? LIMIT ?",
                new Object[] { userId, offset, limit });

        Postgres9IdMapper<UserTicket> idMapper = new Postgres9IdMapper<UserTicket>((Postgres9Connection) con, mapper, entityDao);
        DataIterator<UserTicket> it = new Postgres9DataIterator<UserTicket>(idMapper, psars);
View Full Code Here

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

    @Override
    public List<EventActivity> findByEventId(PartakeConnection con, String eventId, int length) throws DAOException {
        Postgres9StatementAndResultSet psars = indexDao.select((Postgres9Connection) con,
                "SELECT id FROM " + INDEX_TABLE_NAME + " WHERE eventId = ? ORDER BY createdAt DESC LIMIT ?",
                new Object[] { eventId, length });

        Postgres9IdMapper<EventActivity> idMapper = new Postgres9IdMapper<EventActivity>((Postgres9Connection) con, mapper, entityDao);
View Full Code Here

        super.initialize(con);
    }

    @Override
    protected IConfigurationItemAccess createConfiguraitonItemAccess() {
        return new Postgres9ConfigurationItemDao();
    }
View Full Code Here

        return new Postgres9EventFeedDao();
    }

    @Override
    protected IEventActivityAccess createEventActivityAccess() {
        return new Postgres9EventActivityDao();
    }
View Full Code Here

TOP

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

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.