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

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -