-->
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: dynamic-update and dynamic-insert use
PostPosted: Mon Apr 10, 2006 5:33 am 
Beginner
Beginner

Joined: Mon Mar 27, 2006 5:25 am
Posts: 39
Location: India Hyderabad
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp



In the hibernate mapping file
inside the class we have two properties called dynamic-update and dynamic-insert wht are the use of these properties.

I've gone thru hibernate document but i didnt get the clear picture.

kndly let me know the description.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 10, 2006 3:39 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
(8)

dynamic-update (optional, defaults to false): Specifies that UPDATE SQL should be generated at runtime and contain only those columns whose values have changed.
(9)

dynamic-insert (optional, defaults to false): Specifies that INSERT SQL should be generated at runtime and contain only the columns whose values are not null.

http://www.hibernate.org/hib_docs/v3/re ... tion-class

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject: dynamic-insert and dynamic-update
PostPosted: Tue Apr 11, 2006 6:10 am 
Beginner
Beginner

Joined: Mon Mar 27, 2006 5:25 am
Posts: 39
Location: India Hyderabad
I need the brief description


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 11, 2006 1:04 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
OK, I will try to explain: let us suppose we have object that has 10 fields, then we create one and initialize one field only, with dynamic insert the statement will have two values like this
insert into table (id, fieldName1)values( 0, 'zz'),
without dynamic insert it will look like
insert into table (id, fieldName1,fieldName2,....)values( 0, 'zz', null,...);

same about dynamic updates

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 29, 2006 4:05 am 
Regular
Regular

Joined: Wed Sep 28, 2005 6:45 pm
Posts: 56
Is there any way to change this behaviour at runtime?

Something like: session.setDynamicUpdate(Order.class)?

It would be very useful if you have a table like the one I have where certain users can only update some of the fields.

The problem with setting the table to using dynamic update as default is that then other users can't set fields to null without running update statements setting fields specifically to null...

I have searched all over the place, but can't find the answer anywhere...

I would be very happy if somebody could help me out or come up with some thoughts on the subject.


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.