potential fix for GRAILS-9750 

(detached criteria ast transformations for annotated jpa entities) - see jira.