private void doUpdate(Session hSession) throws HibernateException {
    MetadataTable tUpdates = getMetadataTable(MetadataTable.UPDATE);

    Iterator i = mClasses.values().iterator();
    while (i.hasNext()) {
      MClass clazz = (MClass) i.next();
      Set hUpdates = new HashSet();
      List updates = tUpdates.getDataRows(clazz.getPath());
      if (updates != null) {
        Iterator j = updates.iterator();
        while (j.hasNext()) {
          Metadata md = (Metadata) j.next();
          Update hUpdate = new Update();

          hUpdate.setMClass(clazz);

          hUpdate.setUpdateName(md.getAttribute("UpdateName"));
          hUpdate.setDescription(md.getAttribute("Description"));
          hUpdate.setKeyField(md.getAttribute("KeyField"));

          hUpdate.updateLevel();

          hSession.save(hUpdate);
          hUpdates.add(hUpdate);
          mUpdates.put(hUpdate.getPath(), hUpdate);
        }
      }
      clazz.setUpdates(hUpdates);
      hSession.saveOrUpdate(clazz);
    }
  }