Skip to content

OGM unable to apply a collection of values from database into a Set [DATAGRAPH-644] #1208

@spring-projects-issues

Description

@spring-projects-issues

Greg Guydo opened DATAGRAPH-644 and commented

Given a class has a Set instead of a List of values, these cannot be appied back onto the object upon querying, with error "org.neo4j.ogm.entityaccess.EntityAccessException: Failed to invoke method 'setXxxx'. Expected argument type: interface java.util.Set actual argument type class java.util.ArrayList"

It seems the fix would be to add at line 81 in EntityAccess.java the following:

if (Set.class.isAssignableFrom(parameterType)) {
    return new HashSet<>(union(collection, hydrated));
}

Affects: 4.0 M1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions