• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

hibernate multiple records update in a single statement

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have table and want to update each Salary record for each ID

ID FirstName Salary
10 AAAA 10,000
15 BBBB 5000
17 CCCC 7000
19 DDDD 8000

But what happening is update statement is executed for each row.Suppose I have 1000 records then update statement is executing 1000 times.Is there any better way I can achive this.
I am doing as ,

Is there way i can optimize this code ?

Thanks
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try using hql if you want to update all the records at once.
 
reply
    Bookmark Topic Watch Topic
  • New Topic