Skip to content

Commit

Permalink
Merge pull request #35120 from yrodiere/hsearch6.2-3.2
Browse files Browse the repository at this point in the history
Upgrade to Hibernate Search 6.2.0.Final in Quarkus 3.2
  • Loading branch information
gsmet committed Aug 1, 2023
2 parents bd03bd0 + 8d346e1 commit 851f588
Show file tree
Hide file tree
Showing 35 changed files with 779 additions and 92 deletions.
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,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 @@ -172,8 +171,8 @@ so at your application entry point boundaries like your REST endpoint controller
[[hibernate-dialect-supported-databases]]
==== Supported databases

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]
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 link:{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

0 comments on commit 851f588

Please sign in to comment.