diff --git a/documentation/build.gradle b/documentation/build.gradle index 8a159e32b..df2defc2e 100644 --- a/documentation/build.gradle +++ b/documentation/build.gradle @@ -85,10 +85,10 @@ def aggregateJavadocsTask = tasks.register( 'aggregateJavadocs', Javadoc ) { def ormMinorVersion = matcher.find() ? matcher.group() : "5.6"; links = [ - 'https://docs.oracle.com/en/java/javase/11/docs/api/', - 'http://docs.jboss.org/hibernate/beanvalidation/spec/2.0/api/', - 'https://jakarta.ee/specifications/platform/8/apidocs/', - "https://docs.jboss.org/hibernate/orm/" + ormMinorVersion + "/javadocs/" + 'https://docs.oracle.com/en/java/javase/17/docs/api/', + 'https://jakarta.ee/specifications/bean-validation/3.1/apidocs/', + 'https://jakarta.ee/specifications/platform/11/apidocs/', + "https://docs.hibernate.org/orm/" + ormMinorVersion + "/javadocs/" ] options.addStringOption( 'Xdoclint:none', '-quiet' ) @@ -141,6 +141,14 @@ def renderReferenceDocumentationTask = tasks.register( "renderReferenceDocumenta def asciidocReference = layout.projectDirectory.dir("src/main/asciidoc/reference") def unpackedThemeAsciidoc = rootProject.layout.buildDirectory.dir("unpacked-theme/hibernate-asciidoctor-theme/asciidoc") def docInfoHibernate = rootProject.layout.buildDirectory.dir("unpacked-theme/hibernate-asciidoctor-theme/asciidoc/docinfo/hibernate") + def ormMinorVersion = libs.versions.hibernateOrmVersion.map { v -> + def matcher = v =~ /\d+\.\d+/ + if (matcher.find()) { + return matcher.group() + } else { + throw new IllegalArgumentException("Cannot parse the version of Hibernate ORM from '" + v + "' string.") + } + } asciidoctorj { version = "3.0.0" @@ -170,6 +178,7 @@ def renderReferenceDocumentationTask = tasks.register( "renderReferenceDocumenta "source-highlighter": "rouge", majorMinorVersion: versionFamily.get(), fullVersion: fullVersion.get(), + ormMinorVersion: ormMinorVersion.get(), stylesdir: "css", "iconfont-remote": false, "iconfont-name": "font-awesome/css/solid", diff --git a/documentation/src/main/asciidoc/reference/introduction.adoc b/documentation/src/main/asciidoc/reference/introduction.adoc index ee5090c21..621f911b2 100644 --- a/documentation/src/main/asciidoc/reference/introduction.adoc +++ b/documentation/src/main/asciidoc/reference/introduction.adoc @@ -24,8 +24,8 @@ implementation of JPA. If you've never used JPA before, that's OK, but you might need to refer to the following sources of information at some points in this text: -- the http://hibernate.org/orm/documentation/5.6/[documentation for Hibernate ORM], -- the https://jcp.org/aboutJava/communityprocess/mrel/jsr338/index.html[JPA 2.2 specification], or +- the http://hibernate.org/orm/documentation/{ormMinorVersion}/[documentation for Hibernate ORM], +- the https://jakarta.ee/specifications/persistence/3.2/jakarta-persistence-spec-3.2[Jakarta Persistence 3.2 specification], or - https://www.manning.com/books/java-persistence-with-hibernate-second-edition[Java Persistence with Hibernate], the latest edition of the book originally titled _Hibernate in Action_. @@ -77,7 +77,7 @@ You don't need to depend on the JDBC driver for your database. === Optional dependencies :slf4j: http://www.slf4j.org/ -:enhancer: https://docs.jboss.org/hibernate/orm/5.4/topical/html_single/bytecode/BytecodeEnhancement.html +:enhancer: https://docs.hibernate.org/orm/{ormMinorVersion}/topical/html_single/bytecode/ Optionally, you might also add any of the following additional features: @@ -103,7 +103,7 @@ There's an example {build}[Gradle build] included in the example program. === Basic configuration :xml: https://github.com/hibernate/hibernate-reactive/blob/main/examples/session-example/src/main/resources/META-INF/persistence.xml -:configuration-properties: https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html#configurations +:configuration-properties: https://docs.hibernate.org/orm/{ormMinorVersion}/userguide/html_single/#configurations Hibernate Reactive is configured via the standard JPA `persistence.xml` @@ -333,8 +333,8 @@ of framework code. === Mapping entity classes -:mapping-annotations: https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html#annotations -:bean-validation: https://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/#chapter-bean-constraints +:mapping-annotations: https://docs.hibernate.org/orm/{ormMinorVersion}/userguide/html_single/#annotations +:bean-validation: https://docs.hibernate.org/stable/validator/reference/en-US/html_single/#chapter-bean-constraints We won't have much to say about the entity classes here, simply because the principles behind mapping entity classes in Hibernate Reactive, @@ -578,8 +578,8 @@ custom reactive identifier generator. === JSON Mapping -:orm-json-basic-mapping: https://docs.jboss.org/hibernate/orm/7.0/userguide/html_single/Hibernate_User_Guide.html#basic-mapping-json -:orm-json-embeddable-mapping: https://docs.jboss.org/hibernate/orm/7.0/userguide/html_single/Hibernate_User_Guide.html#_jsonxml_aggregate_embeddable_mapping +:orm-json-basic-mapping: https://docs.hibernate.org/orm/{ormMinorVersion}/userguide/html_single/#basic-mapping-json +:orm-json-embeddable-mapping: https://docs.hibernate.org/orm/{ormMinorVersion}/userguide/html_single/#_jsonxml_aggregate_embeddable_mapping :string-to-json-converter: https://github.com/hibernate/hibernate-reactive/blob/main/hibernate-reactive-core/src/test/java/org/hibernate/reactive/types/StringToJsonConverter.java Like in Hibernate ORM, it's possible to map a JSON field using the {orm-json-basic-mapping}[SqlTypes.JSON] @@ -1306,7 +1306,7 @@ or `delete` queries, or even native SQL that calls a stored procedure! === Association fetching -:association-fetching: https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html#fetching +:association-fetching: https://docs.hibernate.org/orm/{ormMinorVersion}/userguide/html_single/#fetching Achieving high performance in ORM means minimizing the number of round trips to the database. This goal should be uppermost in your mind @@ -1368,7 +1368,7 @@ You can find much more information about association fetching in the === Enabling the second-level cache -:second-level-cache: https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html#caching +:second-level-cache: https://docs.hibernate.org/orm/{ormMinorVersion}/userguide/html_single/#caching A classic way to reduce the number of accesses to the database is to use a second-level cache, allowing cached data to be shared between diff --git a/settings.gradle b/settings.gradle index 45595f2a1..fcde27294 100644 --- a/settings.gradle +++ b/settings.gradle @@ -13,6 +13,7 @@ pluginManagement { rootProject.name = 'hibernate-reactive' +// When updating the baseline, make sure to update the JDK version in the javadoc link gradle.ext.baselineJavaVersion = JavaLanguageVersion.of( 17 ) // Gradle does bytecode transformation on tests.