-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: dynamicUpdate=true doesn't work
PostPosted: Wed Apr 20, 2016 3:30 am 
Newbie

Joined: Wed Apr 20, 2016 3:15 am
Posts: 1
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.