Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/343.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用列表<;长期>;弹簧储油器中的as参数_Java_Mysql_Spring_Hibernate_Jpa - Fatal编程技术网

Java 使用列表<;长期>;弹簧储油器中的as参数

Java 使用列表<;长期>;弹簧储油器中的as参数,java,mysql,spring,hibernate,jpa,Java,Mysql,Spring,Hibernate,Jpa,我正在使用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 organi

我正在使用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);

有什么办法可以解决这个问题吗?

通过Organization和PlaceGroupandInsin(Organization organizationId、PlaceGroup groupId、, Attribute.AttributeEntity类型,Iterable ID)


应该做到这一点。

事情是,在某种程度上,由于错误的Json转换,该列表包含字符串。

ID应该是长的,而不是Iterablegreat,但它应该是列表而不是1值,但对于其余的参数呢?我还想使用organizationId、groupId和类型。对不起,我以为您想在查询中了解。我认为对于所有其他参数,您需要更改方法名称并传递对象而不是id。我更新了答案。试试看。好的,你应该考虑删除这个问题:
Caused by: java.lang.IllegalArgumentException: Parameter value element [4] did not match expected type [java.lang.Long]