I work with PostgreSQL and hibernate
I have this function :
public List getMaxNumOrder (){
String query= "select max(NULLIF(split_part(num_ordre_decision, '/', 3), '')::int) from decision";
SQLQuery sqlQuery = this.getSession().createSQLQuery(query);
return sqlQuery.list();
}
after running my project
I have this error :
org.hibernate.QueryException: Not all named parameters have been set: [:int] [select max(NULLIF(split_part(num_ordre_decision, '/', 3), '')::int) from decision]
at org.hibernate.impl.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:339)
at org.hibernate.impl.SQLQueryImpl.verifyParameters(SQLQueryImpl.java:228)
when I run this query :
select max(NULLIF(split_part(num_ordre_decision, '/', 3), '')::int) from decision
in database I have the correct result
for example related to this kind of data in database :
''
''
'4/35/677'
'4/35/1001'
'4/35/99'
I have 1001
but my problem is related to hibernate