Package ecar.bean

Examples of ecar.bean.TempBean


      while ((linha=in.readLine()) != null) {
        // ordem dos campos: cod_lit;Janeiro de 2006 at� mar�o de 2007;
        String[] campos = linha.split(";");
        if(campos != null) {
          // Janeiro/2006
          TempBean tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("1"));
          tempBean.setAno(Integer.valueOf("2006"));
          tempBean.setQtde(Double.valueOf(campos[1]));
          listTempBean.add(tempBean);
          // Fevereiro/2006
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("2"));
          tempBean.setAno(Integer.valueOf("2006"));
          tempBean.setQtde(Double.valueOf(campos[2]));
          listTempBean.add(tempBean);
          // Mar�o/2006
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("3"));
          tempBean.setAno(Integer.valueOf("2006"));
          tempBean.setQtde(Double.valueOf(campos[3]));
          listTempBean.add(tempBean);
          // Abril/2006
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("4"));
          tempBean.setAno(Integer.valueOf("2006"));
          tempBean.setQtde(Double.valueOf(campos[4]));
          listTempBean.add(tempBean);
          // Maio/2006
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("5"));
          tempBean.setAno(Integer.valueOf("2006"));
          tempBean.setQtde(Double.valueOf(campos[5]));
          listTempBean.add(tempBean);
          // Junho/2006
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("6"));
          tempBean.setAno(Integer.valueOf("2006"));
          tempBean.setQtde(Double.valueOf(campos[6]));
          listTempBean.add(tempBean);
          // Julho/2006
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("7"));
          tempBean.setAno(Integer.valueOf("2006"));
          tempBean.setQtde(Double.valueOf(campos[7]));
          listTempBean.add(tempBean);
          // Agosto/2006
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("8"));
          tempBean.setAno(Integer.valueOf("2006"));
          tempBean.setQtde(Double.valueOf(campos[8]));
          listTempBean.add(tempBean);
          // Setembro/2006
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("9"));
          tempBean.setAno(Integer.valueOf("2006"));
          tempBean.setQtde(Double.valueOf(campos[9]));
          listTempBean.add(tempBean);
          // Outubro/2006
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("10"));
          tempBean.setAno(Integer.valueOf("2006"));
          tempBean.setQtde(Double.valueOf(campos[10]));
          listTempBean.add(tempBean);
          // Novembro/2006
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("11"));
          tempBean.setAno(Integer.valueOf("2006"));
          tempBean.setQtde(Double.valueOf(campos[11]));
          listTempBean.add(tempBean);
          // Dezembro/2006
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("12"));
          tempBean.setAno(Integer.valueOf("2006"));
          tempBean.setQtde(Double.valueOf(campos[12]));
          listTempBean.add(tempBean);
          // Janeiro/2007
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("1"));
          tempBean.setAno(Integer.valueOf("2007"));
          tempBean.setQtde(Double.valueOf(campos[13]));
          listTempBean.add(tempBean);
          // Fevereiro/2007
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("2"));
          tempBean.setAno(Integer.valueOf("2007"));
          tempBean.setQtde(Double.valueOf(campos[14]));
          listTempBean.add(tempBean);
          // Mar�o/2007
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("3"));
          tempBean.setAno(Integer.valueOf("2007"));
          tempBean.setQtde(Double.valueOf(campos[15]));
          listTempBean.add(tempBean);
        }
        registrosLidos++;
      }
     
      System.out.println("registrosLidos: " + registrosLidos);

      System.out.println("Iniciando transacao...");
      tx = session.beginTransaction();
      Dao dao = new Dao();
      AcompRealFisicoDao arfDao = new AcompRealFisicoDao(null);
      Iterator it = listTempBean.iterator();
      while(it.hasNext()) {
        TempBean bean = (TempBean)it.next();
        LocalItemLit lit = (LocalItemLit)dao.buscar(LocalItemLit.class, bean.getCodLit());
        AcompRealFisicoArf arf = arfDao.buscarPorIettir(Long.valueOf(bean.getMes()), Long.valueOf(bean.getAno()), Long.valueOf("1186"));
       
        if(lit == null || arf == null) {
          throw new Exception("lit == null || arf == null");
        }
       
        AcompRealFisicoLocalArfl arfl = new AcompRealFisicoLocalArfl();
        arfl.setLocalItemLit(lit);
        arfl.setAcompRealFisicoArf(arf);
        arfl.setQuantidadeArfl(bean.getQtde());
        session.save(arfl);
      }
     
      System.out.println("Commit...");
      tx.commit();
View Full Code Here


     
      while ((linha=in.readLine()) != null) {
        // ordem dos campos: cod_lit;Janeiro de 2006 at� Fevereiro de 2007;
        String[] campos = linha.split(";");
        if(campos != null) {
          TempBean tempBean = new TempBean();
          // Janeiro/2006
          if(!codCidadeManfrinopolis.equals(campos[0])) {
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("1"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[1]));
            listTempBean.add(tempBean);
          }
          // Fevereiro/2006
          if(!codCidadeManfrinopolis.equals(campos[0])) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("2"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[2]));
            listTempBean.add(tempBean);
          }
          // Mar�o/2006
          if(!codCidadeManfrinopolis.equals(campos[0])) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("3"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[3]));
            listTempBean.add(tempBean);
          }
          // Abril/2006
          if(!codCidadeManfrinopolis.equals(campos[0])) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("4"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[4]));
            listTempBean.add(tempBean);
          }
          // Maio/2006
          if(!codCidadeManfrinopolis.equals(campos[0])) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("5"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[5]));
            listTempBean.add(tempBean);
          }
          // Junho/2006
          if(!codCidadeManfrinopolis.equals(campos[0])) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("6"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[6]));
            listTempBean.add(tempBean);
          }
          // Julho/2006
          if(!codCidadeManfrinopolis.equals(campos[0])) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("7"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[7]));
            listTempBean.add(tempBean);
          }
          // Agosto/2006
          if(!codCidadeManfrinopolis.equals(campos[0])) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("8"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[8]));
            listTempBean.add(tempBean);
          }
          // Setembro/2006
          if(!codCidadeManfrinopolis.equals(campos[0])) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("9"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[9]));
            listTempBean.add(tempBean);
          }
          // Outubro/2006
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("10"));
          tempBean.setAno(Integer.valueOf("2006"));
          tempBean.setQtde(Double.valueOf(campos[10]));
          listTempBean.add(tempBean);
          // Novembro/2006
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("11"));
          tempBean.setAno(Integer.valueOf("2006"));
          tempBean.setQtde(Double.valueOf(campos[11]));
          listTempBean.add(tempBean);
          // Dezembro/2006
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("12"));
          tempBean.setAno(Integer.valueOf("2006"));
          tempBean.setQtde(Double.valueOf(campos[12]));
          listTempBean.add(tempBean);
          // Janeiro/2007
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("1"));
          tempBean.setAno(Integer.valueOf("2007"));
          tempBean.setQtde(Double.valueOf(campos[13]));
          listTempBean.add(tempBean);
          // Fevereiro/2007
          tempBean = new TempBean();
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("2"));
          tempBean.setAno(Integer.valueOf("2007"));
          tempBean.setQtde(Double.valueOf(campos[14]));
          listTempBean.add(tempBean);
        }
        registrosLidos++;
      }
     
      System.out.println("registrosLidos: " + registrosLidos);

      System.out.println("Iniciando transacao...");
      tx = session.beginTransaction();
      Dao dao = new Dao();
      AcompRealFisicoDao arfDao = new AcompRealFisicoDao(null);
      Iterator it = listTempBean.iterator();
      while(it.hasNext()) {
        TempBean bean = (TempBean)it.next();
        LocalItemLit lit = (LocalItemLit)dao.buscar(LocalItemLit.class, bean.getCodLit());
        AcompRealFisicoArf arf = arfDao.buscarPorIettir(Long.valueOf(bean.getMes()), Long.valueOf(bean.getAno()), Long.valueOf("1187"));
       
        if(lit == null || arf == null) {
          throw new Exception("lit == null || arf == null");
        }
       
        AcompRealFisicoLocalArfl arfl = new AcompRealFisicoLocalArfl();
        arfl.setLocalItemLit(lit);
        arfl.setAcompRealFisicoArf(arf);
        arfl.setQuantidadeArfl(bean.getQtde());
        session.save(arfl);
      }
     
      //int i = Integer.parseInt("asdasd.as;;");
     
View Full Code Here

     
      while ((linha=in.readLine()) != null) {
        // ordem dos campos: cod_lit;Janeiro de 2004 at� Dezembro de 2004;
        String[] campos = linha.split(";");
        if(campos != null && campos.length > 1) {
          TempBean tempBean;
          // Janeiro/2004
          if(campos[1] != null && !"".equals(campos[1].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("1"));
            tempBean.setAno(Integer.valueOf("2004"));
            tempBean.setQtde(Double.valueOf(campos[1]));
            listTempBean.add(tempBean);
          }
          // Fevereiro/2004
          if(campos[2] != null && !"".equals(campos[2].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("2"));
            tempBean.setAno(Integer.valueOf("2004"));
            tempBean.setQtde(Double.valueOf(campos[2]));
            listTempBean.add(tempBean);
          }
          // Mar�o/2004
          if(campos[3] != null && !"".equals(campos[3].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("3"));
            tempBean.setAno(Integer.valueOf("2004"));
            tempBean.setQtde(Double.valueOf(campos[3]));
            listTempBean.add(tempBean);
          }
          // Abril/2004
          if(campos[4] != null && !"".equals(campos[4].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("4"));
            tempBean.setAno(Integer.valueOf("2004"));
            tempBean.setQtde(Double.valueOf(campos[4]));
            listTempBean.add(tempBean);
          }
          // Maio/2004
          if(campos[5] != null && !"".equals(campos[5].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("5"));
            tempBean.setAno(Integer.valueOf("2004"));
            tempBean.setQtde(Double.valueOf(campos[5]));
            listTempBean.add(tempBean);
          }
          // Junho/2004
          if(campos[6] != null && !"".equals(campos[6].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("6"));
            tempBean.setAno(Integer.valueOf("2004"));
            tempBean.setQtde(Double.valueOf(campos[6]));
            listTempBean.add(tempBean);
          }
          // Julho/2004
          if(campos[7] != null && !"".equals(campos[7].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("7"));
            tempBean.setAno(Integer.valueOf("2004"));
            tempBean.setQtde(Double.valueOf(campos[7]));
            listTempBean.add(tempBean);
          }
          // Agosto/2004
          if(campos[8] != null && !"".equals(campos[8].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("8"));
            tempBean.setAno(Integer.valueOf("2004"));
            tempBean.setQtde(Double.valueOf(campos[8]));
            listTempBean.add(tempBean);
          }
          // Setembro/2004
          if(campos[9] != null && !"".equals(campos[9].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("9"));
            tempBean.setAno(Integer.valueOf("2004"));
            tempBean.setQtde(Double.valueOf(campos[9]));
            listTempBean.add(tempBean);
          }
          // Outubro/2004
          if(campos[10] != null && !"".equals(campos[10].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("10"));
            tempBean.setAno(Integer.valueOf("2004"));
            tempBean.setQtde(Double.valueOf(campos[10]));
            listTempBean.add(tempBean);
          }
          // Novembro/2004
          if(campos[11] != null && !"".equals(campos[11].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("11"));
            tempBean.setAno(Integer.valueOf("2004"));
            tempBean.setQtde(Double.valueOf(campos[11]));
            listTempBean.add(tempBean);
          }
          // Dezembro/2004
          if(campos[12] != null && !"".equals(campos[12].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("12"));
            tempBean.setAno(Integer.valueOf("2004"));
            tempBean.setQtde(Double.valueOf(campos[12]));
            listTempBean.add(tempBean);
          }
        }
        registrosLidos++;
      }
     
      System.out.println("registrosLidos: " + registrosLidos);

      System.out.println("Iniciando transacao...");
      tx = session.beginTransaction();
      Dao dao = new Dao();
      AcompRealFisicoDao arfDao = new AcompRealFisicoDao(null);
      Iterator it = listTempBean.iterator();
      while(it.hasNext()) {
        TempBean bean = (TempBean)it.next();
        LocalItemLit lit = (LocalItemLit)dao.buscar(LocalItemLit.class, bean.getCodLit());
        AcompRealFisicoArf arf = arfDao.buscarPorIettir(Long.valueOf(bean.getMes()), Long.valueOf(bean.getAno()), Long.valueOf("1186"));
       
        if(lit == null || arf == null) {
          throw new Exception("lit == null || arf == null");
        }
       
        AcompRealFisicoLocalArfl arfl = new AcompRealFisicoLocalArfl();
        arfl.setLocalItemLit(lit);
        arfl.setAcompRealFisicoArf(arf);
        arfl.setQuantidadeArfl(bean.getQtde());
        session.save(arfl);
      }
     
      //int i = Integer.parseInt("asdasd,adsd.as");
     
View Full Code Here

     
      while ((linha=in.readLine()) != null) {
        // ordem dos campos: cod_lit;Janeiro de 2005 at� Dezembro de 2005;
        String[] campos = linha.split(";");
        if(campos != null && campos.length > 1) {
          TempBean tempBean;
          // Janeiro/2005
          if(campos[1] != null && !"".equals(campos[1].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("1"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[1]));
            listTempBean.add(tempBean);
          }
          // Fevereiro/2005
          if(campos[2] != null && !"".equals(campos[2].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("2"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[2]));
            listTempBean.add(tempBean);
          }
          // Mar�o/2005
          if(campos[3] != null && !"".equals(campos[3].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("3"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[3]));
            listTempBean.add(tempBean);
          }
          // Abril/2005
          if(campos[4] != null && !"".equals(campos[4].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("4"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[4]));
            listTempBean.add(tempBean);
          }
          // Maio/2005
          if(campos[5] != null && !"".equals(campos[5].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("5"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[5]));
            listTempBean.add(tempBean);
          }
          // Junho/2005
          if(campos[6] != null && !"".equals(campos[6].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("6"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[6]));
            listTempBean.add(tempBean);
          }
          // Julho/2005
          if(campos[7] != null && !"".equals(campos[7].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("7"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[7]));
            listTempBean.add(tempBean);
          }
          // Agosto/2005
          if(campos[8] != null && !"".equals(campos[8].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("8"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[8]));
            listTempBean.add(tempBean);
          }
          // Setembro/2005
          if(campos[9] != null && !"".equals(campos[9].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("9"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[9]));
            listTempBean.add(tempBean);
          }
          // Outubro/2005
          if(campos[10] != null && !"".equals(campos[10].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("10"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[10]));
            listTempBean.add(tempBean);
          }
          // Novembro/2005
          if(campos[11] != null && !"".equals(campos[11].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("11"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[11]));
            listTempBean.add(tempBean);
          }
          // Dezembro/2005
          if(campos[12] != null && !"".equals(campos[12].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("12"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[12]));
            listTempBean.add(tempBean);
          }
        }
        registrosLidos++;
      }
     
      System.out.println("registrosLidos: " + registrosLidos);

      System.out.println("Iniciando transacao...");
      tx = session.beginTransaction();
      Dao dao = new Dao();
      AcompRealFisicoDao arfDao = new AcompRealFisicoDao(null);
      Iterator it = listTempBean.iterator();
      while(it.hasNext()) {
        TempBean bean = (TempBean)it.next();
        LocalItemLit lit = (LocalItemLit)dao.buscar(LocalItemLit.class, bean.getCodLit());
        AcompRealFisicoArf arf = arfDao.buscarPorIettir(Long.valueOf(bean.getMes()), Long.valueOf(bean.getAno()), Long.valueOf("1186"));
       
        if(lit == null || arf == null) {
          throw new Exception("lit == null || arf == null");
        }
       
        AcompRealFisicoLocalArfl arfl = new AcompRealFisicoLocalArfl();
        arfl.setLocalItemLit(lit);
        arfl.setAcompRealFisicoArf(arf);
        arfl.setQuantidadeArfl(bean.getQtde());
        session.save(arfl);
      }
     
      //int i = Integer.parseInt("asdasd,adsd.as");
     
