Dave schrieb:
session.merge is not very smart. Hibernate will update all properties
and association table. For association, delete all related rows, and
then add, even if the association(such as colllection) is not changed.
Is there a better way other than merge? Thanks.
Not really that is one of the downsides of using an orm mapper, you will
get some overhead regarding queries and data, you however can limit the
data written by adjusting the hibernate parameters (probably pushing
some of the association stuff into the lazily loaded domain might help,
adjusting the fetch, depth as well)
If you want finer granularisation than that, you have to go the manual
route and merge manually property by property (the beanutils can help in
this case)