aspose file tools*
The moose likes Struts and the fly likes Updating values using Hibernate and struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Updating values using Hibernate and struts" Watch "Updating values using Hibernate and struts" New topic
Author

Updating values using Hibernate and struts

Sham Grandhe
Ranch Hand

Joined: Dec 16, 2003
Posts: 73
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Updating values using Hibernate and struts