Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makeSpecial 或 addSpecial 更新字段值只能+1或-1 #520

Closed
wqmain opened this issue Sep 12, 2013 · 0 comments
Closed

makeSpecial 或 addSpecial 更新字段值只能+1或-1 #520

wqmain opened this issue Sep 12, 2013 · 0 comments
Assignees
Milestone

Comments

@wqmain
Copy link

wqmain commented Sep 12, 2013

问题产生的条件:
在更新表的某个字段值(数值型)的时候,需要直接对该值增加或减少一定的数量,而不只是自增(+1)或自减(-1)

发生问题的调用代码:
dao.update(Test.class, Chain.makeSpecial("count", "-8"), Cnd.where("id", "=", 1));

问题的详细说明:
目前我使用的nutz框架的版本是:nutz-1.b.47-jdk6.jar
发现在使用过程中需要用到Chain类的makeSpecial 或 addSpecial方法来对实体的某个属性(数值型)更新值,需要增加或减少多个数量,比如 +10 或 -8 这样使用上面两个方法就直接更新成 +10 或 -8了 希望实现对原有的数值进行增或减(count = count - 8)

异常堆栈:
无异常,直接Test实体的count属性值直接被更新成了-8

相关日志:

wendal added a commit that referenced this issue Sep 12, 2013
@ghost ghost assigned wendal Sep 12, 2013
@wendal wendal closed this as completed Sep 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants