Examples of ImportBean


Examples of com.asakusafw.bulkloader.bean.ImportBean

     * Updates a cache (DFS may be rollbacked).
     * @throws Exception if failed
     */
    @Test
    public void update_cache_dfs_rollback() throws Exception {
        ImportBean bean = createBean();

        Map<String, ImportTargetTableBean> targetTable = new HashMap<String, ImportTargetTableBean>();

        final ImportTargetTableBean tb1 = new ImportTargetTableBean();
        tb1.setCacheId("tb1");
        tb1.setDfsFilePath("tb1");
        tb1.setImportTargetType(ImportTarget1.class);
        tb1.setImportTargetColumns(Arrays.asList("A"));
        tb1.setSearchCondition("");
        targetTable.put("__TG_TEST1", tb1);

        Connection conn = DBConnection.getConnection();
        try {
            LocalCacheInfoRepository repo = new LocalCacheInfoRepository(conn);
            repo.putCacheInfo(new LocalCacheInfo(
                    tb1.getCacheId(),
                    null,
                    offset(-1),
                    "__TG_TEST1",
                    tb1.getDfsFilePath()));

        } finally {
            DBConnection.closeConn(conn);
        }

        bean.setTargetTable(targetTable);
        ImportProtocolDecide service = new ImportProtocolDecide() {
            @Override
            protected Map<String, CacheInfo> collectRemoteCacheInfo(ImportBean _)
                    throws BulkLoaderSystemException {
                return Collections.singletonMap("tb1", new CacheInfo(
View Full Code Here

Examples of com.ordobill.webapp.beans.ImportBean

    XSSFWorkbook wb = new XSSFWorkbook(data);
   
    Sheet sheet = wb.getSheetAt(0);
    if (sheet != null) {
      while (true) {
        ImportBean importBean = new ImportBean();
        row = sheet.getRow(fieldsize);
        //System.out.println(row.getPhysicalNumberOfCells());
        try {
          if (row.getCell(0).equals(null)) {
            break;
          }
          importBean.setSubsystem(row.getCell(0).toString().trim());
          importBean.setCategory(row.getCell(1).toString().trim());
          importBean.setItem(row.getCell(2).toString().trim());
          importBean.setFail_mode(row.getCell(3).toString().trim());
          importBean.setFailure_distribution(row.getCell(4).toString().trim());
          importBean.setFparam1(chkCellfloat(row.getCell(5)));
          importBean.setFparam2(chkCellfloat(row.getCell(6)));
          importBean.setFparam3(chkCellfloat(row.getCell(7)));
          //importBean.setFparam3(row.getCell(7));
          importBean.setRparam1(chkCellfloat(row.getCell(8)));
          importBean.setRparam2(chkCellfloat(row.getCell(9)));
          importBean.setRparam3(chkCellfloat(row.getCell(10)));
          importBean.setFailure(chkCellfloat(row.getCell(11)));
          importBean.setRepair(chkCellfloat(row.getCell(12)));
          importBean.setConnection((int)row.getCell(13).getNumericCellValue());
          importBean.setUserID(pro_id);
          resultdata.add(rowSize, importBean);
          fieldsize++;
          rowSize++;
          System.out.println(resultdata.size());
        } catch(NullPointerException e) {
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.