Package in.partake.model.dao.postgres9.impl

Examples of in.partake.model.dao.postgres9.impl.EntityEventTicketMapper


    private final Postgres9IndexDao editorIndexDao;
    private final EntityEventMapper mapper;

    public Postgres9EventDao() {
        this.entityDao = new Postgres9EntityDao(ENTITY_TABLE_NAME);
        this.indexDao = new Postgres9IndexDao(INDEX_TABLE_NAME);
        this.editorIndexDao = new Postgres9IndexDao(EDITOR_INDEX_TABLE_NAME);
        this.mapper = new EntityEventMapper();
    }
View Full Code Here


    private final Postgres9IndexDao indexDao;
    private final EntityEventNotificationMapper mapper;

    public Postgres9EventNotificationDao() {
        this.entityDao = new Postgres9EntityDao(ENTITY_TABLE_NAME);
        this.indexDao = new Postgres9IndexDao(INDEX_TABLE_NAME);
        this.mapper = new EntityEventNotificationMapper();
    }
View Full Code Here

    private final EntityImageMapper mapper;


    public Postgres9UserImageDao() {
        this.entityDao = new Postgres9EntityDao(ENTITY_TABLE_NAME);
        this.indexDao = new Postgres9IndexDao(USER_INDEX_TABLE_NAME);
        this.mapper = new EntityImageMapper();
    }
View Full Code Here

    private final Postgres9IndexDao indexDao;
    private final EntityUserReceivedMessageMapper mapper;

    public Postgres9UserReceivedMessageDao() {
        this.entityDao = new Postgres9EntityDao(ENTITY_TABLE_NAME);
        this.indexDao = new Postgres9IndexDao(INDEX_TABLE_NAME);
        this.mapper = new EntityUserReceivedMessageMapper();
    }
View Full Code Here

    private final Postgres9IndexDao indexDao;
    private final EntityCommentMapper mapper;

    public Postgres9EventCommentDao() {
        this.entityDao = new Postgres9EntityDao(ENTITY_TABLE_NAME);
        this.indexDao = new Postgres9IndexDao(INDEX_TABLE_NAME);
        this.mapper = new EntityCommentMapper();
    }
View Full Code Here

    private final Postgres9IndexDao indexDao;
    private final EntityEventFeedMapper mapper;

    public Postgres9EventFeedDao() {
        this.entityDao = new Postgres9EntityDao(ENTITY_TABLE_NAME);
        this.indexDao = new Postgres9IndexDao(INDEX_TABLE_NAME);
        this.mapper = new EntityEventFeedMapper();
    }
View Full Code Here

    @Override
    public List<Event> findByOwnerId(PartakeConnection con, String userId, EventFilterCondition criteria, int offset, int limit) throws DAOException {
        String draftSql = conditionClauseForCriteria(criteria);

        Postgres9StatementAndResultSet psars = indexDao.select((Postgres9Connection) con,
                "SELECT id FROM " + INDEX_TABLE_NAME + " WHERE ownerId = ? " + draftSql + " ORDER BY beginDate DESC OFFSET ? LIMIT ?",
                new Object[] { userId, offset, limit });

        Postgres9IdMapper<Event> idMapper = new Postgres9IdMapper<Event>((Postgres9Connection) con, mapper, entityDao);

        try {
            ArrayList<Event> events = new ArrayList<Event>();
            DataIterator<Event> it = new Postgres9DataIterator<Event>(idMapper, psars);
            while (it.hasNext()) {
                Event event = it.next();
                if (event == null)
                    continue;
                events.add(event);
            }

            return events;
        } finally {
            psars.close();
        }
    }
View Full Code Here

    }

    @Override
    public DataIterator<Event> getIterator(PartakeConnection con, EventFilterCondition condition) throws DAOException {
        String draftSql = conditionClauseForCriteria(condition);
        Postgres9StatementAndResultSet psars = indexDao.select((Postgres9Connection) con,
                "SELECT id FROM " + INDEX_TABLE_NAME + " WHERE 1 = 1 " + draftSql + " ORDER BY beginDate DESC",
                new Object[] {});

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

    @Override
    public List<Event> findByEditorUserId(PartakeConnection con, String editorUserId, EventFilterCondition criteria, int offset, int limit) throws DAOException {
        String condition = conditionClauseForCriteria(criteria);

        Postgres9StatementAndResultSet psars = editorIndexDao.select((Postgres9Connection) con,
                "SELECT id FROM " + EDITOR_INDEX_TABLE_NAME + " WHERE editorId = ? " + condition + " ORDER BY beginDate DESC OFFSET ? LIMIT ?",
                new Object[] { editorUserId, offset, limit });

        Postgres9IdMapper<Event> idMapper = new Postgres9IdMapper<Event>((Postgres9Connection) con, mapper, entityDao);

        try {
            DataIterator<Event> it = new Postgres9DataIterator<Event>(idMapper, psars);
            return DAOUtil.convertToList(it);
        } finally {
            psars.close();
        }
    }
View Full Code Here

    }

    @Override
    public int countByEditorUserId(PartakeConnection con, String editorId, EventFilterCondition criteria) throws DAOException {
        String condition = conditionClauseForCriteria(criteria);
        Postgres9StatementAndResultSet psars = editorIndexDao.select((Postgres9Connection) con,
                "SELECT count(1) FROM " + EDITOR_INDEX_TABLE_NAME + " WHERE editorId = ? " + condition,
                new Object[] { editorId });

        try {
            ResultSet rs = psars.getResultSet();
            if (rs.next())
                return rs.getInt(1);
            else
                return 0;
        } catch (SQLException e) {
            throw new DAOException(e);
        } finally {
            psars.close();
        }
    }
View Full Code Here

TOP

Related Classes of in.partake.model.dao.postgres9.impl.EntityEventTicketMapper

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.