File tree Expand file tree Collapse file tree 5 files changed +30
-1
lines changed
extensions/hibernate-orm/deployment/src
main/java/io/quarkus/hibernate/orm/deployment
test/java/io/quarkus/hibernate/orm/deployment Expand file tree Collapse file tree 5 files changed +30
-1
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change 22
33import org .hibernate .bytecode .enhance .spi .DefaultEnhancementContext ;
44import org .hibernate .bytecode .enhance .spi .UnloadedField ;
5+ import org .hibernate .bytecode .enhance .spi .UnsupportedEnhancementStrategy ;
56
67public 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}
Original file line number Diff line number Diff 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" ));
Original file line number Diff line number Diff line change 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 -->
You can’t perform that action at this time.
0 commit comments