So with JPA/Hibernate you can certainly load an entity "proxy" without hitting the database using something like session.load()
or entityManager.getReference()
.
However, it seems it's impossible to set a property on these "proxies" without Hibernate initializing the proxy from the database. Therefore, you can't persist just the changed values (via @DynamicUpdate
on the entity) without a select.
I believe this is just the way it is and if you want update without select
you have to roll it yourself. I'd be delighted if somebody could prove me wrong! Am I missing something?