Package lib.exceptions

Examples of lib.exceptions.ObjectNotFoundException


        } catch (UnsupportedOperationException uoe) {
          ids = new ArrayList<Long>(ids);
          ids.remove(0);
        }
      } else {
        throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
      }

      while (!ids.isEmpty()) {
        MedicalSpeciality ms = search(ids.get(0));
        listaEsp.add(ms);
View Full Code Here


        } catch (UnsupportedOperationException uoe) {
          ids = new ArrayList<Long>(ids);
          ids.remove(0);
        }
      } else {
        throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
      }

      while (!ids.isEmpty()) {
        Symptom ms = search(ids.get(0));
        listaEsp.add(ms);
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 {
        DiseaseType td = partialSearch((new Long(rs.getString("codigo"))).longValue());
        listatd.add(td);
View Full Code Here

        duracao = resultSet.getString("duracao");

        //preparar para buscar em outra tabela os sintomas desta doenca
        //depois vai chamar deepAccess() de SymptomRepositoryArray
      } else {
        throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
      }
      resultSet.close();
      stmt.close();

      td = new DiseaseType();
View Full Code Here

        duracao = resultSet.getString("duracao");

        //preparar para buscar em outra tabela os sintomas desta doenca
        //depois vai chamar deepAccess() de RepositorioSintomaArray
      } else {
        throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
      }
      resultSet.close();
      stmt.close();

      // Query para recuperar os sintomas relacionados com o tipo
      // de doen�a encontrado a partir do c�digo
      sql = "select * from scbs_tipodoencasintoma where codigotipodoenca = '" + code + "'";

      stmt = (Statement) this.mp.getCommunicationChannel();
      resultSet = stmt.executeQuery(sql);

      sintomas = new ArrayList();
      while (resultSet.next()) {
        int codeSymptom = (new Integer(resultSet.getString("codigosintoma"))).intValue();

        // Query para encontrar os dados de um sintoma usando o
        // c�digo encontrado na tabela de relacionamentos.
        sql = "select * from scbs_sintoma where " + "codigo = '" + codeSymptom + "'";

        Statement stmt2 = (Statement) this.mp.getCommunicationChannel();
        ResultSet resultSet2 = stmt2.executeQuery(sql);
        Symptom sintoma;

        if (resultSet2.next()) {
          sintoma = new Symptom(resultSet2.getString("descricao"));
          sintoma.setId((new Long(resultSet2.getString("codigo"))).longValue());
        } else {
          // Caso esse trecho de c�digo seja executado,
          // a tabela de relacinoamentos n�o est� consistente
          // com a tabela de sintomas
          throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
        }
        resultSet2.close();
        stmt2.close();

        sintomas.add(sintoma);
View Full Code Here

        } catch (UnsupportedOperationException uoe) {
          ids = new ArrayList<Long>(ids);
          ids.remove(0);
        }
      } else {
        throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
      }

      // O resultado da query � navegado, e cada
      // c�digo � informado � um m�todo (procura) que
      // monta uma unidade de s�ude a partir do c�digo.
View Full Code Here

        name = listUs.get(0).getName();
        description = listUs.get(0).getDescription();
        manifestation = listUs.get(0).getManifestation();
        duration = listUs.get(0).getDuration();
      }else{
        throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
      }


      pm.close();
View Full Code Here

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

      if (!rs.next()) {
        throw new ObjectNotFoundException("");
      }
      do {
        MedicalSpeciality esp = search((new Long(rs.getString("codigo"))).longValue());
        listaEsp.add(esp);
      } while (rs.next());
View Full Code Here

      if (resultSet.next()) {
        esp = new MedicalSpeciality(resultSet.getString("descricao"));
        esp.setId((new Long(resultSet.getString("codigo"))).longValue());
      } else {
        throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
      }
      resultSet.close();
      stmt.close();
    } catch (PersistenceMechanismException e) {
      e.printStackTrace();
View Full Code Here

      String querySpecial = ("select id from "+SpecialComplaint.class.getName());
      List<Long> special = (List<Long>) pm.newQuery(querySpecial).execute();

      if (food.isEmpty() && animal.isEmpty() && special.isEmpty()) {
        throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
      }

      if(!food.isEmpty()){
        complaint = search(food.get(0));
        cList.add(complaint);
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.