applied fix for GRAILS-7729 to hibernate 4