You can just have a custom SQLFunction and pass whatever prefix you like as parameter. In your example you'd have a function called my_usr_id that accepts a string literal as argument. The implementation the just uses that string literal during the rendering process. The HQL query would look like this from User u where u.id = my_usr_id('test') and the essential part of the SQLFunction looks like this