Skip to content

Commit

Permalink
Fix outdated Hibernate documentation URLs and use a common Asciidoc a…
Browse files Browse the repository at this point in the history
…ttribute
  • Loading branch information
yrodiere committed Jun 26, 2023
1 parent 1aff47a commit 8432292
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 41 deletions.
5 changes: 4 additions & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,14 @@
<commons-lang3.version>3.12.0</commons-lang3.version>
<commons-codec.version>1.16.0</commons-codec.version>
<classmate.version>1.5.1</classmate.version>
<hibernate-orm.version>6.2.5.Final</hibernate-orm.version> <!-- When updating, align bytebuddy.version to Hibernate needs as well (just below): -->
<!-- When updating, align bytebuddy.version to Hibernate needs as well (just below),
as well as hibernate-orm.version-for-documentation in docs/pom.xml -->
<hibernate-orm.version>6.2.5.Final</hibernate-orm.version>
<bytebuddy.version>1.12.18</bytebuddy.version> <!-- Version controlled by Hibernate ORM's needs -->
<hibernate-commons-annotations.version>6.0.6.Final</hibernate-commons-annotations.version> <!-- version controlled by Hibernate ORM -->
<hibernate-reactive.version>2.0.1.Final</hibernate-reactive.version>
<hibernate-validator.version>8.0.1.Final</hibernate-validator.version>
<!-- When updating, align hibernate-search.version-for-documentation in docs/pom.xml -->
<hibernate-search.version>6.2.0.CR1</hibernate-search.version>
<narayana.version>6.0.1.Final</narayana.version>
<agroal.version>2.1</agroal.version>
Expand Down
4 changes: 4 additions & 0 deletions docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
<generated-dir>${project.basedir}/../target/asciidoc/generated</generated-dir>
<code-examples-dir>${generated-dir}/examples</code-examples-dir>
<vale.image>docker.io/jdkato/vale:v2.15.5</vale.image>

<!-- Keep these in sync with the full versions in bom/application/pom.xml -->
<hibernate-orm.version-for-documentation>6.2</hibernate-orm.version-for-documentation>
<hibernate-search.version-for-documentation>6.2</hibernate-search.version-for-documentation>
</properties>

<name>Quarkus - Documentation</name>
Expand Down
5 changes: 5 additions & 0 deletions docs/src/main/asciidoc/_attributes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
:grpc-version: ${grpc.version}
:protoc-version: ${protoc.version}
:gcf-invoker-version: ${gcf-invoker.version}
:hibernate-orm-version: ${hibernate-orm.version-for-documentation}
:hibernate-search-version: ${hibernate-search.version-for-documentation}
// .
:quarkus-home-url: ${quarkus-home-url}
:quarkus-org-url: https://github.com/quarkusio
Expand All @@ -46,6 +48,9 @@
:quickstarts-blob-url: ${quickstarts-base-url}/blob/main
:quickstarts-tree-url: ${quickstarts-base-url}/tree/main
// .
:hibernate-orm-docs-url: https://docs.jboss.org/hibernate/orm/{hibernate-orm-version}/userguide/html_single/Hibernate_User_Guide.html
:hibernate-search-docs-url: https://docs.jboss.org/hibernate/search/{hibernate-search-version}/reference/en-US/html_single/
// .
:amazon-services-guide: https://quarkiverse.github.io/quarkiverse-docs/quarkus-amazon-services/dev/index.html
:config-consul-guide: https://quarkiverse.github.io/quarkiverse-docs/quarkus-config-extensions/dev/consul.html
:hibernate-search-orm-elasticsearch-aws-guide: https://quarkiverse.github.io/quarkiverse-docs/quarkus-hibernate-search-extras/dev/index.html
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/hibernate-orm-panache.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ If your delete query does not start with `delete`, we support the following addi
- `<query>` will expand to `delete from EntityName where <query>`

NOTE: You can also write your queries in plain
link:https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html#hql[HQL]:
link:{hibernate-orm-docs-url}#hql[HQL]:

[source,java]
----
Expand Down Expand Up @@ -869,7 +869,7 @@ You can use it to restrict which fields will be returned by the database.

Hibernate will use **DTO projection** and generate a SELECT clause with the attributes from the projection class.
This is also called **dynamic instantiation** or **constructor expression**, more info can be found on the Hibernate guide:
link:https://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#hql-select-clause[hql select clause]
link:{hibernate-orm-docs-url}#hql-select-clause[hql select clause]

