File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes need help in updating data using hibernate hql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "need help in updating data using hibernate hql" Watch "need help in updating data using hibernate hql" New topic
Author

need help in updating data using hibernate hql

Abhishek Reddy
Ranch Hand

Joined: Mar 28, 2006
Posts: 259
I have a table let us say userdetails with fields companyid,employeeid,password,empname etc
here companyid,employeeid are composite keys and employeeid can be editable

i have created the required hibernate pojo class fro this table...

how to write update query for updating employeeid in the database?

for example ,

update userdetails set employeeid='new_value' where companyid='some_company' and employeeid='old_value'

i can do this by using SQLQuery object.....

how can i do this using hql?


Abhishek
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: need help in updating data using hibernate hql
 
Similar Threads
How to update multiple columns in Hibernate(using HQL query)?
fetch data from two different schema
Hibernate POJO class grtter method
Copy field in the same table
css,images,fonts gets dissappeared after submitting the form.