-->
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.  [ 5 posts ] 
Author Message
 Post subject: Selective column update
PostPosted: Fri May 19, 2006 7:04 am 
Newbie

Joined: Thu Apr 28, 2005 12:46 am
Posts: 6
It looks like the update statement generated by EntityManager includes all columns instead of the modified columns. This behaviour can be overridden only by using the hibernate @Entity annotation with dynamic-update=true. This reduces the portability of the code.

Whereas this feature is available out-of-the-box in the glassfish impl.

Will there be a future version of Hibernate EntityManager that will incorporate this feature out of the box??


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 19, 2006 9:33 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Probably not - since this has been a default with Hibernate as far as I know.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 19, 2006 11:56 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I don't really understand how such a thing reduce code portability.
Plus adding @org.hibernate.annotations.Entity in your domain model does not requires to have hibernate-annotations.jar in your classpath.

The default of glassfish is dynamic-uipdate=true, is that right?
This is usually faster (depends on DBs actually) to update everything than just the necessary columns.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 1:01 am 
Newbie

Joined: Thu Apr 28, 2005 12:46 am
Posts: 6
emmanuel wrote:
I don't really understand how such a thing reduce code portability.
Plus adding @org.hibernate.annotations.Entity in your domain model does not requires to have hibernate-annotations.jar in your classpath.

The default of glassfish is dynamic-uipdate=true, is that right?
This is usually faster (depends on DBs actually) to update everything than just the necessary columns.



Thanks for your resposne.

Updating all columns could be faster but in a scenario where only some of the fields (not affecting other fields) from different related entities need to be updated in a single transaction along with the parent entity's fields it is much easier to use the transitive persistence than using separate updates to the individual entities.

Secondly, any usage of org.hibernate.* within the code would require the appropriate hibernate jars in the classpath. The code will not work as is while using the glassfish persistence provider. The code has to be modified to remove reference to the hibernate specifics. This is what i meant by portability.

Lastly, Is there a possibility (in a future release) of extending the existing java.persistence.Entity annotation instead of requiring to include the additional org.hibernate.annotations.Entity annotation?

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 1:09 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
jv_400 wrote:
Secondly, any usage of org.hibernate.* within the code would require the appropriate hibernate jars in the classpath. The code will not work as is while using the glassfish persistence provider. The code has to be modified to remove reference to the hibernate specifics. This is what i meant by portability.


I don't think that's the case with annotations - that's what Emmanuel is trying to say - Emmanuel, am I right?


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

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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.