コード例 #1
0
 public void persist() throws ModelException {
   try {
     if (id == -1) {
       log.info(
           MessageFormat.format(Local.getString("message.creating_attribute"), this.getName()));
       HibernateHelper.save(this);
     } else {
       log.info(
           MessageFormat.format(Local.getString("message.updating_attribute"), this.getName()));
       HibernateHelper.update(this);
     }
   } catch (HelperException e) {
     throw new ModelException(e.getMessage(), e);
   }
 }
コード例 #2
0
 public void delete() throws ModelException {
   try {
     log.info(MessageFormat.format(Local.getString("message.deleting_attribute"), this.getName()));
     HibernateHelper.delete(this);
   } catch (HelperException e) {
     throw new ModelException(e.getMessage(), e);
   }
 }