@Override
    public Competicao remove(Object key) {
        try {
            Competicao al = this.get((String) key);
            Statement stm = conn.createStatement();
            if (al.getClass().getName().equals("Competicao.Eliminatorias") || al.getClass().getName().equals("Competicao.EliminatoriaDupla")) {

                String sql = "DELETE  FROM EquipaTorneio where cod_competicao='" + (String) key + "'";
                int i = stm.executeUpdate(sql);
                sql = "DELETE  FROM Marcadores where cod_competicao='" + (String) key + "'";
                i = stm.executeUpdate(sql);
                sql = "DELETE  FROM Torneio where cod_torneio='" + (String) key + "'";
                i = stm.executeUpdate(sql);
                sql = "DELETE  FROM Competicao where cod_competicao='" + (String) key + "'";
                i = stm.executeUpdate(sql);
                stm.close();
                return al;
            } else {
                String sql = "DELETE  FROM Campeonato where cod_campeonato='" + (String) key + "'";
                int i = stm.executeUpdate(sql);
                sql = "DELETE  FROM EquipaCampeonato where cod_competicao='" + (String) key + "'";
                i = stm.executeUpdate(sql);
                sql = "DELETE  FROM Marcadores where cod_competicao='" + (String) key + "'";
                i = stm.executeUpdate(sql);
                sql = "DELETE  FROM Competicao where cod_competicao='" + (String) key + "'";
                i = stm.executeUpdate(sql);
                stm.close();
                return al;
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, e.getMessage(), "ERROR", JOptionPane.ERROR_MESSAGE);
            return null;
        }

    }