* @throws sg.edu.nus.iss.se07.common.exceptions.AppException
*/
public boolean updateCategory(String id, String name) throws AppException {
boolean success = true;
CategoryManager dataObjectManager = new CategoryManager();
Category oldDataObject = null;
try {
oldDataObject = dataObjectManager.selectCategory(id);
} catch (AppException ex) {
Logger.getLogger(AppController.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
throw ex;
}
if (oldDataObject != null) {
Category newDataObject = new Category(id, name);
try {
success = dataObjectManager.updateCategory(oldDataObject, newDataObject);
if (success) {
//update cache
Hashtable<String, Category> categoryDataSet = DataSet.getCategoryDataSet();
if (categoryDataSet != null) {
Category old = categoryDataSet.get(id);