@Override
  public Filial obter(int id) throws ClassNotFoundException, SQLException, IOException {
    Filial loaded = null;

    FilialRecord result =
        GerenciadorBD.getContext().selectFrom(FILIAL).where(FILIAL.IDFILIAL.eq(id)).fetchOne();

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

    return (loaded);
  }
  @Override
  public boolean atualizar(Filial obj) throws ClassNotFoundException, SQLException, IOException {

    FilialRecord f = new FilialRecord(obj.getId(), obj.getNome());

    f =
        GerenciadorBD.getContext()
            .update(FILIAL)
            .set(f)
            .where(FILIAL.IDFILIAL.eq(obj.getId()))
            .returning()
            .fetchOne();

    return (f != null);
  }