mappings.setAutoImport(m == null || m.getAutoImport()); GrailsDomainBinder.bindClass(domainClass, mappings, sessionFactoryBeanName);
/** * Overrides the default behaviour to including binding of Grails domain classes. */ @Override protected void secondPassCompile() throws MappingException { if (configLocked) { return; } // set the class loader to load Groovy classes if (grailsApplication != null) { Thread.currentThread().setContextClassLoader(grailsApplication.getClassLoader()); } configureDomainBinder(grailsApplication, domainClasses); for (GrailsDomainClass domainClass : domainClasses) { if (!GrailsHibernateUtil.usesDatasource(domainClass, dataSourceName)) { continue; } final Mappings mappings = super.createMappings(); Mapping m = GrailsDomainBinder.getMapping(domainClass); mappings.setAutoImport(m == null || m.getAutoImport()); GrailsDomainBinder.bindClass(domainClass, mappings, sessionFactoryBeanName); } super.secondPassCompile(); configLocked = true; }
private static void extractRootAttributes(Element hmNode, Mappings mappings) { Attribute schemaNode = hmNode.attribute( "schema" ); mappings.setSchemaName( ( schemaNode == null ) ? null : schemaNode.getValue() ); Attribute catalogNode = hmNode.attribute( "catalog" ); mappings.setCatalogName( ( catalogNode == null ) ? null : catalogNode.getValue() ); Attribute dcNode = hmNode.attribute( "default-cascade" ); mappings.setDefaultCascade( ( dcNode == null ) ? "none" : dcNode.getValue() ); Attribute daNode = hmNode.attribute( "default-access" ); mappings.setDefaultAccess( ( daNode == null ) ? "property" : daNode.getValue() ); Attribute dlNode = hmNode.attribute( "default-lazy" ); mappings.setDefaultLazy( dlNode == null || dlNode.getValue().equals( "true" ) ); Attribute aiNode = hmNode.attribute( "auto-import" ); mappings.setAutoImport( ( aiNode == null ) ? true : "true".equals( aiNode.getValue() ) ); Attribute packNode = hmNode.attribute( "package" ); if ( packNode != null ) mappings.setDefaultPackage( packNode.getValue() ); }
private static void extractRootAttributes(Element hmNode, Mappings mappings) { Attribute schemaNode = hmNode.attribute( "schema" ); mappings.setSchemaName( ( schemaNode == null ) ? null : schemaNode.getValue() ); Attribute catalogNode = hmNode.attribute( "catalog" ); mappings.setCatalogName( ( catalogNode == null ) ? null : catalogNode.getValue() ); Attribute dcNode = hmNode.attribute( "default-cascade" ); mappings.setDefaultCascade( ( dcNode == null ) ? "none" : dcNode.getValue() ); Attribute daNode = hmNode.attribute( "default-access" ); mappings.setDefaultAccess( ( daNode == null ) ? "property" : daNode.getValue() ); Attribute dlNode = hmNode.attribute( "default-lazy" ); mappings.setDefaultLazy( dlNode == null || dlNode.getValue().equals( "true" ) ); Attribute aiNode = hmNode.attribute( "auto-import" ); mappings.setAutoImport( ( aiNode == null ) || "true".equals( aiNode.getValue() ) ); Attribute packNode = hmNode.attribute( "package" ); if ( packNode != null ) mappings.setDefaultPackage( packNode.getValue() ); }
private static void extractRootAttributes(Element hmNode, Mappings mappings) { Attribute schemaNode = hmNode.attribute( "schema" ); mappings.setSchemaName( ( schemaNode == null ) ? null : schemaNode.getValue() ); Attribute catalogNode = hmNode.attribute( "catalog" ); mappings.setCatalogName( ( catalogNode == null ) ? null : catalogNode.getValue() ); Attribute dcNode = hmNode.attribute( "default-cascade" ); mappings.setDefaultCascade( ( dcNode == null ) ? "none" : dcNode.getValue() ); Attribute daNode = hmNode.attribute( "default-access" ); mappings.setDefaultAccess( ( daNode == null ) ? "property" : daNode.getValue() ); Attribute dlNode = hmNode.attribute( "default-lazy" ); mappings.setDefaultLazy( dlNode == null || dlNode.getValue().equals( "true" ) ); Attribute aiNode = hmNode.attribute( "auto-import" ); mappings.setAutoImport( ( aiNode == null ) || "true".equals( aiNode.getValue() ) ); Attribute packNode = hmNode.attribute( "package" ); if ( packNode != null ) mappings.setDefaultPackage( packNode.getValue() ); }
private static void extractRootAttributes(Element hmNode, Mappings mappings) { Attribute schemaNode = hmNode.attribute( "schema" ); mappings.setSchemaName( ( schemaNode == null ) ? null : schemaNode.getValue() ); Attribute catalogNode = hmNode.attribute( "catalog" ); mappings.setCatalogName( ( catalogNode == null ) ? null : catalogNode.getValue() ); Attribute dcNode = hmNode.attribute( "default-cascade" ); mappings.setDefaultCascade( ( dcNode == null ) ? "none" : dcNode.getValue() ); Attribute daNode = hmNode.attribute( "default-access" ); mappings.setDefaultAccess( ( daNode == null ) ? "property" : daNode.getValue() ); Attribute dlNode = hmNode.attribute( "default-lazy" ); mappings.setDefaultLazy( dlNode == null || dlNode.getValue().equals( "true" ) ); Attribute aiNode = hmNode.attribute( "auto-import" ); mappings.setAutoImport( ( aiNode == null ) || "true".equals( aiNode.getValue() ) ); Attribute packNode = hmNode.attribute( "package" ); if ( packNode != null ) mappings.setDefaultPackage( packNode.getValue() ); }