public static void cacheCriteriaByMapping ( Class < ? > targetClass , Criteria criteria ) { Mapping m = GrailsDomainBinder . getMapping ( targetClass ) ; if ( m != null && m . getCache ( ) != null && m . getCache ( ) . getEnabled ( ) ) { criteria . setCacheable ( true ) ; } }
Configures the criteria instance to cache based on the configured mapping .