View Full Code Here

     
      while ((linha=in.readLine()) != null) {
        // ordem dos campos: cod_lit;Janeiro de 2006 at� Dezembro de 2006;
        String[] campos = linha.split(";");
        if(campos != null && campos.length > 1) {
          TempBean tempBean;
          // Janeiro/2006
          if(campos[1] != null && !"".equals(campos[1].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("1"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[1]));
            listTempBean.add(tempBean);
          }
          // Fevereiro/2006
          if(campos[2] != null && !"".equals(campos[2].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("2"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[2]));
            listTempBean.add(tempBean);
          }
          // Mar�o/2006
          if(campos[3] != null && !"".equals(campos[3].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("3"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[3]));
            listTempBean.add(tempBean);
          }
          // Abril/2006
          if(campos[4] != null && !"".equals(campos[4].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("4"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[4]));
            listTempBean.add(tempBean);
          }
          // Maio/2006
          if(campos[5] != null && !"".equals(campos[5].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("5"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[5]));
            listTempBean.add(tempBean);
          }
          // Junho/2006
          if(campos[6] != null && !"".equals(campos[6].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("6"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[6]));
            listTempBean.add(tempBean);
          }
          // Julho/2006
          if(campos[7] != null && !"".equals(campos[7].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("7"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[7]));
            listTempBean.add(tempBean);
          }
          // Agosto/2006
          if(campos[8] != null && !"".equals(campos[8].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("8"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[8]));
            listTempBean.add(tempBean);
          }
          // Setembro/2006
          if(campos[9] != null && !"".equals(campos[9].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("9"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[9]));
            listTempBean.add(tempBean);
          }
          // Outubro/2006
          if(campos[10] != null && !"".equals(campos[10].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("10"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[10]));
            listTempBean.add(tempBean);
          }
          // Novembro/2006
          if(campos[11] != null && !"".equals(campos[11].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("11"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[11]));
            listTempBean.add(tempBean);
          }
          // Dezembro/2006
          if(campos[12] != null && !"".equals(campos[12].trim())) {
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("12"));
            tempBean.setAno(Integer.valueOf("2006"));
            tempBean.setQtde(Double.valueOf(campos[12]));
            listTempBean.add(tempBean);
          }
        }
        registrosLidos++;
      }
     
      System.out.println("registrosLidos: " + registrosLidos);

      System.out.println("Iniciando transacao...");
      tx = session.beginTransaction();
      Dao dao = new Dao();
      AcompRealFisicoDao arfDao = new AcompRealFisicoDao(null);
      Iterator it = listTempBean.iterator();
      while(it.hasNext()) {
        TempBean bean = (TempBean)it.next();
        LocalItemLit lit = (LocalItemLit)dao.buscar(LocalItemLit.class, bean.getCodLit());
        AcompRealFisicoArf arf = arfDao.buscarPorIettir(Long.valueOf(bean.getMes()), Long.valueOf(bean.getAno()), Long.valueOf("1189"));
       
        if(lit == null || arf == null) {
          throw new Exception("lit == null || arf == null");
        }
       
        AcompRealFisicoLocalArfl arfl = new AcompRealFisicoLocalArfl();
        arfl.setLocalItemLit(lit);
        arfl.setAcompRealFisicoArf(arf);
        arfl.setQuantidadeArfl(bean.getQtde());
        session.save(arfl);
      }
     
      //int i = Integer.parseInt("asdasd,adsd.as");
     
