📄 updatecommand.java
字号:
package controller.command;
import java.sql.SQLException;
import model.condition.visitor.SingleVisitor;
import model.condition.visitor.Visitor;
import model.persistency.PersistentItem;
/**
*
* <p>Title: </p>
* 更新命令
* <p>Description: </p>
* 继承操作命令接口,通过此类调用MODEL层的更新命令
*/
public class UpdateCommand implements OperateCommand{
PersistentItem item;
public UpdateCommand(PersistentItem itm){
item = new PersistentItem(itm.getOid());
item = itm;
}
public void excute() {
Visitor v = new SingleVisitor();
try{
v.update(item);
}catch(SQLException e){System.out.println("sql wrong");}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -