This is an automated email from the ASF dual-hosted git repository.

borinquenkid pushed a commit to branch 8.0.x-hibernate7-dev
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit d2f1d4273878116a90da2549b0e1ea5a837e8e8e
Author: Walter Duque de Estrada <[email protected]>
AuthorDate: Sat Mar 7 18:58:21 2026 -0600

    hibernate7: more CodeNarc
---
 .../grails/orm/hibernate/cfg/CacheConfig.groovy    |  7 ++--
 .../grails/orm/hibernate/cfg/ColumnConfig.groovy   |  1 +
 .../orm/hibernate/cfg/CompositeIdentity.groovy     |  1 +
 .../hibernate/support/DataSourceFactoryBean.groovy | 42 ----------------------
 4 files changed, 6 insertions(+), 45 deletions(-)

diff --git 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/CacheConfig.groovy
 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/CacheConfig.groovy
index 5d6f30fda2..f7da3718ef 100644
--- 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/CacheConfig.groovy
+++ 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/CacheConfig.groovy
@@ -32,13 +32,14 @@ import org.springframework.validation.DataBinder
 @CompileStatic
 @Builder(builderStrategy = SimpleStrategy, prefix = '')
 class CacheConfig implements Cloneable {
-    static final List USAGE_OPTIONS = ['read-only', 
'read-write','nonstrict-read-write','transactional']
+
+    static final List USAGE_OPTIONS = ['read-only', 'read-write', 
'nonstrict-read-write', 'transactional']
     static final List INCLUDE_OPTIONS = ['all', 'non-lazy']
 
     /**
      * The cache usage
      */
-    String usage = "read-write"
+    String usage = 'read-write'
     /**
      * Whether caching is enabled
      */
@@ -46,7 +47,7 @@ class CacheConfig implements Cloneable {
     /**
      * What to include in caching
      */
-    String include = "all"
+    String include = 'all'
 
     /**
      * Configures a new CacheConfig instance
diff --git 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/ColumnConfig.groovy
 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/ColumnConfig.groovy
index c7a63d1856..8f2b92c3f0 100644
--- 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/ColumnConfig.groovy
+++ 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/ColumnConfig.groovy
@@ -32,6 +32,7 @@ import org.springframework.validation.DataBinder
 @CompileStatic
 @Builder(builderStrategy = SimpleStrategy, prefix = '')
 class ColumnConfig {
+
     /**
      * The column name
      */
diff --git 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/CompositeIdentity.groovy
 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/CompositeIdentity.groovy
index c9613af565..6dc34ca7ac 100644
--- 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/CompositeIdentity.groovy
+++ 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/CompositeIdentity.groovy
@@ -35,6 +35,7 @@ import org.hibernate.MappingException
 @Builder(builderStrategy = SimpleStrategy, prefix = '')
 @CompileStatic
 class CompositeIdentity extends Property implements HibernateIdentity {
+
     /**
      * The property names that make up the custom identity
      */
diff --git 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/support/DataSourceFactoryBean.groovy
 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/support/DataSourceFactoryBean.groovy
deleted file mode 100644
index f47bf74f54..0000000000
--- 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/support/DataSourceFactoryBean.groovy
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.grails.orm.hibernate.support
-
-import groovy.transform.CompileStatic
-import org.grails.orm.hibernate.HibernateDatastore
-import org.grails.orm.hibernate.connections.HibernateConnectionSource
-import org.springframework.beans.factory.FactoryBean
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.beans.factory.annotation.Qualifier
-
-import javax.sql.DataSource
-
-/**
- * A factory class to retrieve a {@link javax.sql.DataSource} from the 
Hibernate datastore
- *
- * @author James Kleeh
- */
-@CompileStatic
-class DataSourceFactoryBean implements FactoryBean<DataSource> {
-
-    HibernateDatastore datastore
-    String connectionName
-
-    DataSourceFactoryBean(HibernateDatastore datastore, String connectionName) 
{
-        this.datastore = datastore
-        this.connectionName = connectionName
-    }
-
-    @Override
-    DataSource getObject() throws Exception {
-        
((HibernateConnectionSource)datastore.connectionSources.getConnectionSource(connectionName)).dataSource
-    }
-
-    @Override
-    Class<?> getObjectType() {
-        DataSource
-    }
-
-    @Override
-    boolean isSingleton() {
-        true
-    }
-}

Reply via email to