玩!框架,自定义CRUD list()函数
我想通过某些参数过滤我的列表函数,查看 CRUD.java 控制器 :
List<Model> objects = type.findPage(page, search, searchFields, orderBy, order, (String) request.args.get("where"));
Long count = type.count(search, searchFields, (String) request.args.get("where"));
Long totalCount = type.count(null, null, (String) request.args.get("where"));
它似乎是根据查询字符串中的 where 参数进行过滤,但我找不到任何有关 where 子句应采用什么格式或如何使用它的文档?
I want to filter my list function by certain parameters, looking at the CRUD.java controller :
List<Model> objects = type.findPage(page, search, searchFields, orderBy, order, (String) request.args.get("where"));
Long count = type.count(search, searchFields, (String) request.args.get("where"));
Long totalCount = type.count(null, null, (String) request.args.get("where"));
It seems to be filtering based on the where parameter in the query string, but I can't find any documentation on what format the where clause should be in, or how to use it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个简单的 JPA 查询 where 子句。
例如,如果您有一个具有用户名属性的 User 模型,您可以创建一个 where 子句,如下所示:
它将列出用户名等于“lucernae”的所有 User 模型实例
It is a simple JPA query where clause.
For example if you have a User model with username properties, you could make a where clause such as this:
It will list all the User model instances which username equals 'lucernae'