
1.findBy...In:省略号中必须是实体类的字段,才能:通过(by)in在(where)查找find。

2.
repository:List<ProductCategory> findByCategoryTypeIn(List<Integer> list);
Test:List<Integer> integerList=Arrays.asList(1,2,3);
List<ProductCategory> res = productCategoryRepository.findByCategoryTypeIn(integerList);
本文介绍了如何使用findBy...In方法进行实体类字段的批量查询。通过示例演示了如何创建一个列表并利用该方法从数据库中检索指定类型的产品类别。
2092

被折叠的 条评论
为什么被折叠?



