Play 中的链接查询!框架
有没有办法在“Play!”中链接查询框架而不是手动编写查询?
像这样的东西:
模型 m = Model.where("姓名","比尔").where("性别","米").first();
我想知道,因为我最近从 Codeigniter + dmz 切换到 grails然后现在到“玩!”并且有点失望与上述框架相比的查询链接
PS:我显然不是在谈论 fetch() 和 from() 方法。
is there a way to chain queries in the "Play!" framework instead of manually writing a query ?
Something like:
Model m = Model.where("name","Bill").where("gender","m").first();
I wonder because I recently switched from Codeigniter + dmz to grails then now to "Play!" and have been a bit disappointed by the queries chaining compared to the framework mentioned above
PS: I'm obviously not talking about the fetch() and the from() methods.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有一个 JpqlSelect 对象可以用来做
这个帮助器还远未完成,但它可能适合您的需求
There is a JpqlSelect object with wich you can do
This helper is far from being complete but it may suits your needs
您可以使用 java.persistence Criteria API 来完成此操作,
如下所示:此处 和此处作为开始
You can do it with java.persistence Criteria API like that:
Look here and here for start
另一种选择是使用 http://www.querydsl.com/ 及其 jpa 集成。
An other option could be using http://www.querydsl.com/ with it's jpa integration.