Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Updating values using Hibernate and struts

 
Sham Grandhe
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
presently iam working on struts and hibernate, on a project and iam new to this. i have a problem with the update query.
I have around 15 values in my table and when iam trying to update someof then, other values a being to null in the data base.

UserProfile updateUser = new UserProfile();
updateUser.setUserId(userId);
updateUser.setUserFirstName(updateForm.getFirstname());
updateUser.setUserLastName(updateForm.getLastname());
updateUser.setUserAddress1(updateForm.getAddress1());
updateUser.setUserAddress2(updateForm.getAddress2());
updateUser.setUserAddress3(updateForm.getAddress3());
updateUser.setUserPostcode(updateForm.getPostcode());
updateUser.setUserEmail(updateForm.getEmail());
updateUser.setUserPhone(updateForm.getPhone());
updateUser.setUserJobTitle(updateForm.getJobtitle());
updateUser.setUserTimezone(updateForm.getTimezone());
updateUser.setUserStatus("A");
session.update(updateUser);
transaction.commit();

there are a couple odd that ive not set. since i dont want to change them. plz do help me with some guide lines.

thanking you

regards
shyam
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic