micronaut-projects / micronaut-data

Ahead of Time Data Repositories
Apache License 2.0
465 stars 197 forks source link

Add a @NoExpand tag for Iterables that don't need to be expanded #1761

Closed h2rashee closed 1 year ago

h2rashee commented 2 years ago

Expected Behavior

When passing an iterable to be written to a JSON field for an UPDATE SQL query, it writes the entire collection to the single field.

Actual Behaviour

When passing an iterable that is being written into a JSON field, the iterable gets expanded for an UPDATE SQL query but doesn't for a CREATE SQL query.

For the UPDATE SQL query, the individual collection's values are written to other fields in the query and result in a mismatch of number of values being inserted into the number of fields available on the database record.

Steps To Reproduce

https://gitter.im/micronautfw/questions?at=5e8674d53c6c42277aef4f32

Environment Information

N/A

Example Application

No response

Version

3.2.2

dstepanov commented 2 years ago

That code was changed some time ago. Please test with the latest version.

radovanradic commented 1 year ago

This appears to be fixed. Here is the test showing it. In case the issue is still there, please reopen this with the reproducible example.