We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I try to use saveAll() to save a list of entities where the entity class has a @CompositeProperty it is throwing the following error:
@CompositeProperty
Unable to convert org.springframework.data.neo4j.core.mapping.MapValueWrapper to Neo4j Value.; Error code 'N/A';
The error happens in the org.neo4j.driver.Values class in the Value value( Object value ) method.
org.neo4j.driver.Values
Value value( Object value )
This error occurred when we went from 6.2.1 -> 6.2.2. Neo4j java driver: 4.4.3
Replicate using the following:
@Node @Getter @Setter public class TestObject { @Id @Property(name = "id") @GeneratedValue(value = UUIDStringGenerator.class) protected String id; @JsonIgnore @CompositeProperty(delimiter = "", converter = TestConverter.class) private TestData data; public TestObject(TestData aData) { super(); data = aData; } }
public class TestConverter implements Neo4jPersistentPropertyToMapConverter<String, TestData> { static final String NUM = "Num"; static final String STRING = "String"; @NotNull @Override public Map<String, Value> decompose(@Nullable TestData property, @NotNull Neo4jConversionService neo4jConversionService) { return property == null ? Map.of() : Map.of(NUM, Values.value(property.getNum()), STRING, Values.value(property.getString())); } @NotNull @Override public TestData compose(Map<String, Value> source, @NotNull Neo4jConversionService neo4jConversionService) { TestData data = new TestData(); if (source.get(NUM) != null) { data.setNum(source.get(NUM).asInt()); } if (source.get(STRING) != null) { data.setString(source.get(STRING).asString()); } return data; } }
@Getter @Setter public class TestData { private int num; private String string; public TestData() { super(); } public TestData(int num, String string) { this.num = num; this.string = string; } }
public interface TestObjectRepository extends Neo4jRepository<TestObject, String> { }
Error will be thrown when calling TestObjectRepository.saveAll() for a list of TestObjects.
The text was updated successfully, but these errors were encountered:
This issue persists in spring-data-neo4j:6.2.3 as well.
Sorry, something went wrong.
Thanks for the ping. No wonder that it still persists, it is still open… Sorry for the oversight here.
Caused by the fix for #2451
Excellent reproducer, @jposthauer A fix is on the way.
GH-2493 - Unwrap MapValueWrapper for list parameters, too.
MapValueWrapper
c4aa621
This fixes #2493.
ed1d47b
879355c
2995811
michael-simons
No branches or pull requests
When I try to use saveAll() to save a list of entities where the entity class has a
@CompositeProperty
it is throwing the following error:The error happens in the
org.neo4j.driver.Values
class in theValue value( Object value )
method.This error occurred when we went from 6.2.1 -> 6.2.2.
Neo4j java driver: 4.4.3
Replicate using the following:
Error will be thrown when calling TestObjectRepository.saveAll() for a list of TestObjects.
The text was updated successfully, but these errors were encountered: