我正在使用spring和crud存储库。一切正常,但当我这样做时:
@Query("select distinct(a) from Attribute a where a.placeGroup.organization.id = ?1 and a.placeGroup.id = ?2 and a.attributeEntity = ?3 and a.id in ?4")
List<Attribute> findAllPlaceAttributesByIds(long organizationId, long groupId,
Attribute.AttributeEntity type, Iterable<Long> ids);
我已经逃脱了异常:
Caused by: java.lang.IllegalArgumentException: Parameter value element [4] did not match expected type [java.lang.Long]
任何想法我如何解决这个问题?
答案 0 :(得分:0)
findAllPlaceAttributesByOrganizationAndPlaceGroupAndIdsIn(Orgaization organizationId,PlaceGroup groupId, Attribute.AttributeEntity类型,Iterable ids)
应该这样做。
答案 1 :(得分:0)
事情是,由于错误的Json演员,这个List在某种程度上包含了Strings。