Possible solution for GRAILS-10454

changed the way of getting real class of hibernate proxied object