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

Cnd .where(查询条件).orderBy() 后,查询条件不起作用 #108

Closed
ming300 opened this issue Nov 11, 2011 · 3 comments
Closed

Cnd .where(查询条件).orderBy() 后,查询条件不起作用 #108

ming300 opened this issue Nov 11, 2011 · 3 comments
Labels

Comments

@ming300
Copy link
Member

ming300 commented Nov 11, 2011

Condition condition = Cnd   .where("glbm", "=", glbm)
                                .and("zt", "=", "1")
                                .and("kskm", "=", kskm)
                                .asc("kscd");

得到的sql:
SELECT * FROM jax_yy_kscd_info WHERE glbm='220100000000' AND zt='1' AND kskm='1' ORDER BY kscd ASC

但是:
Condition condition = Cnd .where("glbm", "=", glbm)
.and("zt", "=", "1")
.and("kskm", "=", kskm)
.orderBy()
.asc("kscd");

得到的sql:
SELECT * FROM jax_yy_kscd_info ORDER BY kscd ASC

是不是需要兼容一下呢?

nutz-1.b.40有这个问题,nutz-1.b.38也有同样问题

@ming300
Copy link
Member Author

ming300 commented Nov 11, 2011

Cnd.cri() 智能多了.
SimpleCriteria cri = Cnd.cri();
cri.where().and("glbm", "=", glbm);
cri.where().and("zt", "=", "1");
cri.where().and("kskm", "=", kskm);
cri.getOrderBy().asc("kscd");

和 cri.where().and("glbm", "=", glbm).and("zt", "=", "1").and("kskm", "=", kskm);
cri.getOrderBy().asc("kscd"); 都可以达到要求.

@wendal
Copy link
Member

wendal commented Nov 12, 2011

Cnd.orderBy是静态方法呢

@wendal wendal closed this as completed Nov 12, 2011
@zozoh
Copy link
Member

zozoh commented Dec 7, 2011

cri 就是给你做复杂的拼接的, Cnd.orderBy 是链式赋值的起点 ......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants