Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Hibernate Search 6.2.0.Final in Quarkus 3.2 #35120

Merged
merged 7 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 40 additions & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
<hibernate-commons-annotations.version>6.0.6.Final</hibernate-commons-annotations.version> <!-- version controlled by Hibernate ORM -->
<hibernate-reactive.version>2.0.4.Final</hibernate-reactive.version>
<hibernate-validator.version>8.0.1.Final</hibernate-validator.version>
<hibernate-search.version>6.1.7.Final</hibernate-search.version>
<!-- When updating, align hibernate-search.version-for-documentation in docs/pom.xml -->
<hibernate-search.version>6.2.0.Final</hibernate-search.version>
<narayana.version>6.0.1.Final</narayana.version>
<agroal.version>2.1</agroal.version>
<jboss-transaction-spi.version>8.0.0.Final</jboss-transaction-spi.version>
Expand Down Expand Up @@ -5616,22 +5617,60 @@
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
</exclusion>
<!-- We don't want Jandex at runtime -->
<exclusion>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-engine</artifactId>
<version>${hibernate-search.version}</version>
<exclusions>
<!-- We don't want Jandex at runtime -->
<exclusion>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
</exclusion>
<exclusion>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-mapper-pojo-base</artifactId>
<version>${hibernate-search.version}</version>
<exclusions>
<!-- We don't want Jandex at runtime -->
<exclusion>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
</exclusion>
<exclusion>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-common</artifactId>
<version>${hibernate-search.version}</version>
<exclusions>
<!-- We don't want Jandex at runtime -->
<exclusion>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
</exclusion>
<exclusion>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
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
15 changes: 7 additions & 8 deletions docs/src/main/asciidoc/hibernate-orm.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
: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.

Check warning on line 12 in docs/src/main/asciidoc/hibernate-orm.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Spelling] Use correct American English spelling. Did you really mean 'facto'? Raw Output: {"message": "[Quarkus.Spelling] Use correct American English spelling. Did you really mean 'facto'?", "location": {"path": "docs/src/main/asciidoc/hibernate-orm.adoc", "range": {"start": {"line": 12, "column": 25}}}, "severity": "WARNING"}
It works beautifully in Quarkus.

== Solution
Expand Down Expand Up @@ -170,10 +169,10 @@
=== Dialect

[[hibernate-dialect-supported-databases]]
==== Supported databases

Check warning on line 172 in docs/src/main/asciidoc/hibernate-orm.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Spelling] Use correct American English spelling. Did you really mean 'datasource'? Raw Output: {"message": "[Quarkus.Spelling] Use correct American English spelling. Did you really mean 'datasource'?", "location": {"path": "docs/src/main/asciidoc/hibernate-orm.adoc", "range": {"start": {"line": 172, "column": 25}}}, "severity": "WARNING"}

For xref:datasource.adoc#default-datasource[supported databases],
the link:{orm-doc-url-prefix}##database-dialect[Hibernate ORM dialect]
For xref:datasource.adoc#extensions-and-database-drivers-reference[supported databases],
the link:{hibernate-orm-docs-url}#database-dialect[Hibernate ORM dialect]

Check warning on line 175 in docs/src/main/asciidoc/hibernate-orm.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'. Raw Output: {"message": "[Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'.", "location": {"path": "docs/src/main/asciidoc/hibernate-orm.adoc", "range": {"start": {"line": 175, "column": 73}}}, "severity": "INFO"}
does not need to be set explicitly:
it is selected automatically based on the datasource.

Expand Down Expand Up @@ -214,8 +213,8 @@
==== Other databases

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,

Check warning on line 216 in docs/src/main/asciidoc/hibernate-orm.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'. Raw Output: {"message": "[Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'.", "location": {"path": "docs/src/main/asciidoc/hibernate-orm.adoc", "range": {"start": {"line": 216, "column": 59}}}, "severity": "INFO"}
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 @@
----

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 @@
[[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 link:{quickstarts-tree-url}/hibernate-orm-multi-tenancy-quickstart[hibernate-orm-multi-tenancy-quickstart] quickstart.

Expand Down Expand Up @@ -1179,7 +1178,7 @@
[[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 @@
- `<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 @@

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]

Check warning on line 620 in docs/src/main/asciidoc/hibernate-reactive-panache.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.SentenceLength] Try to keep sentences to an average of 32 words or fewer. Raw Output: {"message": "[Quarkus.SentenceLength] Try to keep sentences to an average of 32 words or fewer.", "location": {"path": "docs/src/main/asciidoc/hibernate-reactive-panache.adoc", "range": {"start": {"line": 620, "column": 47}}}, "severity": "INFO"}

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