I have a MySQL column as string and I have it like “NAME123456“
Now I would like to do a substring and cast it in Hibernate criteria and sort.
I would do it in normal SQL Query as.
CAST(SUBSTRING(column,LOCATE('NAME',column)+1) AS SIGNED)
But How would I do it in Criteria ?
when queries are complex, just use HQL. The end result will be the same. You can do sorting there too.