Skip to content

Commit 94bced4

Browse files
authored
Merge pull request #44703 from yrodiere/orm-6.6.3-3.15
[3.15] Upgrade to Hibernate ORM 6.6.3.Final
2 parents ed318c9 + 94aece2 commit 94bced4

File tree

5 files changed

+30
-1
lines changed

5 files changed

+30
-1
lines changed

extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/ClassNames.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,9 @@ private static DotName createConstant(String fqcn) {
455455
createConstant("java.util.UUID"),
456456
createConstant("java.lang.Void"));
457457

458+
public static final List<DotName> STANDARD_STACK_ELEMENT_TYPES = List.of(
459+
createConstant("org.hibernate.query.sqm.tree.select.SqmQueryPart"));
460+
458461
public static final DotName HIBERNATE_ORM_PROCESSOR = createConstant(
459462
"io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor");
460463

extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/GraalVMFeatures.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,14 @@ ReflectiveClassBuildItem registerJdbcArrayTypesForReflection() {
3939
.build();
4040
}
4141

42+
// Workaround for https://hibernate.atlassian.net/browse/HHH-18875
43+
// See https://hibernate.zulipchat.com/#narrow/channel/132094-hibernate-orm-dev/topic/StandardStack.20and.20reflection
44+
@BuildStep
45+
ReflectiveClassBuildItem registerStandardStackElementTypesForReflection() {
46+
return ReflectiveClassBuildItem
47+
.builder(ClassNames.STANDARD_STACK_ELEMENT_TYPES.stream().map(d -> d.toString() + "[]").toArray(String[]::new))
48+
.reason("Workaround for https://hibernate.atlassian.net/browse/HHH-18875")
49+
.build();
50+
}
51+
4252
}

extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/integration/QuarkusEnhancementContext.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.hibernate.bytecode.enhance.spi.DefaultEnhancementContext;
44
import org.hibernate.bytecode.enhance.spi.UnloadedField;
5+
import org.hibernate.bytecode.enhance.spi.UnsupportedEnhancementStrategy;
56

67
public final class QuarkusEnhancementContext extends DefaultEnhancementContext {
78

@@ -26,4 +27,17 @@ public ClassLoader getLoadingClassLoader() {
2627
throw new IllegalStateException("The Classloader of the EnhancementContext should not be used");
2728
}
2829

30+
@Override
31+
public UnsupportedEnhancementStrategy getUnsupportedEnhancementStrategy() {
32+
// We expect model classes to be enhanced.
33+
// Lack of enhancement could lead to many problems,
34+
// from bad performance, to Quarkus-specific optimizations causing errors/data loss,
35+
// to incorrect generated bytecode (references to non-existing methods).
36+
// For backwards compatibility reason, in this branch we adopt the legacy behavior of Hibernate ORM,
37+
// which is to try to enhance all classes, ignoring any known issue.
38+
// However, later versions of Quarkus (3.17+ at least) just have Hibernate ORM's enhancer fail.
39+
// with a clear error message pointing to the application class that needs to be fixed.
40+
return UnsupportedEnhancementStrategy.LEGACY;
41+
}
42+
2943
}

extensions/hibernate-orm/deployment/src/test/java/io/quarkus/hibernate/orm/deployment/ClassNamesTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ public void testNoMissingHibernateAnnotation() {
107107
}
108108

109109
private static void ignoreInternalAnnotations(Set<DotName> annotationSet) {
110+
annotationSet.removeIf(name -> name.toString().equals("org.hibernate.cfg.Compatibility"));
111+
annotationSet.removeIf(name -> name.toString().equals("org.hibernate.cfg.Unsafe"));
110112
annotationSet.removeIf(name -> name.toString().equals("org.hibernate.Incubating"));
111113
annotationSet.removeIf(name -> name.toString().equals("org.hibernate.Internal"));
112114
annotationSet.removeIf(name -> name.toString().equals("org.hibernate.Remove"));

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<jacoco.version>0.8.12</jacoco.version>
7272
<kubernetes-client.version>6.13.4</kubernetes-client.version> <!-- Please check with Java Operator SDK team before updating -->
7373
<rest-assured.version>5.5.0</rest-assured.version>
74-
<hibernate-orm.version>6.6.1.Final</hibernate-orm.version> <!-- WARNING when updating, also align the versions below -->
74+
<hibernate-orm.version>6.6.3.Final</hibernate-orm.version> <!-- WARNING when updating, also align the versions below -->
7575
<antlr.version>4.13.0</antlr.version> <!-- version controlled by Hibernate ORM's needs -->
7676
<bytebuddy.version>1.14.18</bytebuddy.version> <!-- version controlled by Hibernate ORM's needs -->
7777
<hibernate-commons-annotations.version>7.0.3.Final</hibernate-commons-annotations.version> <!-- version controlled by Hibernate ORM's needs -->

0 commit comments

Comments
 (0)