spring-data-redis icon indicating copy to clipboard operation
spring-data-redis copied to clipboard

Rewrite conversion of top-level collections in `MappingRedisConverter`

Open mp911de opened this issue 4 years ago • 1 comments

MappingRedisConverter.write(…) attempts to obtain an entity from the given object to later on decide how to serialize it (collection, map, …). PersistentEntity retrieval breaks if the type is encapsulated (e.g. Arrays.asList(…)). The code still attempts to obtain a keyspace and the identifier accessor.

We should generally avoid identifier, keyspace name, and TTL retrieval from a collection as collections do not have such a property.

mp911de avatar Sep 16 '21 07:09 mp911de

Hi @mp911de I’ve checked the MappingRedisConverter.write(...) method in #2168 and it looks like the early “if (source instanceof Collection)” branch hasn’t been added yet. Would you mind if I pick this up and submit a PR that moves the collection check to the top and skips the entity/keyspace lookup for top-level collections?

Leehyoungwoo avatar May 07 '25 06:05 Leehyoungwoo