@Override
  protected Metadata fromResultSet(ResultSet rs) throws SQLException {
    Metadata retVal = new Metadata();

    retVal.setId(rs.getLong("id"));
    retVal.setIsDir(rs.getBoolean("is_dir"));
    retVal.setMimeType(rs.getString("mimetype"));
    retVal.setName(rs.getString("name"));
    retVal.setPath(rs.getString("path"));
    retVal.setCurrentRevision(rs.getInt("current_revision"));

    return retVal;
  }
  @Override
  protected int setFields(PreparedStatement pst, Metadata obj) throws SQLException {
    int order = 0;
    pst.setLong(++order, obj.getId());
    pst.setBoolean(++order, obj.getIsDir());
    pst.setString(++order, obj.getMimeType());
    pst.setString(++order, obj.getName());
    pst.setString(++order, obj.getPath());
    pst.setLong(++order, obj.getCurrentRevision());

    return ++order;
  }