Skip to content

Commit ef968dc

Browse files
committed
Mention third-party dialects throughout the documentation
1 parent c2adaaf commit ef968dc

File tree

5 files changed

+64
-8
lines changed

5 files changed

+64
-8
lines changed

dialects.adoc

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A dialect is a class that provides information about the specifics of a database
44

55
== Supported dialects
66

7-
Hibernate supports a wide range of dialects out of the box. The following is list of officially supported databases:
7+
Hibernate supports a wide range of dialects out of the box:
88

99
* Apache Derby
1010
* Cockroach
@@ -29,6 +29,23 @@ but the support for these versions is not guaranteed.
2929

3030
Apart from the Hibernate team supported dialects, there are also community dialects.
3131

32+
== Third-party dialects
33+
34+
Third-parties publish additional dialects for Hibernate ORM, providing their own support for more databases, or extended support beyond what is built in Hibernate ORM:
35+
36+
* MongoDB: https://github.com/mongodb/mongo-hibernate/[MongoDB extension for Hibernate ORM]
37+
* Google Spanner: https://github.com/GoogleCloudPlatform/google-cloud-spanner-hibernate[Google Cloud Spanner Dialect for Hibernate ORM]
38+
39+
[NOTE]
40+
====
41+
Third-party dialects are tested by their own authors,
42+
and may not be compatible with all versions of Hibernate ORM.
43+
44+
1. Check the dialect's own documentation to know more about its compatibility constraints.
45+
The https://hibernate.org/orm/releases/#compatibility-matrix[compatibility matrix on the Hibernate website] may also be of help.
46+
2. Submit any question or bug reports about these dialects to the dialect's authors: the Hibernate team cannot help.
47+
====
48+
3249
== Community dialects
3350

3451
As of Hibernate 6.0, the Hibernate team decided to provide a clear way forward for community contributed dialects.

documentation/src/main/asciidoc/introduction/Configuration.adoc

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ driver for your database.
6868
| SQL Server | `com.microsoft.sqlserver:mssql-jdbc:${version}`
6969
| Oracle | `com.oracle.database.jdbc:ojdbc11:${version}`
7070
| H2 | `com.h2database:h2:{version}`
71-
| HSQLDB | `org.hsqldb:hsqldb:{version}`
71+
| MongoDB | The JDBC driver is bundled with the dialect mentioned in <<optional-dependencies>>
72+
| Google Spanner | `com.google.cloud:google-cloud-spanner-jdbc:{version}`
7273
|===
7374

74-
Where `{version}` is the latest version of the JDBC driver for your databse.
75+
Where `{version}` is the latest version of the JDBC driver for your database.
7576

7677
[[optional-dependencies]]
7778
=== Optional dependencies
@@ -118,6 +119,15 @@ and `com.github.ben-manes.caffeine:jcache`
118119
or `org.eclipse:yasson`
119120
| <<spatial,Hibernate Spatial>> | `org.hibernate.orm:hibernate-spatial`
120121
| <<envers,Envers>>, for auditing historical data | `org.hibernate.orm:hibernate-envers`
122+
| Community dialects | `org.hibernate.orm:hibernate-community-dialects`
123+
| Third-party dialects
124+
// TODO link to the /dialects/ documentation explaining what third-party dialects are?
125+
|
126+
https://github.com/mongodb/mongo-hibernate/[MongoDB]: `org.mongodb:mongodb-hibernate:{version}`
127+
128+
https://github.com/GoogleCloudPlatform/google-cloud-spanner-hibernate[Google Spanner]: `com.google.cloud:google-cloud-spanner-hibernate-dialect:{version}`
129+
130+
Where `{version}` is the version of the third-party dialect compatible with the version of Hibernate ORM you are using. See the dialect's own documentation for more information. The https://hibernate.org/orm/releases/#compatibility-matrix[compatibility matrix on the Hibernate website] may also be of help.
121131
|===
122132

123133
You might also add the Hibernate {enhancer}[bytecode enhancer] to your
@@ -289,9 +299,10 @@ The properties you really do need to get started are these three:
289299
[IMPORTANT]
290300
// .You don't need `hibernate.dialect` anymore!
291301
====
292-
In Hibernate 6, you don't need to specify `hibernate.dialect`.
302+
Starting with Hibernate 6, you don't need to specify `hibernate.dialect`.
293303
The correct Hibernate SQL `Dialect` will be determined for you automatically.
294-
The only reason to specify this property is if you're using a custom user-written `Dialect` class.
304+
// TODO link to the /dialects/ documentation explaining what community and third-party dialects are?
305+
The only reason to specify this property is if you're using a custom user-written or third-party `Dialect` class.
295306
296307
Similarly, neither `hibernate.connection.driver_class` nor `jakarta.persistence.jdbc.driver` is needed when working with one of the supported databases.
297308
====

