Skip to content

Rewrite conversion of top-level collections in MappingRedisConverter #2168

Closed
@mp911de

Description

@mp911de

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.

Activity

added this to the 3.x milestone on Sep 16, 2021
Leehyoungwoo

Leehyoungwoo commented on May 7, 2025

@Leehyoungwoo
Contributor

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?

added a commit that references this issue on May 9, 2025

4 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Rewrite conversion of top-level collections in `MappingRedisConverter` · Issue #2168 · spring-projects/spring-data-redis