I created on function in mysql
SELECT mpm_autogenerate_code(param1,param2)
and i want to call this function using Hibernate Query Language
You can use native SQL Queries.
Another possibility is to extend a Dialect as described in this answer, but it is more complex.