• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OR mapping mutiple update statement !!!

 
gunjan bohra
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
I am working on ERP application .
I got 10 row into one jsp page.
Suppose I update one column value.When I want to save this I update
all 10 rows .means UPDATE SQL runs for all 10 rows
I don't want this ...I want which ever row I have update Only that
row Update will fire ...
How can I control this ...Is there any OR mapping tool in market which can
track this information ..
Any link related to this ...please post
Thanks
Gunjan Bohra
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate tracks whether a record "isDirty" and has many ways to implement this need. There are Interceptors, there are looping through the DTOs and asking if it is dirty and only calling update/save on those Objects.

Mark
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adding a version element to your mapping file will help Hibernate keep track of dirty objects.
 
gunjan bohra
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
I got It
 
Erik Bengtson
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by gunjan bohra:
Hi All
I am working on ERP application .
I got 10 row into one jsp page.
Suppose I update one column value.When I want to save this I update
all 10 rows .means UPDATE SQL runs for all 10 rows
I don't want this ...I want which ever row I have update Only that
row Update will fire ...
How can I control this ...Is there any OR mapping tool in market which can
track this information ..
Any link related to this ...please post
Thanks
Gunjan Bohra


JDO is able to do that. To do that create your class with the persistent fields and the JDO metadata, like the below. Keeping track of the changes in your object is transparent to you.

class Something
{
String fieldA;
String fieldB;
}

<jdo>
<package name="something">
<class name="Something/>
</package>
</jdo>
[ November 21, 2005: Message edited by: Erik Bengtson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic