public Filial obter(String nome) throws ClassNotFoundException, SQLException, IOException {
    Filial loaded = null;

    FilialRecord result =
        GerenciadorBD.getContext().selectFrom(FILIAL).where(FILIAL.NOME.eq(nome)).fetchOne();

    if (result != null) {
      loaded = new Filial(result.getIdfilial(), result.getNome());
    }

    return (loaded);
  }
  @Override
  public Collection<Filial> obterTodos() throws ClassNotFoundException, SQLException, IOException {
    ArrayList<Filial> loaded = null;

    Result<FilialRecord> result = GerenciadorBD.getContext().selectFrom(FILIAL).fetch();

    if (result != null) {

      loaded = new ArrayList<>();

      for (FilialRecord f : result) {
        Filial tmp = new Filial(f.getIdfilial(), f.getNome());
        loaded.add(tmp);
      }
    }

    return (loaded);
  }