Esempio n. 1
0
 /**
  * {@inheritDoc}
  *
  * <p>此操作会清空 Cache 中 authorities 对应的 value 和 key = auth.getValue() 的数据,下次请求时装载。
  *
  * @see #getAll()
  */
 public void update(Authority auth) throws JibuException {
   Connection conn = null;
   try {
     conn = ConnectionUtils.getConnection();
     Authority old = authDAO.get(conn, auth.getId());
     authDAO.update(conn, auth);
     DbUtils.commitAndClose(conn);
     Cache cache = CacheUtils.getAuthCache();
     cache.remove("authorities");
     cache.remove(old.getValue());
   } catch (SQLException e) {
     DbUtils.rollbackAndCloseQuietly(conn);
     throw new JibuException(e.getMessage());
   }
 }