[hibernate/hibernate-orm] fd5bbf: HHH-15125 - Add ANTLR-based SQL formatter implemen...
by Jan Schatteman
Branch: refs/heads/main
Home: https://github.com/hibernate/hibernate-orm
Commit: fd5bbf5d419200e1815a8c35a2085b82ad40ae3a
https://github.com/hibernate/hibernate-orm/commit/fd5bbf5d419200e1815a8c3...
Author: Jan Schatteman <jrenaat(a)users.noreply.github.com>
Date: 2026-08-24 (Mon, 24 Aug 2026)
Changed paths:
A design/working/sql_formatting_constraints.adoc
M hibernate-core/hibernate-core.gradle
A hibernate-core/src/main/antlr/org/hibernate/grammars/sql/SqlFormatterLexer.g4
A hibernate-core/src/main/antlr/org/hibernate/grammars/sql/SqlFormatterParser.g4
A hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/AntlrBasedSQLFormatterImpl.java
M hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/FormatStyle.java
A hibernate-core/src/test/java/org/hibernate/orm/test/jdbc/util/AntlrBasedSQLFormatterTest.java
M hibernate-core/src/test/java/org/hibernate/orm/test/jdbc/util/BasicFormatterTest.java
A hibernate-core/src/test/resources/org/hibernate/orm/test/jdbc/util/dml_sql_fixtures.txt
M local-build-plugins/src/main/java/org/hibernate/orm/antlr/AntlrPlugin.java
Log Message:
-----------
HHH-15125 - Add ANTLR-based SQL formatter implementation (#12376)
* HHH-15125 - Add ANTLR-based SQL formatter implementation
Implement TokenBasedFormatterImpl as an improved SQL formatter using
ANTLR for tokenization.
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
* HHH-15125 - Reimplemented the TokenBasedFormatterTest
Extracted the SQL Strings into a text file, which is much more readable than having them sitting in the test class itself, with text blocks and line breaks and tab characters and everything, which is cumbersome to edit and read
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
* HHH-15125 - Add more SQL keywords and fixtures to cover insert/update statements'and the necessary implementation changes to make them all pass
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
* HHH-15125 - Added some more keywords, fixtures and implementation related to delete/truncate statements
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
* HHH-15125 - Sql formatter code cleanup and refactoring
Also, switch from tabs (\t) to spaces for indenting
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
* HHH-15125 - Some additional corrections plus a new test
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
* HHH-15125 - Get rid of another SonarQube warning, and add a few more missing keywords
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
* HHH-15125 - Revert uppercasing of keywords, functions, boolean literals, etc. because Hibernate hasn't use this style for a long time
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
* HHH-15125 - Allow ignoring fixtures by commenting out (with '--') their ID
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
* HHH-15125 - Some refactoring and improvements following in-depth analysis by Christian
Added some new tests as a result
Corrected a few errors
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
* HHH-15125 - Introduce contexts for top-level select, insert, update, delete and merge statements
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
* HHH-15125 - Add support for window functions
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
* HHH-15125 - Reorder keywords in sql lexer grammar alphabetically
Update the constraints doc
Added another test for window syntaxis
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
* HHH-15125 - Various fixes
- Allowed for comments to be included in the test fixtures file
- Added a couple of new keywords
- Fixed ORDER BY and GROUP BY multiline detection when the clause is the
last one in a query (i.e. not followed by OFFSET/FETCH/LIMIT or
HAVING/ORDER): SEMICOLON was missing from the terminator lists used by
shouldListBeMultiline(), causing the fallback commaCount > 3 check to
return false for exactly 4 items (3 commas).
- Added test fixtures order_by_multiline and group_by_multiline to cover
this case.
- Added test fixtures for postgresql's over (partition by) clause
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
* HHH-15125 - Set the AntlrBasedSQLFormatterImpl as the default formatter
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
---------
Signed-off-by: Jan Schatteman <jschatte(a)redhat.com>
To unsubscribe from these emails, change your notification settings at https://github.com/hibernate/hibernate-orm/settings/notifications
4 days, 21 hours
[hibernate/hibernate-orm] 23753a: Bump dataTckArquillian from 1.9.2.Final to 1.10.2....
by dependabot[bot]
Branch: refs/heads/main
Home: https://github.com/hibernate/hibernate-orm
Commit: 23753ac3e890fe3ea75688151cbb02587e580c9b
https://github.com/hibernate/hibernate-orm/commit/23753ac3e890fe3ea756881...
Author: dependabot[bot] <49699333+dependabot[bot](a)users.noreply.github.com>
Date: 2026-08-24 (Mon, 24 Aug 2026)
Changed paths:
M gradle/libs.versions.toml
Log Message:
-----------
Bump dataTckArquillian from 1.9.2.Final to 1.10.2.Final
Bumps `dataTckArquillian` from 1.9.2.Final to 1.10.2.Final.
Updates `org.jboss.arquillian.junit5:arquillian-junit5-core` from 1.9.2.Final to 1.10.2.Final
Updates `org.jboss.arquillian.container:arquillian-container-test-api` from 1.9.2.Final to 1.10.2.Final
---
updated-dependencies:
- dependency-name: org.jboss.arquillian.junit5:arquillian-junit5-core
dependency-version: 1.10.2.Final
dependency-type: direct:production
update-type: version-update:semver-minor
- dependency-name: org.jboss.arquillian.container:arquillian-container-test-api
dependency-version: 1.10.2.Final
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support(a)github.com>
To unsubscribe from these emails, change your notification settings at https://github.com/hibernate/hibernate-orm/settings/notifications
5 days, 7 hours
[hibernate/hibernate-orm] f973fb: Bump dataTckArquillian from 1.9.2.Final to 1.10.2....
by dependabot[bot]
Branch: refs/heads/dependabot/gradle/dataTckArquillian-1.10.2.Final
Home: https://github.com/hibernate/hibernate-orm
Commit: f973fbba791c527509e37cbd4ff1ef1fdc3574e5
https://github.com/hibernate/hibernate-orm/commit/f973fbba791c527509e37cb...
Author: dependabot[bot] <49699333+dependabot[bot](a)users.noreply.github.com>
Date: 2026-08-24 (Mon, 24 Aug 2026)
Changed paths:
M gradle/libs.versions.toml
Log Message:
-----------
Bump dataTckArquillian from 1.9.2.Final to 1.10.2.Final
Bumps `dataTckArquillian` from 1.9.2.Final to 1.10.2.Final.
Updates `org.jboss.arquillian.junit5:arquillian-junit5-core` from 1.9.2.Final to 1.10.2.Final
Updates `org.jboss.arquillian.container:arquillian-container-test-api` from 1.9.2.Final to 1.10.2.Final
---
updated-dependencies:
- dependency-name: org.jboss.arquillian.junit5:arquillian-junit5-core
dependency-version: 1.10.2.Final
dependency-type: direct:production
update-type: version-update:semver-minor
- dependency-name: org.jboss.arquillian.container:arquillian-container-test-api
dependency-version: 1.10.2.Final
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support(a)github.com>
To unsubscribe from these emails, change your notification settings at https://github.com/hibernate/hibernate-orm/settings/notifications
5 days, 8 hours