Closed davidsonnabend closed 2 days ago
@radovanradic Thank you for fixing this. I have worked my way in and wanted to ask if I am correct in adding the check you've added recently. :-)
@davidsonnabend Yes, I think that should be the right way. I tested this fix against your example and it was passing.
Expected Behavior
ONE_TO_MANY
relations should always be mapped correctly.Actual Behaviour
When having multiple
ONE_TO_MANY
relations of the same entity, the entities contains the wrong values.Having the following data classes and repository:
Only the first element of
someFoos
andotherFoos
is mapped correctly. The other elements contains wrong values forsomeBar
andanotherBar
.When multiple
Foo
instances are persisted like this:None of the
someFoos
of the fetchedBar
entity should have a value foranotherBar
, but from the second elementsomeBar
andanotherBar
are equal.When adding a
@MappedProperty
in addition to the@Relation
like this:These
id
values are mapped correctly. The values for@Relation
are still wrong.Steps To Reproduce
./gradlew test
.Environment Information
Example Application
https://github.com/davidsonnabend/micronaut-data-relation-mapping-error
Version
4.5.0