Anyone could help me I need to order a string for example user1, user2, ..., user1000
I found sql solution but I would like to use criteria builder and I don´t if exist CAST and AS UNSIGNED
The sql that works is
ORDER BY CAST(SUBSTR(username FROM 4) AS UNSIGNED) ASC Using JPQL SELECT u FROM Users u ORDER BY SUBSTRING(u.username,4)*1 ASC
If you have other alternative for JPA CriteriaBuilder to do it as sql did please let me know.