Not all named parameters have been set in specific conditions
hibernate, java, postgresql
Solution
Try to replace the Postgres-specific (::) type cast with a SQL-standard one - `CAST ('2013-01-01' AS DATE)` (or `DATE '2013-01-01'`).
Problem
I have using then following query in my Hibernate i.e createSQLQuery ``` SELECT to_char(dd, 'Mon YYYY') FROM generate_series('2013-01-01'::date, date_trunc('month', now()), '1 month') as dd ``` which produces output when run in PostgreSQL as - "Jan 2013" "Feb 2013" . . "Feb 2014" However while using it through createSQLQuery as below , it throws "org.hibernate.QueryException: Not all named parameters have been set: [:date]" Please note that date has been used like '2013-01-01'::date ``` try{ session = HibernateSessionFactory.getSession(); tx = session.beginTransaction(); Query query = session.createSQLQuery("SELECT to_char(dd, 'Mon YYYY') FROM generate_series('2013-01-01'::date, date_trunc('month', now()), '1 month') as dd"); monthList = new ArrayList<String>(); monthList = query.list(); tx.commit(); } ``` Please suggest