[DATAGRAPH-1182] Constructor based instantiation of entities fails due to missing converters. Created: 16/Jan/19 Updated: 16/Jan/19
|Project:||Spring Data Neo4j|
|Affects Version/s:||5.2 M1 (Moore), 5.1.4 (Lovelace SR4)|
|Reporter:||Michael Simons||Assignee:||Michael Simons|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
Given an entity like
Instantiation of such an entity during load fails with an ConverterNotFoundException:
This happens in all scenarios where no default Spring converters are defined or more than one.
The ParameterValueProvider for Neo4j's persistent properties then returns the numerical long value from the driver as is (see org.springframework.data.neo4j.conversion.Neo4jOgmEntityInstantiatorAdapter.Neo4jPropertyValueProvider).
This doesn't happen when the entity is instantiated with the default constructor and it's fields are written by OGM, as OGM forcefully coerces longs into ints.