我正在尝试使用spring-data-jpa
和postgres
数据库的本机查询来设置数据库查询。但以下不起作用。为什么呢?
@Query(value = "SELECT reltuples::bigint AS estimate FROM pg_class WHERE oid = 'public.my_table'::regclass", nativeQuery = true)
public int count();
结果:
java.lang.IllegalArgumentException: org.hibernate.QueryException: Not all named parameters have been set: [:bigint, :regclass;]
答案 0 :(得分:1)
找到它:::
必须像\\:\\: