Skip to content

Commit adb8eb1

Browse files
committed
DATAJPA-1484 - Add build profile for Hibernate 6.
Added build profile Hibernate 6 snapshots. Introduced property for Hibernate group identifier as it's gonna change to org.hibernate.orm in 6.0. Added the build profile to the Travis builds. Added explicit cast to the Hibernate implementation in PersistenceProvider as ScrollableResults now uses a generic type as return value for its ….get() method.
1 parent d6274a0 commit adb8eb1

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ env:
1212
- PROFILE=hibernate-53-next
1313
- PROFILE=hibernate-54
1414
- PROFILE=hibernate-54-next
15+
- PROFILE=hibernate-6
1516
- PROFILE=eclipselink-next
1617
- PROFILE=eclipselink-27
1718
- PROFILE=eclipselink-27-next

pom.xml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
<eclipselink>2.6.5</eclipselink>
2525
<hibernate>5.2.17.Final</hibernate>
26+
<hibernate.groupId>org.hibernate</hibernate.groupId>
2627
<jpa>2.0.0</jpa>
2728
<springdata.commons>2.2.0.BUILD-SNAPSHOT</springdata.commons>
2829

@@ -81,6 +82,19 @@
8182
</repository>
8283
</repositories>
8384
</profile>
85+
<profile>
86+
<id>hibernate-6-next</id>
87+
<properties>
88+
<hibernate>6.0.0-SNAPSHOT</hibernate>
89+
<hibernate.groupId>org.hibernate.orm</hibernate.groupId>
90+
</properties>
91+
<repositories>
92+
<repository>
93+
<id>jboss</id>
94+
<url>https://repository.jboss.org/nexus/content/repositories/public</url>
95+
</repository>
96+
</repositories>
97+
</profile>
8498
<profile>
8599
<id>eclipselink-next</id>
86100
<properties>
@@ -225,14 +239,14 @@
225239
</dependency>
226240

227241
<dependency>
228-
<groupId>org.hibernate</groupId>
242+
<groupId>${hibernate.groupId}</groupId>
229243
<artifactId>hibernate-core</artifactId>
230244
<version>${hibernate}</version>
231245
<optional>true</optional>
232246
</dependency>
233247

234248
<dependency>
235-
<groupId>org.hibernate</groupId>
249+
<groupId>${hibernate.groupId}</groupId>
236250
<artifactId>hibernate-jpamodelgen</artifactId>
237251
<version>${hibernate}</version>
238252
<scope>provided</scope>

src/main/java/org/springframework/data/jpa/provider/PersistenceProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ public Object next() {
383383
throw new NoSuchElementException("No ScrollableResults");
384384
}
385385

386-
Object[] row = scrollableResults.get();
386+
// Cast needed for Hibernate 6 compatibility
387+
Object[] row = (Object[]) scrollableResults.get();
387388

388389
return row.length == 1 ? row[0] : row;
389390
}

0 commit comments

Comments
 (0)