public static void configureDomainBinder( GrailsApplication grailsApplication, Set<GrailsDomainClass> domainClasses) { Closure defaultMapping = grailsApplication.getConfig().getProperty(DEFAULT_MAPPING, Closure.class); if (defaultMapping != null) { binder.setDefaultMapping(defaultMapping); } // do Grails class configuration for (GrailsDomainClass domainClass : domainClasses) { if (defaultMapping != null) { binder.evaluateMapping(domainClass, defaultMapping); } else { binder.evaluateMapping(domainClass); } } }
public void configureDomainBinder( GrailsDomainBinder binder, GrailsApplication grailsApplication, Set<GrailsDomainClass> domainClasses) { GrailsHibernateUtil.setDomainBinder(binder); Closure defaultMapping = grailsApplication .getConfig() .getProperty(GrailsDomainConfiguration.DEFAULT_MAPPING, Closure.class); // do Grails class configuration if (defaultMapping != null) { binder.setDefaultMapping(defaultMapping); } for (GrailsDomainClass domainClass : domainClasses) { if (defaultMapping != null) { binder.evaluateMapping(domainClass, defaultMapping); } else { binder.evaluateMapping(domainClass); } } }