How do I find all records matching a list of Ids i

2019-08-03 06:32发布

I have a model class that has an id per record. And I have a list of id's that I want to search from that table.

Do I need to build a SQL statement dynamically and pass it to the Finder object or is there a better way of doing it?

1条回答
太酷不给撩
2楼-- · 2019-08-03 07:02

Try to build a query using Expr.in(String propertyName, Collection<?> values)

Other options are : Expr.in(String propertyName, Object[] values) or Expr.in(String propertyName, Query<?> subQuery)

API reference.

查看更多
登录 后发表回答