Skip to content

Commit 55a27db

Browse files
Add serialization configuration for cache.support.NullValue
This commit makes sure to register serialization of null values for usage within a native image. Closes: #2403
1 parent 7d34afb commit 55a27db

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/org/springframework/data/redis/aot/RedisRuntimeHints.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.springframework.data.keyvalue.repository.config.QueryCreatorType;
3232
import org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery;
3333
import org.springframework.data.keyvalue.repository.support.KeyValueRepositoryFactoryBean;
34+
import org.springframework.data.redis.cache.RedisCacheManager;
3435
import org.springframework.data.redis.connection.*;
3536
import org.springframework.data.redis.core.*;
3637
import org.springframework.data.redis.core.convert.KeyspaceConfiguration;
@@ -59,6 +60,10 @@ class RedisRuntimeHints implements RuntimeHintsRegistrar {
5960
@Override
6061
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
6162

63+
// CACHE
64+
hints.serialization().registerType(org.springframework.cache.support.NullValue.class,
65+
hint -> hint.onReachableType(TypeReference.of(RedisCacheManager.class)));
66+
6267
// REFLECTION
6368
hints.reflection().registerTypes(Arrays.asList(TypeReference.of(RedisConnection.class),
6469
TypeReference.of(StringRedisConnection.class), TypeReference.of(DefaultedRedisConnection.class),

0 commit comments

Comments
 (0)