Commit 6fbcc110 authored by hewei's avatar hewei

乐观锁插件测试用例

parent 01f5e51b
...@@ -570,15 +570,18 @@ public class OptimisticLockerPlugin extends BasePlugin { ...@@ -570,15 +570,18 @@ public class OptimisticLockerPlugin extends BasePlugin {
if (selective) { if (selective) {
XmlElement setEle = new XmlElement("set"); XmlElement setEle = new XmlElement("set");
updateEle.addElement(setEle); updateEle.addElement(setEle);
// set 节点
XmlElement trimEle = XmlElementGeneratorTools.generateSetsSelective(columns, "record.");
setEle.addElement(trimEle);
// 版本自增 // 版本自增
setEle.addElement(new TextElement( trimEle.addElement(0, new TextElement(
MyBatis3FormattingUtilities.getEscapedColumnName(this.versionColumn) MyBatis3FormattingUtilities.getEscapedColumnName(this.versionColumn)
+ " = " + " = "
+ MyBatis3FormattingUtilities.getEscapedColumnName(this.versionColumn) + MyBatis3FormattingUtilities.getEscapedColumnName(this.versionColumn)
+ " + 1," + " + 1,"
)); ));
// set 节点
setEle.addElement(XmlElementGeneratorTools.generateSetsSelective(columns, "record."));
} else { } else {
// 版本自增 // 版本自增
updateEle.addElement(new TextElement( updateEle.addElement(new TextElement(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment