borinquenkid commented on code in PR #15568:
URL: https://github.com/apache/grails-core/pull/15568#discussion_r3454027763


##########
grails-data-hibernate7/grails-plugin/src/main/groovy/grails/test/hibernate/HibernateSpec.groovy:
##########
@@ -108,8 +214,43 @@ abstract class HibernateSpec extends Specification {
     /**
      * @return The configuration
      */
-    Map getConfiguration() {
-        Collections.singletonMap(Settings.SETTING_DB_CREATE, 'create-drop')
+    Map<String,Object> getConfiguration() {
+        [
+            (Settings.SETTING_DB_CREATE): 'create-drop',
+            'hibernate.proxy_factory_class': 
'org.grails.orm.hibernate.proxy.ByteBuddyGroovyProxyFactory',
+            'hibernate.dialect': 'org.hibernate.dialect.H2Dialect',
+            'jakarta.persistence.validation.mode': 'none'
+        ] as Map<String, Object>
+    }
+
+    @CompileStatic(TypeCheckingMode.SKIP)

Review Comment:
   Two separate usages: `setupSpec()` uses the Grails Spring bean definition 
DSL (`dataSource(...) { }`, `hibernateBytecodeProvider(...)`) where bean names 
are resolved as dynamic method calls — `@CompileStatic` can't type-check that. 
`getCollector()` chains through Hibernate internal types via 
`getParentServiceRegistry()` and untyped `getBean()` calls — same issue. Both 
are genuinely dynamic and can't be statically compiled.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to