-
Notifications
You must be signed in to change notification settings - Fork 159
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
老兄,DomainModel.query 怎么使用order by 呀。 #52
Labels
enhancement
New feature or request
Comments
你好,query 方法中的确没有orderBy, limit 等参数,主要考虑这类参数并不是频繁被使用的,后续根据实际情况调整。 |
catchex
added
documentation
Improvements or additions to documentation
enhancement
New feature or request
question
Further information is requested
labels
Nov 24, 2020
大佬,不太对呀,例如下面的代码: List<Member> members = Members.queryAll();
List<Member> members = Member.query("id > ?", 1); 这里,我可加orderBy 或者limit 等操作,就不行呀,非要去构造Query 太麻烦了。 |
同感! |
的确有点不太合适,针对多行数据的查询,使用到orderBy 或limit 等约束的可能性比较大,我考虑一下再增加一个中间状态的方法,直接返回Query 接口。 |
可以作为一个新的Feature 合在下一个版本。 |
暂时你们先按下列方法编程: Query query = Member.createQuery();
query.project("name").groupBy("name").having("COUNT(*) > 0").orderBy("name DESC");
List<Member> members = query.execute(Member.HAS_MANY_ORDERS); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
简单查询中,排序是很正常的需求呀,不能用到排序这种简单的查询还需要使用复杂SQL 吧,不是很人性化。
从我的理解看,增加一个排序应该不难呀。
The text was updated successfully, but these errors were encountered: