I'm working on a utility to update a list of entities in a database as a group. The database contains a list of entities. The result of the update is a new list. The API accepts this new list.
The update may end up modifying some of the entities in the list, creating new ones and deleting some. So at the entity level, I may have to do any of an insert, delete or update operation. But it's always true that the final list in the database will be the same as the list passed down to the API.
Is there in Hibernate a way to treat this operation at the list level, that is, tell Hibernate to persist this list of entities, and let it take care of which need to be created, updated or deleted?
There is no entity/table representing this list, btw. Just the entities themselves in a table.