{
events:
[
{"id": "1"}
{"id": "2"}
]
attributes:
[
{
"field": "field1"
"value": "value1"
}
{
"field": "field2"
"value": "value2"
}
]
}
For the above input i would like to update column "field": "field1"
of row "id": "1"
with "value": "value1"
.
But in case of partial error I should send back a list of failed id
.
How to get this list of failed id
in JPA/Hibernate bulk update ?
One way to do this is parse the list one by one and do a transactional
update for each id
one by one , in case of exception in DAO call, catch the exception and store this particular id
in the partial failed list .
But this feels like a brute force way of doing it, does JPA provide a better way to do bulk update and return the list of failed id
?