-->
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.  [ 1 post ] 
Author Message
 Post subject: hibernate Update Query
PostPosted: Wed Feb 06, 2013 1:16 am 
Newbie

Joined: Wed Feb 06, 2013 1:03 am
Posts: 2
Hi friends,
Please solve this issue?

For this update querry
update TestDB.dbo.MyEmp set empname=? where empid=?
i wrote in my DAO class

MyEmployee myEmployee = new MyEmployee();

MyEmployee myEmployee =(MyEmployee )session.load(MyEmployee.class, new Integer(1700));
myEmployee.setName("updatedName");
session.update(myEmployee );

Its working fine, but i need to know for this type of update query mentioned in below

update TestDB.dbo.MyEmp set empsalary=? where empid=? && empname = ?
(i.e., i need to update the table by using two conditions in where clause , this can be done by HQL , but i want to know how can we implement this by using saveOrUpdate method..)

How i can do update by using update or saveOrUpdate method()?
Whether its possible to do like that in hibernate ???

Please solve this prob...


Thanks in advance....


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

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.