@Override
    public void remover(Cliente cliente, Funcionario funcionario) {
        try {
            conn = ConnectionFactory.getConnection();
            String sql = "DELETE FROM compra where id IN (SELECT compra.id FROM compra "
                    + "     JOIN funcionario ON compra.idfuncionario = funcionario.id  "
                    + "     JOIN cliente ON compra.idcliente = cliente.id "
                    + "     WHERE cliente.cpf LIKE \'?\' AND funcionario.cpf LIKE \'?\')";
            ps = conn.prepareStatement(sql);
            ps.setString(1, cliente.getCpf());
            ps.setString(2, funcionario.getCpf());
            ps.executeUpdate();
        } catch (SQLException e){
                throw new RuntimeException("Erro " + e.getSQLState()
                                           + " ao atualizar o objeto: " 
                                           + e.getLocalizedMessage());
        } catch (ClassNotFoundException e){
                throw new RuntimeException("Erro ao conectar ao banco: "
                                         + e.getMessage()); 
        } finally {
            close();
        } 
    }