The projection class needs to have a constructor that contains all its attributes, this constructor will be used to
instantiate the projection DTO instead of using the entity class. This class must have a matching constructor with all the class attributes as parameters.
Expand Down
13 changes: 6 additions & 7 deletions docs/src/main/asciidoc/hibernate-orm.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ include::_attributes.adoc[]
:categories: data
:summary: Hibernate ORM is the de facto Jakarta Persistence implementation and offers you the full breath of an Object Relational Mapper. It works beautifully in Quarkus.
:config-file: application.properties
:orm-doc-url-prefix: https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html

Hibernate ORM is the de facto standard Jakarta Persistence (formerly known as JPA) implementation and offers you the full breadth of an Object Relational Mapper.
It works beautifully in Quarkus.
Expand Down Expand Up @@ -173,7 +172,7 @@ so at your application entry point boundaries like your REST endpoint controller
==== Supported databases

For xref:datasource.adoc#default-datasource[supported databases],
the link:{orm-doc-url-prefix}##database-dialect[Hibernate ORM dialect]
the link:{hibernate-orm-docs-url}#database-dialect[Hibernate ORM dialect]
does not need to be set explicitly:
it is selected automatically based on the datasource.

Expand Down Expand Up @@ -215,7 +214,7 @@ If the database cannot be reached, a warning will be logged but startup will pro

If xref:datasource.adoc#other-databases[your database does not have a corresponding Quarkus extension],
or if the defaults do not match your needs for some reason,
you will need to set the link:{orm-doc-url-prefix}##database-dialect[Hibernate ORM dialect] explicitly:
you will need to set the link:{hibernate-orm-docs-url}#database-dialect[Hibernate ORM dialect] explicitly:

