JPA JPQL IN子句:如何在JPA中使用IN子句?
@Query("SELECT al FROM Customer al WHERE al.companyCode = ?1 AND al.fileCode IN ?2") List findallByGroup(int CompanyCode,String groups);JPA JPQL IN子句:如何在JPA中使用IN子句?
或者
@Query("SELECT al FROM Customer al WHERE al.companyCode = :CompanyCode AND al.fileCode IN :groups") List<Customer> findallByGroup(@Param("CompanyCode") int CompanyCode,@Param("groups") List<BigInteger> groups); 
OR
@Query("SELECT al FROM Customer al WHERE al.companyCode = :CompanyCode AND al.fileCode IN (:groups)") List<Customer> findallByGroup(@Param("CompanyCode") int CompanyCode,@Param("groups") List<BigInteger> groups); 
回答:
findAllByCompanyCodeAndFileCodeIn(int CompanyCode, List<String> groups) 你不需要@Query。 Spring数据可以理解来自方法名称的查询。使用上面的方法。
以上是 JPA JPQL IN子句:如何在JPA中使用IN子句? 的全部内容, 来源链接: utcz.com/qa/265032.html

