java - How to use named parameters in a native spring-data @Query? -
i'm trying set db query using spring-data-jpa
, native query postgres
database. following not work. why?
@query(value = "select reltuples::bigint estimate pg_class oid = 'public.my_table'::regclass", nativequery = true) public int count();
result:
java.lang.illegalargumentexception: org.hibernate.queryexception: not named parameters have been set: [:bigint, :regclass;]
found it: ::
have escaped \\:\\:
Comments
Post a Comment