Hibernate list operation question
Posted
by Sumit Kishore
on Stack Overflow
See other posts from Stack Overflow
or by Sumit Kishore
Published on 2010-01-06T22:19:33Z
Indexed on
2010/05/01
0:27 UTC
Read the original article
Hit count: 613
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.
© Stack Overflow or respective owner