@Transactional(propagation
= Propagation.REQUIRED, rollbackFor = UserException.class) //
Spring
//transaction annotation
public result saveUserData(String userInputData)
{
DatabaseClass databaseClass = new DatabaseClass();
databaseClass.set(userInputData)
getHibernateTemplate().saveOrUpdate(databaseClass);
}
public void setDataAccessObject(DataAccessObject dataAccessObject
{
this.dataAccessObject = dataAccessObject
}
public DataAccessObject getDataAccessObject()
{
return this.dataAccesObject;
}