-
Notifications
You must be signed in to change notification settings - Fork 356
@Embedded.Nullable returns as non-null for null collection property #1737
New issue
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
Comments
Placing collections in an embeddable is somewhat problematic as the current code only checks values from the current row in I agree this is a bug and we need to take care of it. |
Maybe I am lost in the context, but the collection is part of the current row when it is an array column. So, no additional query should be needed. The code imho already has all the information needed to return the correct null result for the embedded object, as it needed to fill all the null fields in it already. |
You're right; I missed that the component type is |
We also faced this problem. Do you have a workaround for that? |
Embedded entities which contain a empty collection of values that aren't entities are now considered empty, if this collection is empty. Closes #1737
After upgrading to Using a combination of Java + Kotlin:
My database table (postgres):
My test case (Kotlin)
(I will create a seperate issue for this later this evening) |
Given an
@Embedded.Nullable
on a property whose object contains a property with a collection type, e.g. list (backed by a varchar array in the DB), the annotated object is returned non-null even for a null value of this collection.For a row with
values = null
, the mapper results in theembedded
property being a non-null object, and its propertyvalues
isnull
.I guess this is a bug, as it goes against the documented behavior:
which should hold for an embedded with a single collection field yielding a null value.
version: 3.2.2
The text was updated successfully, but these errors were encountered: