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

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


        else
            insert(con, t);
    }

    public void insert(PartakeConnection con, ConfigurationItem t) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;
        Connection cn = pcon.getConnection();

        PreparedStatement ps = null;
        try {
            String sql = "INSERT INTO " + TABLE_NAME + "(key, value) VALUES(?, ?)";
            ps = cn.prepareStatement(sql);
View Full Code Here


            close(ps);
        }
    }

    public void update(PartakeConnection con, ConfigurationItem t) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;
        Connection cn = pcon.getConnection();

        PreparedStatement ps = null;
        try {
            String sql = "UPDATE " + TABLE_NAME + " SET value = ? WHERE key = ?";
            ps = cn.prepareStatement(sql);
View Full Code Here

        }
    }

    @Override
    public ConfigurationItem find(PartakeConnection con, String key) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;
        Connection cn = pcon.getConnection();

        PreparedStatement ps = null;
        ResultSet rs = null;
        try {
            String sql = "SELECT value FROM " + TABLE_NAME + " WHERE key = ?";
View Full Code Here

        }
    }

    @Override
    public boolean exists(PartakeConnection con, String key) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;
        Connection cn = pcon.getConnection();

        PreparedStatement ps = null;
        ResultSet rs = null;
        try {
            String sql = "SELECT 1 FROM " + TABLE_NAME + " WHERE key = ?";
View Full Code Here

        }
    }

    @Override
    public void remove(PartakeConnection con, String key) throws DAOException {
        Postgres9Connection pcon = (Postgres9Connection) con;
        Connection cn = pcon.getConnection();

        PreparedStatement ps = null;
        try {
            String sql = "DELETE FROM " + TABLE_NAME + " WHERE key = ?";
            ps = cn.prepareStatement(sql);
View Full Code Here

        this.mapper = new EntityTwitterMessageMapper();
    }

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

        if (!existsTable(pcon, INDEX_TABLE_NAME)) {
            // event id may be NULL if system message.
            indexDao.createIndexTable(pcon, "CREATE TABLE " + INDEX_TABLE_NAME + "(id TEXT PRIMARY KEY, userId TEXT NOT NULL, createdAt TIMESTAMP NOT NULL)");
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, TwitterMessage 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);
        else
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

        this.mapper = new EntityUserSentMessageMapper();
    }

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

        if (!existsTable(pcon, INDEX_TABLE_NAME)) {
            // event id may be NULL if system message.
            indexDao.createIndexTable(pcon, "CREATE TABLE " + INDEX_TABLE_NAME + "(id TEXT PRIMARY KEY, senderId TEXT NOT NULL, createdAt TIMESTAMP NOT NULL)");
View Full Code Here

TOP

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

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.