Rules on using ORM (Hibernate) #6
ctapobep
started this conversation in
Conventions & Approaches
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Use
saveOrUpdate()
instead ofmerge()
saveOrUpdate()
is marked as deprecated, hopefully eventually it won't be removed, here's the discussion: hibernate/hibernate-orm#4590.save()
/saveOrUpdate()
are actually much more optimal methods because they don't need an additional SELECT each time we want to update a detached entity.If they get removed, not sure if Hibernate would make any sense at all since even simple operations like UPDATE will be non-optimal. Hibernate is most useful for the simple use cases. But if it becomes useless even for simple things..
Beta Was this translation helpful? Give feedback.
All reactions