Open
Conversation
…classes The Spotless Apply commit reformatted these Java files using Google Java Format (2-space indentation), which violated the project's Checkstyle rules that require 4-space indentation. Restore the 5 affected files to 4-space indentation and fix the off-by-one space in HibernatePersistenceContextInterceptor.java line 107. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- gradle/code-style-config.gradle:
- Remove Checkstyle plugin/config; add Spotless (palantirJavaFormat,
4-space indent) with import ordering matching the former Checkstyle
ImportOrderCheck groups (java|javax → groovy → jakarta → other →
spring → grails → static last), removeUnusedImports,
trimTrailingWhitespace, endWithNewline
- Add PMD plugin globally alongside CodeNarc; backed by a new
etc/config/pmd/pmd.xml ruleset (bestpractices, errorprone, security)
- codeStyle task now runs: Spotless check + CodeNarc + PMD
- gradle.properties:
- Replace checkstyleVersion with pmdVersion=6.55.0
- etc/config/pmd/pmd.xml:
- New PMD ruleset (category/java/bestpractices, errorprone, security)
- grails-data-hibernate7/core/build.gradle:
- Remove local pmd and spotless plugin declarations/config (now
handled globally via code-style-config.gradle)
- Apply code-style-config.gradle; keep SpotBugs local config
Note: run ./gradlew spotlessApply to reformat existing Java sources to
palantirJavaFormat before next code style check.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…publish Grails BOM variants
# Conflicts: # .github/workflows/codestyle.yml # gradle/docs-dependencies.gradle # grails-data-hibernate5/core/src/test/groovy/grails/gorm/specs/BasicCollectionInQuerySpec.groovy # grails-data-hibernate5/core/src/test/groovy/grails/gorm/specs/DetachedCriteriaJoinSpec.groovy # grails-data-hibernate5/core/src/test/groovy/grails/gorm/specs/DetachedCriteriaProjectionNullAssociationSpec.groovy # grails-data-hibernate5/core/src/test/groovy/grails/gorm/specs/WhereQueryBugFixSpec.groovy # grails-data-hibernate5/core/src/test/groovy/grails/gorm/specs/WhereQueryOldIssueVerificationSpec.groovy # grails-data-hibernate5/dbmigration/build.gradle # grails-datamapping-core/src/main/groovy/grails/gorm/DetachedCriteria.groovy # grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/finders/CountByFinder.java
…ked as pending since GORM core is not for production
I fixed two major initialization errors in HibernateDatastore.java that were breaking the multi-datasource TCK tests:
* Broken Infinite Recursion: Introduced a private isChild flag and constructor to prevent child datastores from recursively iterating through connection sources. This resolved the StackOverflowError
during multi-datasource setup.
* Fixed ClassCastException: Updated the bytecodeProvider initialization to safely handle cases where the factory is not a HibernateConnectionSourceFactory (common in child datastores using
SingletonConnectionSources).
* Verification: Ran CrossLayerMultiDataSourceSpec, and all 5 tests passed.
### 1. Spring ORM Fork for Hibernate 7 Since Spring 7 removed the `org.springframework.orm.hibernate5` package and its `javax.*` support, we have forked the necessary Spring ORM classes into: `org.grails.orm.hibernate.support.hibernate7` These classes have been migrated to: - **Jakarta Namespace**: All `javax.persistence`, `javax.transaction`, and `javax.servlet` imports have been replaced with their `jakarta.*` equivalents. - **Hibernate 7 API**: Updated to accommodate the removal of legacy APIs (e.g., `Criteria`, `DetachedCriteria`, `Session.load`).
…ar alignment. Implement ChildHibernateDatastore for isolated session routing, resolve bootstrapping circular dependencies, and update auto-configuration imports for Boot 4 compatibility. Includes verified unit tests for the new datastore architecture.
…eporting across all 60+ modules, including CodeNarc, PMD, SpotBugs, and Checkstyle.
Key Changes:
1. Consolidated XML Reporting: All tools now generate unique XML reports in build/reports/codestyle/ at the root project level.
2. Aggregate Task: Added a root project task aggregateStyleViolations that parses these XML reports and generates a unified Markdown summary.
3. Test Filtering:
* Linting for tests is disabled by default (can be toggled via grails.codestyle.enabled.tests).
jdaugherty
commented
Mar 30, 2026
Contributor
Author
jdaugherty
left a comment
There was a problem hiding this comment.
I have not fully reviewed this code, but I saw some changes that I wanted to seek clarification right away. Can you please take a look at the build / license comments?
...ta-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/proxy/HibernateProxyHandler.java
Outdated
Show resolved
Hide resolved
- Revert Liquibase Hibernate 7 versions to 4.27.0 for stability. - Add no-arg constructor to GormDatabase for Liquibase service discovery. - Fix JdbcConnection casting in HibernateDatabase. - Update sequence support detection in MissingSequenceChangeGenerator. - Replace removed StringUtil.randomIdentifier in UniqueConstraintSnapshotGenerator. - Update migration specs to support INT and INTEGER type names. - Fix dependency conflicts and JDK 17 compatibility for Derby. - Update SBOM license mapping for liquibase-core.
- Rename Liquibase extension classes with 'Hibernate' prefix to avoid shadowing superclass simple names (fixes NM_SAME_SIMPLE_NAME_AS_SUPERCLASS). - Update service registration files and test sources to reflect class renames. - Fix NP_NONNULL_RETURN_VIOLATION in HibernateConnection by throwing SQLFeatureNotSupportedException instead of returning null. - Fix DM_DEFAULT_ENCODING by specifying UTF-8/StandardCharsets.UTF_8 in multiple files. - Fix potential NP_NULL_ON_SOME_PATH in DatabaseMigrationCommand.groovy with explicit null checks.
This comment has been minimized.
This comment has been minimized.
✅ All tests passed ✅🏷️ Commit: e8ee4ba Learn more about TestLens at testlens.app. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I accidentally pushed to 8.0.x-hibernate7 instead of 8.0.x-hibernate7-bom. This caused #15510 to close as a result.
From that PR's todos:
Current Progress:
TODO:
I am opening this PR to track the status of Hibernate 7 merge to 8.x.
Some notes from previous meetings on the Hibernate 7 Upgrade: