You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by bo...@apache.org on 2026/10/11 02:47:11 UTC
(grails-core) branch 9.0.x-remove-h5 updated: test(graphql): allow Byte[] and Character[] properties on Hibernate 7
This is an automated email from the ASF dual-hosted git repository.
borinquenkid pushed a commit to branch 9.0.x-remove-h5
in repository https://gitbox.apache.org/repos/asf/grails-core.git
The following commit(s) were added to refs/heads/9.0.x-remove-h5 by this push:
new 8f8deb571d test(graphql): allow Byte[] and Character[] properties on Hibernate 7
8f8deb571d is described below
commit 8f8deb571dd01390185d8e54cd3741032701aa19
Author: Walter Duque de Estrada <wb...@mac.com>
AuthorDate: Sat Oct 10 21:44:35 2026 -0500
test(graphql): allow Byte[] and Character[] properties on Hibernate 7
The GraphQL test domains map Byte[] and Character[] properties. Hibernate 5 treated
them like byte[] and char[]; Hibernate 7 rejects the wrapper arrays unless
hibernate.type.wrapper_array_handling is allow, which failed the session factory of
the GraphQL specs and of the grails-test-app functional app now that they run on
Hibernate 7.
Co-Authored-By: Claude Sonnet 5.5 <no...@anthropic.com>
---
.../core/src/test/groovy/org/grails/gorm/graphql/HibernateSpec.groovy | 4 +++-
.../core/src/test/groovy/org/grails/gorm/graphql/SchemaSpec.groovy | 4 +++-
.../gorm/graphql/types/output/AbstractObjectTypeBuilderSpec.groovy | 4 +++-
.../graphql/grails-test-app/grails-app/conf/application.yml | 3 +++
4 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/grails-data-graphql/core/src/test/groovy/org/grails/gorm/graphql/HibernateSpec.groovy b/grails-data-graphql/core/src/test/groovy/org/grails/gorm/graphql/HibernateSpec.groovy
index 7bd1583834..052adeb602 100644
--- a/grails-data-graphql/core/src/test/groovy/org/grails/gorm/graphql/HibernateSpec.groovy
+++ b/grails-data-graphql/core/src/test/groovy/org/grails/gorm/graphql/HibernateSpec.groovy
@@ -52,7 +52,9 @@ abstract class HibernateSpec extends Specification {
* @return The configuration
*/
Map<String, Object> getConfiguration() {
- [(Settings.SETTING_DB_CREATE): 'create-drop', (Settings.SETTING_DATASOURCE + '.logSql'): true] as Map<String, Object>
+ [(Settings.SETTING_DB_CREATE): 'create-drop', (Settings.SETTING_DATASOURCE + '.logSql'): true,
+ // The test domains map Byte[] and Character[] properties; Hibernate 7 rejects those wrapper arrays unless allowed
+ 'hibernate.type.wrapper_array_handling': 'allow'] as Map<String, Object>
}
/**
diff --git a/grails-data-graphql/core/src/test/groovy/org/grails/gorm/graphql/SchemaSpec.groovy b/grails-data-graphql/core/src/test/groovy/org/grails/gorm/graphql/SchemaSpec.groovy
index 27d0543bb1..8b911fc348 100644
--- a/grails-data-graphql/core/src/test/groovy/org/grails/gorm/graphql/SchemaSpec.groovy
+++ b/grails-data-graphql/core/src/test/groovy/org/grails/gorm/graphql/SchemaSpec.groovy
@@ -43,7 +43,9 @@ class SchemaSpec extends Specification implements GraphQLSchemaSpec {
void setupSpec() {
hibernateDatastore = new HibernateDatastore(
- DatastoreUtils.createPropertyResolver(Collections.singletonMap(Settings.SETTING_DB_CREATE, 'create-drop')),
+ DatastoreUtils.createPropertyResolver([(Settings.SETTING_DB_CREATE): 'create-drop',
+ // Hibernate 7 rejects Byte[]/Character[] properties unless wrapper arrays are allowed
+ 'hibernate.type.wrapper_array_handling': 'allow']),
GeneralPackage.getPackage(), HibernatePackage.getPackage())
schema = new Schema(hibernateDatastore.mappingContext).generate()
queryType = schema.queryType
diff --git a/grails-data-graphql/core/src/test/groovy/org/grails/gorm/graphql/types/output/AbstractObjectTypeBuilderSpec.groovy b/grails-data-graphql/core/src/test/groovy/org/grails/gorm/graphql/types/output/AbstractObjectTypeBuilderSpec.groovy
index 22915d812c..564cb6b114 100644
--- a/grails-data-graphql/core/src/test/groovy/org/grails/gorm/graphql/types/output/AbstractObjectTypeBuilderSpec.groovy
+++ b/grails-data-graphql/core/src/test/groovy/org/grails/gorm/graphql/types/output/AbstractObjectTypeBuilderSpec.groovy
@@ -40,7 +40,9 @@ class AbstractObjectTypeBuilderSpec extends Specification {
void setupSpec() {
hibernateDatastore = new HibernateDatastore(
- DatastoreUtils.createPropertyResolver(Collections.singletonMap(Settings.SETTING_DB_CREATE, 'create-drop')),
+ DatastoreUtils.createPropertyResolver([(Settings.SETTING_DB_CREATE): 'create-drop',
+ // Hibernate 7 rejects Byte[]/Character[] properties unless wrapper arrays are allowed
+ 'hibernate.type.wrapper_array_handling': 'allow']),
InheritancePackage.getPackage())
schema = new Schema(hibernateDatastore.mappingContext).generate()
}
diff --git a/grails-test-examples/graphql/grails-test-app/grails-app/conf/application.yml b/grails-test-examples/graphql/grails-test-app/grails-app/conf/application.yml
index 56d87fe00c..2b9c5f8966 100644
--- a/grails-test-examples/graphql/grails-test-app/grails-app/conf/application.yml
+++ b/grails-test-examples/graphql/grails-test-app/grails-app/conf/application.yml
@@ -83,6 +83,9 @@ grails:
---
hibernate:
+ type:
+ # TypeTest maps Byte[] and Character[] properties, which Hibernate 7 rejects unless wrapper arrays are allowed
+ wrapper_array_handling: allow
cache:
queries: false
use_second_level_cache: false