• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

OR mapping mutiple update statement !!!

 
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
 
ranger
Posts: 17346
11
Mac IntelliJ IDE 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
 
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
 
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 ]
 
You guys haven't done this much, have ya? I suggest you study this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic