Hello,
I have a column invoiceNumber of var chars in the format like that: \d+/\d+ or \d+, so it may be: 123/12, 12/234, 23,....
I would like to execute a HibernateTemplate's find with HQL query which will load a row with max invoiceNumber (but if '/' exists in the string the query should take only a substring before '/' char into the comparison).
I tried to use: getHibernateTemplate().find("select max(substring(w.invoiceNumber from '^[0-9]+')) from Work w") but I can see in the logs that it creates: select max(substring(work0_.invoice_number, from, '^[0-9]+')) as col_0_0_ from works work0_
so of course it does not work. Any ideas how should I fix my HQL?
Kind regards, Gandalf
|