documentation/src/main/asciidoc/quickstart/guides/obtaining.adoc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ transitive dependencies based on the features being used or not.
5858
|hibernate-jcache| Integration with https://jcp.org/en/jsr/detail?id=107$$[JCache], allowing any compliant implementation as a second-level cache provider
5959
|hibernate-graalvm| Experimental extension to make it easier to compile applications as a https://www.graalvm.org/[GraalVM] native image
6060
|hibernate-micrometer| Integration with https://micrometer.io[Micrometer] metrics
61+
// TODO link to the /dialects/ documentation explaining what community dialects are?
6162
|hibernate-community-dialects| Additional community-supported SQL dialects
6263
|===
6364

@@ -67,6 +68,26 @@ transitive dependencies based on the features being used or not.
6768
|hibernate-testing| A series of JUnit extensions for testing Hibernate ORM functionality
6869
|===
6970

71+
[cols="40m,~"]
72+
.Third-party modules
73+
|===
74+
// Yes, this is a full row containing asciidoc containing an admonition. I don't know have a better idea to add an admonition between a table's title and its content.
75+
2+a|
76+
[NOTE]
77+
====
78+
Third-party modules are tested by their own authors,
79+
and may not be compatible with all versions of Hibernate ORM.
80+
81+
1. Check the module's own documentation to know more about its compatibility constraints.
82+
The https://hibernate.org/orm/releases/#compatibility-matrix[compatibility matrix on the Hibernate website] may also be of help.
83+
2. Submit any question or bug reports about these dialects to the dialect's authors: the Hibernate team cannot help.
84+
85+
// TODO link to the /dialects/ documentation explaining what third-party dialects are?
86+
====
87+
|`org.mongodb:mongodb-hibernate:{version}`| https://github.com/mongodb/mongo-hibernate/[MongoDB Extension for Hibernate ORM]
88+
|`com.google.cloud:google-cloud-spanner-hibernate-dialect:{version}`| https://github.com/GoogleCloudPlatform/google-cloud-spanner-hibernate[Google Cloud Spanner Dialect for Hibernate ORM]
89+
|===
90+
7091
[[platform]]
7192
=== Platform / BOM
7293

documentation/src/main/asciidoc/userguide/chapters/jdbc/Database_Access.adoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,5 +292,8 @@ Hibernate abstracts over variations between dialects of SQL via the class `org.h
292292
- There's a subclass of `Dialect` for each supported relational database in the package `org.hibernate.dialect`.
293293
- Additional community-supported ``Dialect``s are available in the separate module `hibernate-community-dialects`.
294294

295-
In Hibernate 6, it's no longer necessary to explicitly specify a dialect using the configuration property `hibernate.dialect`, and so setting that property is now discouraged.
296-
(An exception is the case of custom user-written ``Dialect``s.)
295+
Starting with Hibernate 6, it's no longer necessary to explicitly specify a dialect using the configuration property `hibernate.dialect`, and so setting that property is now discouraged.
296+
(An exception is the case of custom user-written ``Dialect``s.)
297+
298+
// TODO link to the /dialects/ documentation
299+
// NOTE: For information about available dialects and compatible database versions, see << .... >>.

documentation/src/main/asciidoc/userguide/chapters/portability/Portability.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ Regardless of the exact scenario, the basic idea is that you want Hibernate to h
1414

1515
The first line of portability for Hibernate is the dialect, which is a specialization of the `org.hibernate.dialect.Dialect` contract.
1616
A dialect encapsulates all the differences in how Hibernate must communicate with a particular database to accomplish some task like getting a sequence value or structuring a SELECT query.
17+
// TODO link to the /dialects/ documentation
1718
Hibernate bundles a wide range of dialects for many of the most popular databases.
18-
If you find that your particular database is not among them, it is not terribly difficult to write your own.
19+
If you find that your particular database is not among them,
20+
// TODO link to the /dialects/ documentation, "third-party" section
21+
you can check dialects implemented by third parties,
22+
and as a last resort it is not terribly difficult to write your own.
1923

2024
[[portability-dialectresolver]]
2125
=== Dialect resolution

0 commit comments

Comments
 (0)