這裏是一個倉庫,我想找到實體,其中menu_id集合中,我想我的函數名稱是確定springdata JPA發現在收集
@Repository
public interface MenuEntityRepository extends JpaRepository<MenuEntity,Long>{
ArrayList<MenuEntity> findByMenuIdIn(List<Long> menuId);
}
,但我總是得到錯誤:
java.lang.IllegalArgumentException: Parameter value element [1] did not match expected type [java.lang.Long (n/a)]
menu_id is @Entity menu
as Long menu_id
but in mysql type is bigint(20)
so I got menu_id as a List of BigInteger so I got error
你不應該使用具體類型,請'ListList'替換'ArrayList' – Arek
@Arek我試過了,仍然不起作用.. –