I am just curious when to use merge()
method before saving an object in hibernate.
I saw an example that uses merge()
before saving with an object that has a many to many relationship with another object.
Example for using merge: Role
has ManyToMany
with Permission
and it sets List
of Permission
in the Role
object before saving.
So is that's only that case, when the saved object has relation with other objects?
I need good explanation and use cases.