1

我想通过某些参数过滤我的列表函数,查看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 子句应该采用什么格式或如何使用它的任何文档?

4

1 回答 1

1

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:

"user.username = 'lucernae'"

It will list all the User model instances which username equals 'lucernae'

于 2012-12-20T05:05:57.417 回答