Skip to content

Commit

Permalink
HSEARCH-3277 Upgrade to Hibernate ORM 6.0.0.Beta3
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere authored and marko-bekhta committed Sep 25, 2023
1 parent 3f4caea commit ee4d3db
Show file tree
Hide file tree
Showing 38 changed files with 563 additions and 893 deletions.
6 changes: 3 additions & 3 deletions build/config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@
<skip>${maven.javadoc.skip}</skip>
<artifactItems>
<artifactItem>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core-jakarta</artifactId>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
<classifier>javadoc</classifier>
<type>jar</type>
<version>${version.org.hibernate}</version>
<version>${version.org.hibernate.orm}</version>
<outputDirectory>${tmpdir.dependencies-javadoc-packagelists}/hibernate-core</outputDirectory>
</artifactItem>
<artifactItem>
Expand Down
2 changes: 1 addition & 1 deletion build/parents/public/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
-->
<offlineLinks>
<offlineLink>
<url>${javadoc.org.hibernate.url}</url>
<url>${javadoc.org.hibernate.orm.url}</url>
<location>${javadoc.packagelists.directory}/hibernate-core</location>
</offlineLink>
<offlineLink>
Expand Down
4 changes: 2 additions & 2 deletions documentation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@
<hibernateSearchMigrationGuidesIndexUrl>https://hibernate.org/search/documentation/migrate/</hibernateSearchMigrationGuidesIndexUrl>
<hibernateCommunityUrl>https://hibernate.org/community</hibernateCommunityUrl>
<hibernateBlogUrl>https://in.relation.to/</hibernateBlogUrl>
<hibernateVersion>${version.org.hibernate}</hibernateVersion>
<hibernateDocUrl>${documentation.org.hibernate.url}</hibernateDocUrl>
<hibernateVersion>${version.org.hibernate.orm}</hibernateVersion>
<hibernateDocUrl>${documentation.org.hibernate.orm.url}</hibernateDocUrl>
<javaeeUrl>https://www.oracle.com/java/technologies/java-ee-glance.html</javaeeUrl>
<hibernateOrm6DocUrl>${documentation.org.hibernate.orm.url}</hibernateOrm6DocUrl>
<hibernateOrm6Version>${version.org.hibernate.orm}</hibernateOrm6Version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
|
|Hibernate ORM (for the <<mapper-orm,Hibernate ORM mapper>>
|{hibernateVersion}
|Also compatible with version {hibernateOrm6Version}
but requires <<other-integrations-orm6,different Maven artifacts>>.
|
|Jakarta Persistence (for the <<mapper-orm,Hibernate ORM mapper>>
|{jakartaPersistenceVersion}
|
Expand Down
68 changes: 12 additions & 56 deletions documentation/src/main/asciidoc/public/reference/_integrations.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,64 +17,20 @@ Use <<other-integrations-jakarta,Jakarta EE>> instead.
[[other-integrations-orm6]]
== Hibernate ORM 6

include::../components/_incubating-warning.adoc[]
In previous versions, Hibernate Search's main Maven artifacts used to target Hibernate ORM 5,
while separate, dedicated Maven artifacts targeted Hibernate ORM 6.

Hibernate Search includes experimental support for link:{hibernateOrm6DocUrl}[Hibernate ORM 6],
and it requires only one small change:
when declaring the dependencies of your project,
you must add `-orm6` to some artifact identifiers.
This is no longer the case: the main Maven artifacts now target Hibernate ORM 6,
and Hibernate ORM 5 is no longer compatible.

[WARNING]
====
The experimental support for Hibernate ORM 6 in Hibernate Search {hibernateSearchVersion}
targets Hibernate ORM version {hibernateOrm6Version}.
If your dependencies include references to artifacts ending with `-orm6`
(e.g. `hibernate-search-mapper-orm-orm6`)
just remove the `-orm6` (e.g. use `hibernate-search-mapper-orm` instead)
when you upgrade to this version of Hibernate Search.

Newer versions of Hibernate ORM 6 may introduce breaking changes,
in which case they will no longer be compatible with
the experimental support for Hibernate ORM 6 in Hibernate Search {hibernateSearchVersion},
until Hibernate Search catches up in its next release.
====
[[other-integrations-orm5]]
== Hibernate ORM 5

Hibernate Search no longer supports Hibernate ORM 5.

For example, an application using Hibernate ORM 6 and the Elasticsearch backend
will need to update its dependencies as follows:

[source, XML, subs="+attributes"]
----
<dependency>
<groupId>org.hibernate.orm</groupId> <!--1-->
<artifactId>hibernate-core</artifactId>
<version>{hibernateOrm6Version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-mapper-orm-orm6</artifactId> <!--2-->
<version>{hibernateSearchVersion}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-backend-elasticsearch</artifactId> <!--3-->
<version>{hibernateSearchVersion}</version>
</dependency>
----
<1> Replaces `org.hibernate:hibernate-core`; notice how the groupId changed in Hibernate ORM 6.
<2> Replaces `hibernate-search-mapper-orm`.
<3> No replacement necessary: this artifact does not rely on Java EE or Hibernate ORM.

All artifacts relying directly or indirectly on Java EE or Hibernate ORM must be replaced with their ORM 6 counterpart.
This includes in particular:

* https://in.relation.to/2018/12/06/hibernate-orm-600-alpha1-out/#artifacts[Hibernate ORM artifacts]
* `hibernate-search-mapper-orm` => `hibernate-search-mapper-orm-orm6`
* `hibernate-search-mapper-orm-batch-jsr352-core` => `hibernate-search-mapper-orm-batch-jsr352-core-orm6`
* ...

Artifacts that do not rely on Java EE or Hibernate ORM at all, on the other hand,
do not have an ORM 6 counterpart and must not be replaced.
These artifacts should be excluded from your replacements in particular:

* `hibernate-search-engine`
* `hibernate-search-backend-lucene`
* `hibernate-search-backend-elasticsearch`
* `hibernate-search-backend-elasticsearch-aws`
* ...
Use <<other-integrations-jakarta,Hibernate ORM 6>> instead.
4 changes: 2 additions & 2 deletions integrationtest/mapper/orm-envers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers-jakarta</artifactId>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-envers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.dialect.CockroachDB192Dialect;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.search.integrationtest.mapper.orm.realbackend.testsupport.BackendConfigurations;
import org.hibernate.search.mapper.orm.Search;
Expand Down Expand Up @@ -67,7 +67,7 @@ public void indexingStrategySession() throws Throwable {
.skipTestForDialect( SQLServerDialect.class,
"The execution could provoke a failure caused by a deadlock on SQLServer, "
+ "which will abort our requests and will make the tests fail." )
.skipTestForDialect( CockroachDB192Dialect.class,
.skipTestForDialect( CockroachDialect.class,
"The execution could provoke a 'failed preemptive refresh due to a conflict' on CockroachDB,"
+ " which will abort our requests and will make the tests fail." )
.setup( Book.class, Author.class, BookEdition.class );
Expand Down
5 changes: 5 additions & 0 deletions integrationtest/mapper/orm-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<exclusions>
<!-- Using a newer version of Hibernate ORM, with a different groupID -->
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</exclusion>
<!-- Using JBoss Logging -->
<exclusion>
<groupId>org.springframework.boot</groupId>
Expand Down

0 comments on commit ee4d3db

Please sign in to comment.