public References ReferencesUpdate(long references_id, String user_id, String name, String designation, String org_univ, String place, String city, String state, String country, Long phoneno, Long mobileno, String email_id, String website) {
s = sf.openSession();
Transaction t = null;
try {
t = s.beginTransaction();
References UpdateInfo = (References) s.load(References.class, references_id);
UpdateInfo.setCity(city);
UpdateInfo.setCountry(country);
UpdateInfo.setDesignation(designation);
UpdateInfo.setEmailId(email_id);
UpdateInfo.setMobileno(mobileno);
UpdateInfo.setName(name);
UpdateInfo.setOrgUniv(org_univ);
UpdateInfo.setPhoneno(phoneno);
UpdateInfo.setPlace(place);
UpdateInfo.setState(state);
UpdateInfo.setWebsite(website);
if (null != UpdateInfo) {
s.update(UpdateInfo);
}
t.commit();
return UpdateInfo;
} catch (Throwable ex) {
//Log the Exception
t.rollback();
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
} finally {
s.close();
sf.close();
}
}
s = sf.openSession();
Transaction t = null;
try {
t = s.beginTransaction();
References UpdateInfo = (References) s.load(References.class, references_id);
UpdateInfo.setCity(city);
UpdateInfo.setCountry(country);
UpdateInfo.setDesignation(designation);
UpdateInfo.setEmailId(email_id);
UpdateInfo.setMobileno(mobileno);
UpdateInfo.setName(name);
UpdateInfo.setOrgUniv(org_univ);
UpdateInfo.setPhoneno(phoneno);
UpdateInfo.setPlace(place);
UpdateInfo.setState(state);
UpdateInfo.setWebsite(website);
if (null != UpdateInfo) {
s.update(UpdateInfo);
}
t.commit();
return UpdateInfo;
} catch (Throwable ex) {
//Log the Exception
t.rollback();
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
} finally {
s.close();
sf.close();
}
}
No comments:
Post a Comment