Examples of UpdateCommand


Examples of com.aragost.javahg.commands.UpdateCommand

    public final String getCommandName() {
        return "update";
    }

    public static UpdateCommand on(Repository repository) {
        return new UpdateCommand(repository);
    }
View Full Code Here

Examples of com.aragost.javahg.commands.UpdateCommand

    public final String getCommandName() {
        return "update";
    }

    public static UpdateCommand on(Repository repository) {
        return new UpdateCommand(repository);
    }
View Full Code Here

Examples of com.aragost.javahg.commands.UpdateCommand

    public final String getCommandName() {
        return "update";
    }

    public static UpdateCommand on(Repository repository) {
        return new UpdateCommand(repository);
    }
View Full Code Here

Examples of com.aragost.javahg.commands.UpdateCommand

    public final String getCommandName() {
        return "update";
    }

    public static UpdateCommand on(Repository repository) {
        return new UpdateCommand(repository);
    }
View Full Code Here

Examples of com.aragost.javahg.commands.UpdateCommand

    public final String getCommandName() {
        return "update";
    }

    public static UpdateCommand on(Repository repository) {
        return new UpdateCommand(repository);
    }
View Full Code Here

Examples of easyJ.database.dao.command.UpdateCommand

        }
        return list.get(0);
    }

    public Object update(Object o, Connection conn) throws EasyJException {
        UpdateCommand ucmd = DAOFactory.getUpdateCommand(o);
        /* 将updateTime,buildTime设为当前时间。所有的表都应该有这两个字段。useState设为Y */
        try {
            BeanUtil.setFieldValue(o, "updateTime", new java.sql.Date(System
                    .currentTimeMillis()));
        } catch (Exception e) {
            e.printStackTrace();
        }
        try {
            BeanUtil.setFieldValue(o, "useState", "Y");
        } catch (Exception e) {
            e.printStackTrace();
        }

        // 在返回之前是不是需要对从数据库中读取o,这里简略了,应该是从数据库按照主键再读一次的。
        ucmd.execute(conn);
        return o;
    }
View Full Code Here

Examples of easyJ.database.dao.command.UpdateCommand

    /* 多主键的删除 */
    public void delete(Object primaryKeys[], Class clazz) throws EasyJException {
        Session session = null;
        try {
            session = SessionFactory.openSession();
            UpdateCommand ucmd = session.getUpdateCommand(clazz);
            UpdateItem ui = new UpdateItem("useState", "N");
            ucmd.addUpdateItem(ui);
            for (int i = 0; i < primaryKeys.length; i++) {
                String primaryKey = (String) BeanUtil.getPubStaticFieldValue(
                        clazz, easyJ.common.Const.PRIMARY_KEY);
                Filter filter = DAOFactory.getFilter(primaryKey,
                        SQLOperator.EQUAL, primaryKeys[i]);
                ucmd.setFilter(filter);
                // EasyJLog.debug(ucmd.getExecutableSQL());
                session.update(ucmd);
            }
        } finally {
            if (session != null)
View Full Code Here

Examples of easyJ.database.dao.command.UpdateCommand

        dao.update(ucmd, conn);
    }

    /* 在这里删除只是改变状态,并不是真正的删除,所以调用的是update */
    public void delete(Object o) throws easyJ.common.EasyJException {
        UpdateCommand ucmd = DAOFactory.getUpdateCommand(o.getClass());
        UpdateItem ui = new UpdateItem("useState", "N");
        ucmd.addUpdateItem(ui);
        String primaryKey = (String) BeanUtil.getPubFieldValue(o,
                easyJ.common.Const.PRIMARY_KEY);
        Filter filter = DAOFactory.getFilter(primaryKey, SQLOperator.EQUAL,
                BeanUtil.getFieldValue(o, primaryKey));
        ucmd.setFilter(filter);
        EasyJLog.debug(ucmd.getExecutableSQL());
        dao.update(ucmd, conn);
    }
View Full Code Here

Examples of easyJ.database.dao.command.UpdateCommand

    }

    /* 根据主键批量删除 */
    public void deleteBatch(Class clazz, Object[] primaryKeys)
            throws easyJ.common.EasyJException {
        UpdateCommand ucmd = DAOFactory.getUpdateCommand(clazz);
        UpdateItem ui = new UpdateItem("useState", "N");
        ucmd.addUpdateItem(ui);
        Long[] primaryKeysLong = new Long[primaryKeys.length];
        for (int i = 0; i < primaryKeys.length; i++)
            primaryKeysLong[i] = new Long(primaryKeys[i].toString());
        String primaryKey = (String) BeanUtil.getPubStaticFieldValue(clazz,
                easyJ.common.Const.PRIMARY_KEY);
        Filter filter = DAOFactory.getFilter(primaryKey, SQLOperator.IN,
                primaryKeysLong);
        ucmd.setFilter(filter);
        EasyJLog.debug(ucmd.getExecutableSQL());
        dao.update(ucmd, conn);
    }
View Full Code Here

Examples of me.taylorkelly.bigbrother.commands.UpdateCommand

        pm.registerEvent(Event.Type.BLOCK_PLACE, stickListener, Priority.Low, this);
       
       
        BBCommand bbc = new BBCommand(this);
        bbc.registerExecutor("version", new VersionCommand(this));
        bbc.registerExecutor("update", new UpdateCommand(this));
        bbc.registerExecutor("watch", new WatchCommand(this));
        bbc.registerExecutor("watched", new WatchedCommand(this));
        bbc.registerExecutor("unwatched", new UnwatchedCommand(this));
        bbc.registerExecutor("cleanse", new CleanseCommand(this));
        bbc.registerExecutor("rollback", new RollbackCommand(this));
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.