Skip to content

Commit 2fbd368

Browse files
authored
Fix Spring Boot 4 native (#96)
1 parent ab5052a commit 2fbd368

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.acme;
2+
3+
import org.springframework.aot.hint.MemberCategory;
4+
import org.springframework.aot.hint.RuntimeHints;
5+
import org.springframework.aot.hint.RuntimeHintsRegistrar;
6+
7+
public class HibernateNativeHints implements RuntimeHintsRegistrar {
8+
@Override
9+
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
10+
hints.reflection().registerTypeIfPresent(classLoader,
11+
"org.hibernate.engine.internal.NaturalIdLogging_$logger",
12+
MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS);
13+
}
14+
}

springboot4/src/main/java/org/acme/SpringBoot4Application.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.springframework.context.annotation.ImportRuntimeHints;
66

77
@SpringBootApplication
8-
@ImportRuntimeHints(L2CacheRuntimeHints.class)
8+
@ImportRuntimeHints({ HibernateNativeHints.class, L2CacheRuntimeHints.class })
99
public class SpringBoot4Application {
1010

1111
public static void main(String[] args) {

0 commit comments

Comments
 (0)