[source,properties]
.`{config-file}` with an explicit `dialect`
Expand Down Expand Up @@ -524,7 +523,7 @@ difference is that you would specify your Hibernate ORM configuration in `META-I
----

When using the `persistence.xml` configuration you are configuring Hibernate ORM directly,
so in this case the appropriate reference is the link:{orm-doc-url-prefix}#configurations[documentation on hibernate.org].
so in this case the appropriate reference is the link:{hibernate-orm-docs-url}#configurations[documentation on hibernate.org].

Please remember these are not the same property names as the ones used in the Quarkus `{config-file}`, nor will
the same defaults be applied.
Expand Down Expand Up @@ -914,9 +913,9 @@ Jump over to xref:datasource.adoc[Quarkus - Datasources] for all details.
[[multitenancy]]
== Multitenancy

"The term multitenancy, in general, is applied to software development to indicate an architecture in which a single running instance of an application simultaneously serves multiple clients (tenants). This is highly common in SaaS solutions. Isolating information (data, customizations, etc.) pertaining to the various tenants is a particular challenge in these systems. This includes the data owned by each tenant stored in the database" (link:{orm-doc-url-prefix}#multitenacy[Hibernate User Guide]).
"The term multitenancy, in general, is applied to software development to indicate an architecture in which a single running instance of an application simultaneously serves multiple clients (tenants). This is highly common in SaaS solutions. Isolating information (data, customizations, etc.) pertaining to the various tenants is a particular challenge in these systems. This includes the data owned by each tenant stored in the database" (link:{hibernate-orm-docs-url}#multitenacy[Hibernate User Guide]).

Quarkus currently supports the link:{orm-doc-url-prefix}#multitenacy-separate-database[separate database] approach, the link:{orm-doc-url-prefix}#multitenacy-separate-schema[separate schema] approach and the link:{orm-doc-url-prefix}#multitenacy-discriminator[discriminator] approach.
Quarkus currently supports the link:{hibernate-orm-docs-url}#multitenacy-separate-database[separate database] approach, the link:{hibernate-orm-docs-url}#multitenacy-separate-schema[separate schema] approach and the link:{hibernate-orm-docs-url}#multitenacy-discriminator[discriminator] approach.

To see multitenancy in action, you can check out the {quickstarts-tree-url}/hibernate-orm-multi-tenancy-quickstart[hibernate-orm-multi-tenancy-quickstart] quickstart.

Expand Down Expand Up @@ -1179,7 +1178,7 @@ Your custom connection resolver would allow for example to read tenant informati
[[interceptors]]
== Interceptors

You can assign an link:{orm-doc-url-prefix}#events-interceptors[`org.hibernate.Interceptor`]
You can assign an link:{hibernate-orm-docs-url}#events-interceptors[`org.hibernate.Interceptor`]
to your `SessionFactory` by simply defining a CDI bean with the appropriate qualifier:

[source,java]
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/hibernate-reactive-panache.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ If your delete query does not start with `delete`, we support the following addi
- `<query>` will expand to `delete from EntityName where <query>`

NOTE: You can also write your queries in plain
link:https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html#hql[HQL]:
link:{hibernate-orm-docs-url}#hql[HQL]:

[source,java]
----
Expand Down Expand Up @@ -617,7 +617,7 @@ You can use it to restrict which fields will be returned by the database.

Hibernate will use **DTO projection** and generate a SELECT clause with the attributes from the projection class.
This is also called **dynamic instantiation** or **constructor expression**, more info can be found on the Hibernate guide:
link:https://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#hql-select-clause[hql select clause]
link:{hibernate-orm-docs-url}#hql-select-clause[hql select clause]

The projection class needs to be a valid Java Bean and have a constructor that contains all its attributes, this constructor will be used to
instantiate the projection DTO instead of using the entity class. This must be the only constructor of the class.
Expand Down
22 changes: 10 additions & 12 deletions docs/src/main/asciidoc/hibernate-search-orm-elasticsearch.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ and pull requests should be submitted there:
https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
////
= Hibernate Search guide
:hibernate-search-doc-prefix: https://docs.jboss.org/hibernate/search/6.2/reference/en-US/html_single/
:hibernate-orm-doc-prefix: https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html
include::_attributes.adoc[]
:categories: data
:summary: Hibernate Search allows you to index your entities in an Elasticsearch cluster and easily offer full text search in all your Hibernate ORM-based applications.
Expand Down Expand Up @@ -549,7 +547,7 @@ The Hibernate Search DSL supports a significant subset of the Elasticsearch pred
Feel free to explore the DSL using autocompletion.
When that's not enough, you can always fall back to
link:{hibernate-search-doc-prefix}#search-dsl-predicate-extensions-elasticsearch-from-json[defining a predicate using JSON directly].
link:{hibernate-search-docs-url}#search-dsl-predicate-extensions-elasticsearch-from-json[defining a predicate using JSON directly].
====

== Configuring the application
Expand Down Expand Up @@ -691,7 +689,7 @@ and https://www.opensearch.org/[OpenSearch],
but it assumes it is working with an Elasticsearch cluster by default.

To have Hibernate Search work with an OpenSearch cluster instead,
link:{hibernate-search-doc-prefix}#backend-elasticsearch-configuration-version[prefix the configured version with `opensearch:`],
link:{hibernate-search-docs-url}#backend-elasticsearch-configuration-version[prefix the configured version with `opensearch:`],
as shown below.

[source,properties]
Expand All @@ -702,7 +700,7 @@ quarkus.hibernate-search-orm.elasticsearch.version=opensearch:1.2
All other configuration options and APIs are exactly the same as with Elasticsearch.

You can find more information about compatible distributions and versions of Elasticsearch in
link:{hibernate-search-doc-prefix}#compatibility[this section of Hibernate Search's reference documentation].
link:{hibernate-search-docs-url}#compatibility[this section of Hibernate Search's reference documentation].

[[multiple-persistence-units]]
== Multiple persistence units
Expand Down Expand Up @@ -850,7 +848,7 @@ If you disable automatic schema creation by setting `quarkus.hibernate-search-or
you will have to create the schema manually at some point before your application starts persisting/updating entities
and executing search requests.
See link:{hibernate-search-doc-prefix}#schema-management-manager[this section of the reference documentation]
See link:{hibernate-search-docs-url}#schema-management-manager[this section of the reference documentation]
for more information.
====

Expand All @@ -870,12 +868,12 @@ or as issues in our https://github.com/quarkusio/quarkus/issues[GitHub issue tra

While it’s technically possible to use Hibernate Search and Elasticsearch in distributed applications,
by default they suffer from
link:{hibernate-search-doc-prefix}#architecture-examples-no-coordination-elasticsearch-pros-and-cons[a few limitations].
link:{hibernate-search-docs-url}#architecture-examples-no-coordination-elasticsearch-pros-and-cons[a few limitations].

These limitations are the result of Hibernate Search not coordinating between threads or application nodes by default.

