update.java
来自「一个Java持久层类库」· Java 代码 · 共 60 行
JAVA
60 行
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package ActiveObject.core;import ActiveObject.exception.*;import ActiveObject.vo.IntermediaryExpression;import java.sql.SQLException;/** * @author Ruby */public class Update extends CustomizedOperation{ public Update(Class[] objectTypes, String setting, String condition, Object[] params) throws ArgumentFormatError { super(objectTypes, setting, condition, params); expression.setOperateType(IntermediaryExpression.Update); } /** * 添加排序条件 * @param field * @param sortOrder * @return */ public Update addOrder (String field, Order sortOrder) { this.addOrderUtil(field, sortOrder); return this; } public int run() throws SQLException, ObjectAnalysisException { return this.excuteUpdate();//this.toSQLString(), this.expression.getParamValues() } @Override protected String toSQLString() throws ObjectAnalysisException{ return new SQLCreator(expression).toSQLString();// //添加排序控制// String sortSql = this.createOrderStatement();// StringBuffer updateSql = new StringBuffer(200);// updateSql.append("update ");// updateSql.append(this.createAliasStatement());// updateSql.append("set ");// updateSql.append(setting);//// if(!OQLParser.isContentEmpty(condition))// {// updateSql.append(" where ");// updateSql.append(condition);// }// if(sortSql != null)// updateSql.append(sortSql);// return OQLParser.parseLikeSyntax(updateSql, params); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?