Examples of AnimalComplaint


Examples of healthwatcher.model.complaint.AnimalComplaint

                                                cidadeOcorrencia,
                                                bairroOcorrencia);
           
            Calendar agora              = Calendar.getInstance();

            queixa = new AnimalComplaint(nomeSolicitante, descricaoQueixa, observacaoQueixa,
                           emailSolicitante, null, 1, null,
                           new Date(agora.get(Calendar.DAY_OF_MONTH), agora.get(Calendar.MONTH),
                                agora.get(Calendar.YEAR)), endSolicitante, qtdeAnimal,
                                         new Date(diaIncomodo, mesIncomodo,anoIncomodo), nomeAnimal,endOcorrencia);
           
View Full Code Here

Examples of healthwatcher.model.complaint.AnimalComplaint

        food.setObservacao(complaint.getObservacao());
        food.setAtendente(complaint.getAtendente());
        food.setDataParecer(complaint.getDataParecer());
        food.setSituacao(complaint.getSituacao());
      }else if (complaint instanceof AnimalComplaint){
        AnimalComplaint animal = pm.getObjectById(AnimalComplaint.class, complaint.getCodigo());
        animal.setObservacao(complaint.getObservacao());
        animal.setAtendente(complaint.getAtendente());
        animal.setDataParecer(complaint.getDataParecer());
        animal.setSituacao(complaint.getSituacao());
      }
     
    } finally {
      pm.close();
    }
View Full Code Here

Examples of healthwatcher.model.complaint.AnimalComplaint

          deepInsertFood(food);
          complaint.setSituacao(1);
          complaint.setCodigo(food.getId());

        } else if (complaint instanceof AnimalComplaint) {
          AnimalComplaint animal = (AnimalComplaint) complaint;
          deepInsertAnimal(animal);
          complaint.setSituacao(1);
          complaint.setCodigo(animal.getId());
        }
      } else {
        throw new ObjectNotValidException(ExceptionMessages.EXC_NULO);
      }
    } catch (PersistenceMechanismException e) {
View Full Code Here

Examples of healthwatcher.model.complaint.AnimalComplaint

   *                especificado.
   */
  private AnimalComplaint accessAnimal(Long codigo) throws RepositoryException,
      ObjectNotFoundException {

    AnimalComplaint complaint;
    String sql = null;
    try {

      complaint = new AnimalComplaint();

      // Query sql que recupera todos os dados de uma complaint animal
      // para isso realiza um join para acessar as duas tabelas
      // A primeira tabela cont�m os dados gen�ricos a todas as
      // queixas, a segunda tabela cont�m os dados espec�ficos
      // a complaint animal
      sql = "select * from scbs_queixa q,scbs_queixaanimal qa where q.codigo=qa.codigo and q."
          + "codigo = '" + codigo + "'";

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

      if (resultSet.next()) {
        accessComplaint(resultSet, complaint);

        complaint.setAnimalQuantity(resultSet.getShort("qtdeAnimais"));
        String date = resultSet.getString("dataIncomodo");
        java.util.Date d = null;
        if (!date.equals("NULL")) {
          StringTokenizer token = new StringTokenizer(date, "/");
          int day = (new Integer(token.nextToken())).intValue();
          int month = (new Integer(token.nextToken())).intValue();
          int year = (new Integer(token.nextToken())).intValue();
          d = new java.util.Date(year, month, day);
        }
        if (d != null) {
          try {
            complaint.setInconvenienceDate(new Date(d.getDate(), d.getMonth() + 1, d
                .getYear() + 1900));
          } catch (InvalidDateException ex) {
          }
        } else {
          complaint.setInconvenienceDate(null);
        }

        complaint.setAnimal(resultSet.getString("animal"));

        String endAnimal = resultSet.getString("enderecolocalocorrencia");
        // 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();
View Full Code Here

Examples of healthwatcher.model.complaint.AnimalComplaint

          deepInsertSpecial(special);
        } else if (complaint instanceof FoodComplaint) {
          FoodComplaint food = (FoodComplaint) complaint;
          deepInsertFood(food);
        } else if (complaint instanceof AnimalComplaint) {
          AnimalComplaint animal = (AnimalComplaint) complaint;
          deepInsertAnimal(animal);
        }
      } else {
        throw new ObjectNotValidException(ExceptionMessages.EXC_NULO);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.