Package lib.exceptions

Examples of lib.exceptions.ObjectNotFoundException


    return ponteiro < indice;
  }

  public IteratorDsk getSpecialityList() throws RepositoryException, ObjectNotFoundException {
    if (indice == 0)
      throw new ObjectNotFoundException("There isn't registered Health units");
    return new ConcreteIterator(Arrays.asList(vetor));
  }
View Full Code Here


  public MedicalSpeciality search(Long code) throws RepositoryException, ObjectNotFoundException {
    MedicalSpeciality response = null;
    int i = getIndex(code);
    if (i == indice) {
      throw new ObjectNotFoundException("Specialty not found");
    } else {
      response = vetor[i];
    }
    return response;
  }
View Full Code Here

  }

  public void remove(Long code) throws RepositoryException, ObjectNotFoundException {
    int i = getIndex(code);
    if (i == indice) {
      throw new ObjectNotFoundException("Specialty not found");
    } else {
      vetor[i] = vetor[indice - 1];
      indice = indice - 1;
    }
  }
View Full Code Here

        String endDoente = resultSet.getString("enderecodoente");
        // System.out.println("endere�o doente = "+endDoente);
        Address endDo = addressRep.search((new Long(endDoente)).longValue());
        complaint.setEnderecoDoente(endDo);
      } else {
        throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
      }
      resultSet.close();
      stmt.close();
    } catch (PersistenceMechanismException e) {
      e.printStackTrace();
View Full Code Here

        // System.out.println("endereco animal = "+ endAnimal);
        Address endLO = addressRep.search((new Long(endAnimal)).longValue());
        complaint.setOccurenceLocalAddress(endLO);

      } else {
        throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
      }
      resultSet.close();
      stmt.close();
    } catch (PersistenceMechanismException e) {
      throw new RepositoryException(ExceptionMessages.EXC_FALHA_BD);
View Full Code Here

        Address endO = addressRep.search((new Long(resultSet
            .getString("enderecoocorrencia")).longValue()));
        complaint.setEnderecoOcorrencia(endO);
      } else {
        throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
      }
      resultSet.close();
      stmt.close();
    } catch (PersistenceMechanismException e) {
      e.printStackTrace();
View Full Code Here

                    ExceptionMessages.EXC_FALHA_ATUALIZACAO_COPIA);
              } else {
                complaint.incTimestamp();
              }
            } else {
              throw new ObjectNotFoundException(
                  ExceptionMessages.EXC_FALHA_ATUALIZACAO);
            }
            resultSet.close();
            stmt.close();
            stmt = (Statement) this.mp.getCommunicationChannel();
            sql = "update scbs_queixa set " + "observacao='"
                + complaint.getObservacao() + "', " + "situacao= '"
                + complaint.getSituacao() + "', ts= '"
                + complaint.getTimestamp() + "'";

            if (complaint.getAtendente() != null) {
              sql += ", funcionario= '" + complaint.getAtendente().getLogin() + "'";
            }
            if (complaint.getDataParecer() != null) {
              sql += ", dataparecer= '" + complaint.getDataParecer() + "'";
            }
            sql += " where codigo = '" + complaint.getCodigo() + "'";

            int response = stmt.executeUpdate(sql);
            if (response == 0) {
              throw new ObjectNotFoundException(
                  ExceptionMessages.EXC_FALHA_ATUALIZACAO);
            }
            stmt.close();
          } catch (SQLException e) {
            System.out.println(sql);
View Full Code Here

      ResultSet rs = stmt.executeQuery(sql);

      if (rs.next()) {
        tipoQueixa = (new Integer(rs.getString("tipoqueixa"))).intValue();
      } else {
        throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA + " code: "
            + code);
      }
      rs.close();
      stmt.close();
    } catch (PersistenceMechanismException e) {
View Full Code Here

    try {
      Statement stmt = (Statement) this.mp.getCommunicationChannel();
      rs = stmt.executeQuery(sql);

      if (!rs.next()) {
        throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
      }
      do {
        int tipoQueixa = (new Integer(rs.getString("tipoqueixa"))).intValue();
        Long code = (new Long(rs.getString("codigo"))).longValue();
        switch (tipoQueixa) {
View Full Code Here

TOP

Related Classes of lib.exceptions.ObjectNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.