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