In order to get rid of these limitations, you can
link:{hibernate-search-doc-prefix}#architecture-examples-outbox-polling-elasticsearch[use the `outbox-polling` coordination strategy].
link:{hibernate-search-docs-url}#architecture-examples-outbox-polling-elasticsearch[use the `outbox-polling` coordination strategy].
This strategy creates an outbox table in the database to push entity change events to,
and relies on a background processor to consume these events and perform indexing.

Expand All @@ -895,7 +893,7 @@ Finally, you will need to make sure that the Hibernate ORM entities added by Hib
and intend to xref:hibernate-orm.adoc#dev-mode[let Hibernate ORM generate your database schema],
then no worries: the entities required by Hibernate Search will be included in the generated schema.
* Otherwise, you must
link:{hibernate-search-doc-prefix}#coordination-outbox-polling-schema[manually alter your schema to add the necessary tables/sequences].
link:{hibernate-search-docs-url}#coordination-outbox-polling-schema[manually alter your schema to add the necessary tables/sequences].

[NOTE]
====
Expand Down Expand Up @@ -939,7 +937,7 @@ and the recommended way of using Hibernate Search even when coordination is disa
====

For more information about coordination in Hibernate Search,
see link:{hibernate-search-doc-prefix}#coordination[this section of the reference documentation].
see link:{hibernate-search-docs-url}#coordination[this section of the reference documentation].

For more information about configuration options related to coordination,
see <<configuration-reference-coordination-outbox-polling>>.
Expand All @@ -958,7 +956,7 @@ for more information.
== Further reading

If you are interested in learning more about Hibernate Search 6,
the Hibernate team publishes link:{hibernate-search-doc-prefix}[an extensive reference documentation].
the Hibernate team publishes link:{hibernate-search-docs-url}[an extensive reference documentation].

== FAQ

Expand Down Expand Up @@ -998,7 +996,7 @@ such as `async`/`read-sync`/`write-sync`/`sync` for
<<quarkus-hibernate-search-orm-elasticsearch_quarkus.hibernate-search-orm.automatic-indexing.synchronization.strategy,`quarkus.hibernate-search-orm.automatic-indexing.synchronization.strategy`>>.
Other formats are also accepted, but are only useful for advanced use cases.
See link:{hibernate-search-doc-prefix}#configuration-bean-reference-parsing[this section of Hibernate Search's reference documentation]
See link:{hibernate-search-docs-url}#configuration-bean-reference-parsing[this section of Hibernate Search's reference documentation]
for more information.
====

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/mongodb-panache.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ The `Sort` class has plenty of methods for adding columns and specifying sort di

Normally, MongoDB queries are of this form: `{'firstname': 'John', 'lastname':'Doe'}`, this is what we call MongoDB native queries.

You can use them if you want, but we also support what we call **PanacheQL** that can be seen as a subset of link:https://docs.oracle.com/javaee/7/tutorial/persistence-querylanguage.htm#BNBTG[JPQL] (or link:https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html#hql[HQL]) and allows you to easily express a query.
You can use them if you want, but we also support what we call **PanacheQL** that can be seen as a subset of link:https://docs.oracle.com/javaee/7/tutorial/persistence-querylanguage.htm#BNBTG[JPQL] (or link:{hibernate-orm-docs-url}#hql[HQL]) and allows you to easily express a query.
MongoDB with Panache will then map it to a MongoDB native query.

If your query does not start with `{`, we will consider it a PanacheQL query:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ interface EntityMappingAgentConfig {
* The name of the Hibernate ORM basic type used for representing an UUID in the agent table.
*
* Refer to
* link:{hibernate-orm-doc-prefix}#basic-legacy-provided[this section of the Hibernate ORM documentation]
* link:{hibernate-orm-docs-url}#basic-legacy-provided[this section of the Hibernate ORM documentation]
* to see the list of available UUID representations provided by Hibernate ORM.
*
* A user defined type can also be supplied.
Expand Down Expand Up @@ -147,7 +147,7 @@ interface EntityMappingOutboxEventConfig {
* The name of the Hibernate ORM basic type used for representing an UUID in the outbox event table.
*
* Refer to
* link:{hibernate-orm-doc-prefix}#basic-legacy-provided[this section of the Hibernate ORM documentation]
* link:{hibernate-orm-docs-url}#basic-legacy-provided[this section of the Hibernate ORM documentation]
* to see the list of available UUID representations provided by Hibernate ORM.
*
* A user defined type can also be supplied.
Expand Down
Loading

0 comments on commit 8432292

Please sign in to comment.