Hi!
I use entity with following annotation
Code:
@org.hibernate.annotations.Entity(
dynamicUpdate = true
)
Then in my Java code I get and update the entity:
Code:
final MyEntity myEntity = (MyEntity) sessionFactory.getCurrentSession().get(MyEntity.class, id);
...
myEntity.setMyField("random string");
...
sessionFactory.getCurrentSession().save(myEntity);
sessionFactory.getCurrentSession().flush();
The code above is in single method.
When I turn on Postgres logs, I see generated query, that contains all fields of my entity, not just "myfield".
I tried to call this method implicitly in transaction, but had the same result: update query contains all fields.
I use hibernate-jpa-2.0-api-1.0.1.Final and hibernate-core-3.6.10.Final.
How can I force my update query contains only updated fields?