java - Hibernate update query -



java - Hibernate update query -

i have table 1 primary key (auto increment) , 3 columns except primary key column

s.no empid empname month salary

1 1700 xxxx jan 17000 2 1701 yyyy jan 70000 3 1700 xxxx feb 16750 4 1702 yyyy jan 70000 5 1700 xxxx mar 17000 6 1700 xxxx apr 16000

this table contains details employee names , his/her monthly salary details, need update salary of employee xxx in jan month.

how can in hibernate using session.saveorupdate method?

assuming working persistent "employee" objects, think should work out.

transaction t = session.begintransaction(); employee.setempid(id); employee.setempname(name); employee.setsalary(newsalary); ... session.saveorupdate(employee); system.out.println("successfully updated"); t.commit();

java sql hibernate sql-update dao

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -