Open ahofmeister opened 2 years ago
Thanks for the report. In the meantime, you can use saveFull
as a workaround to also flush the collection. If that doesn't work because you want to apply only partial state, you will have to load the updatable entity view first and the apply the JSON onto that object via the EntityViewAwareObjectMapper
. I'll try to see if I can fix that soon though, as I think this might be easy!
FYI The workaround works well :) But could lead to a complete change of workflows. For example: We use PATCH to update our entities via API and the clients are used to only send the relevant data. Forcing the clients to update their code to send the whole entity (state) to the API is something we want to avoid if possible
Wanted to add here that this is something we ran into last week as well. We had no idea this was the case by default. Hoping this will make it into 1.6.9!
Description
For partial updates eg via PATCH request it is not possible to set properties to null or empty for collections.
Expected behavior
We expect that properties can be set to null or empty in case of collections.
Actual behavior
No update statement is executed and therefore the property does not change in any way
Steps to reproduce
https://github.com/ahofmeister/bp-collection-empty-reproducer - there is a test case to reproduce the issue. Note the reproducer is only for collections
Environment
Version: 1.6.1
JPA-Provider:
DBMS:
Application Server: Quarkus 2.7.5.Final