Postgresql 如何使用spring数据jpa运行本机postgres查询

Postgresql 如何使用spring数据jpa运行本机postgres查询,postgresql,spring-data-jpa,Postgresql,Spring Data Jpa,我正在使用spring数据jpa运行原生postgres查询。查询是在实体的jsonb数据上执行的。 我可以在db server上成功运行原始查询: SELECT e.* FROM public.entity e where e.json ? 'salary' and e.json ->> 'salary' > '10000'; 但是,由于spring数据jpa也支持参数化查询的?,因此查询语法中似乎存在冲突,因此应用程序最终甚至无法启动 @Query(value = "s

我正在使用
spring数据jpa
运行原生
postgres
查询。查询是在实体的jsonb数据上执行的。 我可以在db server上成功运行原始查询:

SELECT e.* 
FROM public.entity e where e.json ? 'salary' and e.json ->> 'salary' > '10000';
但是,由于
spring数据jpa
也支持参数化查询的
,因此查询语法中似乎存在冲突,因此应用程序最终甚至无法启动

@Query(value = "select e.* from Entity e where e.json ? 'salary' and e.json->> 'salary' > ?1", nativeQuery = true)
List<Lead> getEntitiesBySalaryGreaterThan(String value);
@Query(value=“从实体e中选择e.*,其中e.json?'salary'和e.json->>'salary'>?1”,nativeQuery=true)
列出getEntitiesBySalaryGreaterThan(字符串值);
}


请告诉我在
spring data jpa
env

中执行预期本机查询的解决方法或正确方式,您是否可能需要按照描述转义

我已经有了,如果您看到ur@query,它有两个本机querytanks man!!不知道postgres允许创建自定义运算符