ported hibernate3 changes to hibernate4 module
could not enable @CompileStatic in HibernateGormStaticApi because of CS bugs