Fixed in master and 5.0 branches.
Thanks for the tip about StringHelper. You were close. Hibernate should only check for a left parenthesis before the parameter to determine if it should be enclosed.