Examples of UpdateItem


Examples of easyJ.database.dao.command.UpdateItem

    }

    public void update(UpdateCommand ucmd, Connection conn)
            throws EasyJException {
        /* 下面用来默认的设置更新时间 */
        UpdateItem ui = new UpdateItem();
        ui.setProperty("updateTime");
        ui.setValue(new java.sql.Date(System.currentTimeMillis()));
        ucmd.addUpdateItem(ui);

        ucmd.execute(conn);
    }
View Full Code Here

Examples of easyJ.database.dao.command.UpdateItem

    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,
View Full Code Here

Examples of easyJ.database.dao.command.UpdateItem

    }

    /* 在这里删除只是改变状态,并不是真正的删除,所以调用的是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));
View Full Code Here

Examples of easyJ.database.dao.command.UpdateItem

    /* 根据主键批量删除 */
    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,
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.parser.UpdateItem

    if (stateObject.isDecorated()) {
      toText(stateObject);
    }
    else {
      UpdateItem expression = stateObject.getExpression();

      // Update item
      stateObject.getStateFieldPath().accept(this);

      if (shouldOutput(expression) || expression.hasSpaceAfterStateFieldPathExpression()) {
        writer.append(SPACE);
      }

      // '='
      if (shouldOutput(expression) || expression.hasEqualSign()) {
        writer.append(EQUAL);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterEqualSign()) {
        writer.append(SPACE);
      }

      // New value
      if (stateObject.hasNewValue()) {
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.parser.UpdateItem

    if (stateObject.isDecorated()) {
      toText(stateObject);
    }
    else {
      UpdateItem expression = stateObject.getExpression();

      // Update item
      stateObject.getStateFieldPath().accept(this);

      if (shouldOutput(expression) || expression.hasSpaceAfterStateFieldPathExpression()) {
        writer.append(SPACE);
      }

      // '='
      if (shouldOutput(expression) || expression.hasEqualSign()) {
        writer.append(EQUAL);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterEqualSign()) {
        writer.append(SPACE);
      }

      // New value
      if (stateObject.hasNewValue()) {
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.parser.UpdateItem

    if (stateObject.isDecorated()) {
      toText(stateObject);
    }
    else {
      UpdateItem expression = stateObject.getExpression();

      // Update item
      stateObject.getStateFieldPath().accept(this);

      if (shouldOutput(expression) || expression.hasSpaceAfterStateFieldPathExpression()) {
        writer.append(SPACE);
      }

      // '='
      if (shouldOutput(expression) || expression.hasEqualSign()) {
        writer.append(EQUAL);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterEqualSign()) {
        writer.append(SPACE);
      }

      // New value
      if (stateObject.hasNewValue()) {
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.parser.UpdateItem

    if (stateObject.isDecorated()) {
      toText(stateObject);
    }
    else {
      UpdateItem expression = stateObject.getExpression();

      // Update item
      stateObject.getStateFieldPath().accept(this);

      if (shouldOutput(expression) || expression.hasSpaceAfterStateFieldPathExpression()) {
        writer.append(SPACE);
      }

      // '='
      if (shouldOutput(expression) || expression.hasEqualSign()) {
        writer.append(EQUAL);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterEqualSign()) {
        writer.append(SPACE);
      }

      // New value
      if (stateObject.hasNewValue()) {
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.