View Full Code Here

     
      while ((linha=in.readLine()) != null) {
        // ordem dos campos: cod_lit;Dezembro/2004;
        String[] campos = linha.split(";");
        if(campos != null) {
          TempBean tempBean = new TempBean();
         
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("12"));
          tempBean.setAno(Integer.valueOf("2004"));
          tempBean.setQtde(Double.valueOf(campos[1]));
          listTempBean.add(tempBean);
        }
        registrosLidos++;
      }
     
      System.out.println("registrosLidos: " + registrosLidos);

      System.out.println("Iniciando transacao...");
      tx = session.beginTransaction();
      Dao dao = new Dao();
      AcompRealFisicoDao arfDao = new AcompRealFisicoDao(null);
      Iterator it = listTempBean.iterator();
      while(it.hasNext()) {
        TempBean bean = (TempBean)it.next();
        LocalItemLit lit = (LocalItemLit)dao.buscar(LocalItemLit.class, bean.getCodLit());
        AcompRealFisicoArf arf = arfDao.buscarPorIettir(Long.valueOf(bean.getMes()), Long.valueOf(bean.getAno()), Long.valueOf("1187"));
       
        if(lit == null || arf == null) {
          throw new Exception("lit == null || arf == null");
        }
       
        AcompRealFisicoLocalArfl arfl = new AcompRealFisicoLocalArfl();
        arfl.setLocalItemLit(lit);
        arfl.setAcompRealFisicoArf(arf);
        arfl.setQuantidadeArfl(bean.getQtde());
        session.save(arfl);
      }
     
      //int i = Integer.parseInt("asdasd.as;;");
     
View Full Code Here

     
      while ((linha=in.readLine()) != null) {
        // ordem dos campos: cod_lit;Dezembro/2005;
        String[] campos = linha.split(";");
        if(campos != null) {
          TempBean tempBean = new TempBean();
         
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("12"));
          tempBean.setAno(Integer.valueOf("2005"));
          tempBean.setQtde(Double.valueOf(campos[1]));
          listTempBean.add(tempBean);
        }
        registrosLidos++;
      }
     
      System.out.println("registrosLidos: " + registrosLidos);

      System.out.println("Iniciando transacao...");
      tx = session.beginTransaction();
      Dao dao = new Dao();
      AcompRealFisicoDao arfDao = new AcompRealFisicoDao(null);
      Iterator it = listTempBean.iterator();
      while(it.hasNext()) {
        TempBean bean = (TempBean)it.next();
        LocalItemLit lit = (LocalItemLit)dao.buscar(LocalItemLit.class, bean.getCodLit());
        AcompRealFisicoArf arf = arfDao.buscarPorIettir(Long.valueOf(bean.getMes()), Long.valueOf(bean.getAno()), Long.valueOf("1187"));
       
        if(lit == null || arf == null) {
          throw new Exception("lit == null || arf == null");
        }
       
        AcompRealFisicoLocalArfl arfl = new AcompRealFisicoLocalArfl();
        arfl.setLocalItemLit(lit);
        arfl.setAcompRealFisicoArf(arf);
        arfl.setQuantidadeArfl(bean.getQtde());
        session.save(arfl);
      }
     
      //int i = Integer.parseInt("asdasd.as;;");
     
View Full Code Here

     
      while ((linha=in.readLine()) != null) {
        // ordem dos campos: cod_lit;Marco/2007;
        String[] campos = linha.split(";");
        if(campos != null) {
          TempBean tempBean = new TempBean();
         
          tempBean.setCodLit(Long.valueOf(campos[0]));
          tempBean.setMes(Integer.valueOf("03"));
          tempBean.setAno(Integer.valueOf("2007"));
          tempBean.setQtde(Double.valueOf(campos[1]));
          listTempBean.add(tempBean);
        }
        registrosLidos++;
      }
     
      System.out.println("registrosLidos: " + registrosLidos);

      System.out.println("Iniciando transacao...");
      tx = session.beginTransaction();
      Dao dao = new Dao();
      AcompRealFisicoDao arfDao = new AcompRealFisicoDao(null);
      Iterator it = listTempBean.iterator();
      while(it.hasNext()) {
        TempBean bean = (TempBean)it.next();
        LocalItemLit lit = (LocalItemLit)dao.buscar(LocalItemLit.class, bean.getCodLit());
        AcompRealFisicoArf arf = arfDao.buscarPorIettir(Long.valueOf(bean.getMes()), Long.valueOf(bean.getAno()), Long.valueOf("1187"));
       
        if(lit == null || arf == null) {
          throw new Exception("lit == null || arf == null");
        }
       
        AcompRealFisicoLocalArfl arfl = new AcompRealFisicoLocalArfl();
        arfl.setLocalItemLit(lit);
        arfl.setAcompRealFisicoArf(arf);
        arfl.setQuantidadeArfl(bean.getQtde());
        session.save(arfl);
      }
     
      //int i = Integer.parseInt("asdasd.as;;");
     
