I need to write the following JDBC SQL using Hibernate.
String SQL = "Update MT_PERSON set DELETE_IND = 'Y' where " +"((ACTIVE_ID=? and LINKED_ID=?) or (ACTIVE_ID=? " +"and LINKED_ID=?)) and LINKED_TY = 'U'";
Can someone please help by providing me with a step-by-step procedure on how to do so using Hibernate.
Session.createSQLQuery(SQL) is not available in net.sf.hibernate.Session. I am using Hibernate version 2. Pleae advise how I could write the UPDATE query.
Thanks in advance.
Ghulam Rashid
Ranch Hand
Joined: Jan 14, 2002
Posts: 278
posted
0
Sorry, I cant provide you the step-to-step solution. But, can share my idea.
Other approach would be apart from what discussed above.
First you can load the persistance class using session.find()/load() using the condition (ACTIVE_ID=? and LINKED_ID=?). And, the call the setter method and then session.saveOrUpdate.