View Full Code Here

     
      while ((linha=in.readLine()) != null) {
        // ordem dos campos: cod_lit;Dezembro de 2004 at� Dezembro de 2005;
        String[] campos = linha.split(";");
        if(campos != null) {
          TempBean tempBean = null;
          if(campos[1] != null && !"".equals(campos[1].trim())) {
            // Dezembro/2004
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("12"));
            tempBean.setAno(Integer.valueOf("2004"));
            tempBean.setQtde(Double.valueOf(campos[1]));
            listTempBean.add(tempBean);
          }
          if(campos[2] != null && !"".equals(campos[2].trim())) {
            // Janeiro/2005
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("1"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[2]));
            listTempBean.add(tempBean);
          }
          if(campos[3] != null && !"".equals(campos[3].trim())) {
            // Fevereiro/2005
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("2"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[3]));
            listTempBean.add(tempBean);
          }
          if(campos[4] != null && !"".equals(campos[4].trim())) {
            // Mar�o/2005
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("3"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[4]));
            listTempBean.add(tempBean);
          }
          if(campos[5] != null && !"".equals(campos[5].trim())) {
            // Abril/2005
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("4"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[5]));
            listTempBean.add(tempBean);
          }
          if(campos[6] != null && !"".equals(campos[6].trim())) {
            // Maio/2005
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("5"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[6]));
            listTempBean.add(tempBean);
          }
          if(campos[7] != null && !"".equals(campos[7].trim())) {
            // Junho/2005
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("6"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[7]));
            listTempBean.add(tempBean);
          }
          if(campos[8] != null && !"".equals(campos[8].trim())) {
            // Julho/2005
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("7"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[8]));
            listTempBean.add(tempBean);
          }
          if(campos[9] != null && !"".equals(campos[9].trim())) {
            // Agosto/2005
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("8"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[9]));
            listTempBean.add(tempBean);
          }
          if(campos[10] != null && !"".equals(campos[10].trim())) {
            // Setembro/2005
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("9"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[10]));
            listTempBean.add(tempBean);
          }
          if(campos[11] != null && !"".equals(campos[11].trim())) {
            // Outubro/2005
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("10"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[11]));
            listTempBean.add(tempBean);
          }
          if(campos[12] != null && !"".equals(campos[12].trim())) {
            // Novembro/2005
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("11"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[12]));
            listTempBean.add(tempBean);
          }
          if(campos[13] != null && !"".equals(campos[13].trim())) {
            // Dezembro/2005
            tempBean = new TempBean();
            tempBean.setCodLit(Long.valueOf(campos[0]));
            tempBean.setMes(Integer.valueOf("12"));
            tempBean.setAno(Integer.valueOf("2005"));
            tempBean.setQtde(Double.valueOf(campos[13]));
            listTempBean.add(tempBean);
          }
        }
        registrosLidos++;
      }
     
      System.out.println("registrosLidos: " + registrosLidos);

      System.out.println("Iniciando transacao...");
      tx = session.beginTransaction();
      Dao dao = new Dao();
      AcompRealFisicoDao arfDao = new AcompRealFisicoDao(null);
      Iterator it = listTempBean.iterator();
      while(it.hasNext()) {
        TempBean bean = (TempBean)it.next();
        LocalItemLit lit = (LocalItemLit)dao.buscar(LocalItemLit.class, bean.getCodLit());
        AcompRealFisicoArf arf = arfDao.buscarPorIettir(Long.valueOf(bean.getMes()), Long.valueOf(bean.getAno()), Long.valueOf("1186"));
       
        if(lit == null || arf == null) {
          throw new Exception("lit == null || arf == null");
        }
       
        AcompRealFisicoLocalArfl arfl = new AcompRealFisicoLocalArfl();
        arfl.setLocalItemLit(lit);
        arfl.setAcompRealFisicoArf(arf);
        arfl.setQuantidadeArfl(bean.getQtde());
        session.save(arfl);
      }
     
      System.out.println("Commit...");
      tx.commit();
View Full Code Here

TOP

Related Classes of ecar.bean.TempBean

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.