package com.chenyang.nse.bussiness.engine.infa.powercenter961.bakdata;

import com.chenyang.nse.bussiness.engine.infa.InfoProperty;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.CONFIG;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.FOLDER;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.MAPPING;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.MAPPLET;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.POWERMART;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.REPOSITORY;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.SOURCE;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.TARGET;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.WORKFLOW;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata.Configutil;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata.Folderutil;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata.ParamBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata.Powermartutil;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata.Repositoryutil;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.CommonBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.MappingBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.MappingPramaBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.MappletMakeDatabean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.SourceBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.TargetBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.WorkflowBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubtool.InfoExecUtil;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubtool.ToObjutil;
import com.chenyang.nse.bussiness.tools.io.FileTool;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;

public class MakeBakUtil {
   public static void bakMasking(ParamBean par_bean, InfoProperty tengine, SourceBean sou_bean, TargetBean tar_bean_file, TargetBean tar_bean_database, List<MappletMakeDatabean> mapplet, List<MappingPramaBean> paramList) {
      new POWERMART();
      POWERMART powermart = Powermartutil.getPowermart(par_bean);
      new REPOSITORY();
      REPOSITORY repository = Repositoryutil.getREPOSITORY(par_bean, tengine);
      new FOLDER();
      FOLDER folder = Folderutil.getFolder(par_bean);
      new SOURCE();
      SOURCE source = SourceUtil.getSource(sou_bean);
      folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(source);
      new TARGET();
      TARGET target_file = TargetUtil.getTatget(tar_bean_file);
      folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(target_file);
      new TARGET();
      TARGET target_dbase = TargetUtil.getTatget(tar_bean_database);
      folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(target_dbase);
      FileTool.createFolder(tengine.getXmldir() + File.separator + "mapplet");
      List<String> maplist = new ArrayList();
      List<MappletMakeDatabean> map = new ArrayList();
      if (mapplet != null && mapplet.size() > 0) {
         for(int i = 0; i < mapplet.size(); ++i) {
            if (i == 0) {
               map.add(mapplet.get(i));
               maplist.add(((MappletMakeDatabean)mapplet.get(i)).getMappletname());
            } else if (!maplist.contains(((MappletMakeDatabean)mapplet.get(i)).getMappletname())) {
               map.add(mapplet.get(i));
            }
         }
      }

      if (map != null && map.size() > 0) {
         for(int i = 0; i < map.size(); ++i) {
            try {
               InfoExecUtil.exeobjectexportmapplet(tengine.getPmrepexepath(), "cs_mapplet", ((MappletMakeDatabean)map.get(i)).getMappletname(), tengine.getXmldir() + File.separator + "cs_mapplet" + File.separator + ((MappletMakeDatabean)map.get(i)).getMappletname());
               InputStream is = new FileInputStream(tengine.getXmldir() + File.separator + "cs_mapplet" + File.separator + ((MappletMakeDatabean)map.get(i)).getMappletname() + ".xml");
               ToObjutil to = new ToObjutil();
               BufferedReader tBufferedReader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
               int k = 0;
               StringBuffer tStringBuffer = new StringBuffer();
               new String("");

               String mapping;
               while((mapping = tBufferedReader.readLine()) != null) {
                  ++k;
                  if (k == 2) {
                     tStringBuffer.append("");
                  } else {
                     tStringBuffer.append(mapping);
                  }
               }

               Object obj = ToObjutil.unmarshalmo("com.chenyang.nse.bussiness.engine.infa.basic.xmlbean", tStringBuffer.toString());
               POWERMART power = (POWERMART)obj;
               List<REPOSITORY> repositorListWf = power.getREPOSITORY();
               new MAPPLET();

               for(int l = 0; l < repositorListWf.size(); ++l) {
                  REPOSITORY repositor = (REPOSITORY)repositorListWf.get(l);
                  List<FOLDER> folderList = repositor.getFOLDER();

                  for(int j = 0; j < folderList.size(); ++j) {
                     FOLDER folder1 = (FOLDER)folderList.get(j);

                     for(Object object1 : folder1.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO()) {
                        if (object1.getClass().getName().equals("com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.MAPPLET")) {
                           MAPPLET workflow = (MAPPLET)object1;
                           folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(workflow);
                        }
                     }
                  }
               }
            } catch (Exception e) {
               e.printStackTrace();
            }
         }
      }

      MappingBean map_bean = new MappingBean();
      map_bean.setSou_bean(sou_bean);
      map_bean.setTar_bean(tar_bean_file);
      map_bean.setTar_bean_dbase(tar_bean_database);
      map_bean.setMapping_name("mp_" + sou_bean.getSo_name());
      map_bean.setSq_name("SQ_" + sou_bean.getSo_name());
      map_bean.setMappingsql(par_bean.getMappingsql());
      map_bean.setSource_name(sou_bean.getSo_name());
      map_bean.setSourcedbname(sou_bean.getDbdname());
      map_bean.setMappletbean(mapplet);
      map_bean.setParamList(paramList);
      if ("Flat File".equalsIgnoreCase(sou_bean.getDatabasetype())) {
         map_bean.setSourcedbtype("Flat File");
      }

      CommonBean mapping_cd = new CommonBean();
      CommonBean cblist = sou_bean.getCb();
      List<String> map_typeList = new ArrayList();
      List<String> map_precisionList = new ArrayList();
      List<String> map_scaleList = new ArrayList();
      if ("DB2".equals(sou_bean.getDatabasetype())) {
         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("character".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("double".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("numeric".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("char".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("date".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("time".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("timestamp".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("clob".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("blob".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("smallint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("DECFLOAT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else {
               map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            }
         }
      } else if ("AS400".equals(sou_bean.getDatabasetype())) {
         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("BIGINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("bigint");
               map_precisionList.add("19");
               map_scaleList.add("0");
            } else if ("BLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("1048576");
               map_scaleList.add("0");
            } else if ("CHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("CHAR () FOR BIT DATA".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("CLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add("1048576");
               map_scaleList.add("0");
            } else if ("DATE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("DBCLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("1048576");
               map_scaleList.add("0");
            } else if ("DECFLOAT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add("0");
            } else if ("DECIMAL".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("DOUBLE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("GRAPHIC".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("INTEGER".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add("10");
               map_scaleList.add("0");
            } else if ("LONG VARCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add("32700");
               map_scaleList.add("0");
            } else if ("LONG VARGRAPHIC".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("16350");
               map_scaleList.add("0");
            } else if ("REAL".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add("0");
            } else if ("SMALLINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("TIME".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("TIMESTAMP".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("VARCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("VARCHAR () FOR BIT DATA".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("255");
               map_scaleList.add("0");
            } else if ("VARGRAPHIC".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add("255");
               map_scaleList.add("0");
            } else if ("XML".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("4000");
               map_scaleList.add("0");
            } else {
               map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            }
         }
      } else if ("ORACLE".equals(sou_bean.getDatabasetype())) {
         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("TIMESTAMP(6)".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("number(p,s)".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add("15");
            } else if ("NUMBER".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add("15");
            } else if ("DATE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("VARBINARY".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("BIGINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("TIME".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("NUMERIC".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("CHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("BIT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("SMALLINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("BLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("VARCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("DECIMAL".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("CLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("REAL".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("NCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("NCLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("FLOAT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("LONGVARCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("TINYINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("INTEGER".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("NVARCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("VARCHAR2".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("LONG".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add("4000");
               map_scaleList.add("0");
            } else {
               map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            }
         }
      } else if ("Flat File".equals(sou_bean.getDatabasetype())) {
         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("datetime".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("int".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("number".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else {
               map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            }
         }
      } else if ("INFORMIX".equals(sou_bean.getDatabasetype())) {
         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("blob".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("4000");
               map_scaleList.add("0");
            } else if ("boolean".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("byte".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("29");
               map_scaleList.add("0");
            } else if ("char".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("clob".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add("4000");
               map_scaleList.add("0");
            } else if ("date".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("datetime".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("float".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add("0");
            } else if ("int8".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("bigint");
               map_precisionList.add("19");
               map_scaleList.add("0");
            } else if ("int".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add("10");
               map_scaleList.add("0");
            } else if ("lvarchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("money".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add("16");
               map_scaleList.add("2");
            } else if ("nchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("nvarchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("serial".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add("10");
               map_scaleList.add("0");
            } else if ("serial8".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("bigint");
               map_precisionList.add("19");
               map_scaleList.add("0");
            } else if ("smallfloat".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("real");
               map_precisionList.add("7");
               map_scaleList.add("0");
            } else if ("smallint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("decimal".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else {
               map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            }
         }
      } else if ("MSSQLSERVER".equals(sou_bean.getDatabasetype())) {
         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("bigint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("bigint");
               map_precisionList.add("19");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("binary".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("float".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add("0");
            } else if ("bit".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add("1");
               map_scaleList.add("0");
            } else if ("char".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("date".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("datetime".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("datetime2".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("datetimeoffset".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add("34");
               map_scaleList.add("0");
            } else if ("decimal".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("real".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("real");
               map_precisionList.add("7");
               map_scaleList.add("0");
            } else if ("geography".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("geometry".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("hierarchyid".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add("892");
               map_scaleList.add("0");
            } else if ("image".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("4000");
               map_scaleList.add("0");
            } else if ("int".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add("10");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("money".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add("19");
               map_scaleList.add("4");
            } else if ("nchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("ntext".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("numeric".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("nvarchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("real".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("real");
               map_precisionList.add("7");
               map_scaleList.add("0");
            } else if ("smalldatetime".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("smallint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("smallmoney".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add("10");
               map_scaleList.add("4");
            } else if ("sql_variant".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add("8000");
               map_scaleList.add("4");
            } else if ("sysname".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add("128");
               map_scaleList.add("4");
            } else if ("text".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add("4000");
               map_scaleList.add("0");
            } else if ("time".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("timestamp".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("8");
               map_scaleList.add("0");
            } else if ("tinyint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("uniqueidentifier".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add("38");
               map_scaleList.add("0");
            } else if ("varbinary".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else {
               map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            }
         }
      } else if ("MYSQL".equals(sou_bean.getDatabasetype())) {
         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("TINYINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("SMALLINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("MEDIUMINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("INT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("BIGINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("bigint");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("BIT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("DOUBLE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add("0");
            } else if ("FLOAT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("real");
               map_precisionList.add("7");
               map_scaleList.add("0");
            } else if ("DECIMAL".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add("65");
               map_scaleList.add("0");
            } else if ("CHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add("255");
               map_scaleList.add("0");
            } else if ("VARCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("DATE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("TIME".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("YEAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("TIMESTAMP".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("DATETIME".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("TINYBLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("255");
               map_scaleList.add("0");
            } else if ("BLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("65535");
               map_scaleList.add("0");
            } else if ("MEDIUMBLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("16777215");
               map_scaleList.add("0");
            } else if ("LONGBLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("-1");
               map_scaleList.add("0");
            } else if ("TINYTEXT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("255");
               map_scaleList.add("0");
            } else if ("TEXT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("65535");
               map_scaleList.add("9");
            } else if ("MEDIUMTEXT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("16777215");
               map_scaleList.add("0");
            } else if ("LONGTEXT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("-1");
               map_scaleList.add("0");
            } else if ("ENUM".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add("0");
               map_scaleList.add("0");
            } else if ("SET".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add("0");
               map_scaleList.add("0");
            } else if ("BINARY".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("255");
               map_scaleList.add("0");
            } else if ("VARBINARY".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("255");
               map_scaleList.add("0");
            } else if ("POINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("-1");
               map_scaleList.add("0");
            } else if ("LINESTRING".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("-1");
               map_scaleList.add("0");
            } else if ("POLYGON".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("-1");
               map_scaleList.add("0");
            } else if ("GEOMETRY".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("-1");
               map_scaleList.add("0");
            } else if ("MULTIPOINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("-1");
               map_scaleList.add("0");
            } else if ("MULTILINESTRING".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("-1");
               map_scaleList.add("0");
            } else if ("MULTIPOLYGON".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("-1");
               map_scaleList.add("0");
            } else if ("GEOMETRYCOLLECTION".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("-1");
               map_scaleList.add("0");
            } else {
               map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            }
         }
      } else if ("SYBASE".equals(sou_bean.getDatabasetype())) {
         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("bigint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("bigint");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("binary".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("bit".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("char".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("date".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("datetime".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("decimal".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("float".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("image".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("4000");
               map_scaleList.add("0");
            } else if ("int".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("longsysname".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add("255");
               map_scaleList.add("0");
            } else if ("nchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("nvarchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("money".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add("19");
               map_scaleList.add("4");
            } else if ("real".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("real");
               map_precisionList.add("7");
               map_scaleList.add("0");
            } else if ("smalldatetime".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("smallint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("smallmoney".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add("10");
               map_scaleList.add("4");
            } else if ("sysname".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add("100");
               map_scaleList.add("0");
            } else if ("timestamp".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("8");
               map_scaleList.add("0");
            } else if ("text".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add("4000");
               map_scaleList.add("0");
            } else if ("time".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("varbinary".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("tinyint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("unichar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add("200");
               map_scaleList.add("0");
            } else if ("unitext".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add("4000");
               map_scaleList.add("9");
            } else if ("univarchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add("200");
               map_scaleList.add("0");
            } else if ("unsigned bigint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("bigint");
               map_precisionList.add("19");
               map_scaleList.add("0");
            } else if ("unsigned int".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add("10");
               map_scaleList.add("0");
            } else if ("unsigned smallint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else {
               map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            }
         }
      }

      mapping_cd.setNameList(cblist.getNameList());
      mapping_cd.setMappingLengthList(map_precisionList);
      mapping_cd.setMappingTypeList(map_typeList);
      mapping_cd.setMappingScalelist(map_scaleList);
      map_bean.setCb(mapping_cd);
      new MAPPING();
      MappingUtil mu = new MappingUtil();

      try {
         MAPPING var51 = mu.getMapping(map_bean);
         folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(var51);
         new CONFIG();
         CONFIG var53 = Configutil.getConfig();
         folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(var53);
         WorkflowBean work_bean = new WorkflowBean();
         work_bean.setWorkflow_name("wf_" + sou_bean.getSo_name());
         work_bean.setMapping_name(map_bean.getMapping_name());
         work_bean.setSourcename(sou_bean.getSo_name());
         work_bean.setTargetname(tar_bean_file.getTar_name());
         work_bean.setSqname(map_bean.getSq_name());
         work_bean.setTargetdbname(tar_bean_file.getTar_name());
         work_bean.setSourcedbname(sou_bean.getSo_name());
         work_bean.setSourceownername(sou_bean.getSourceownername());
         work_bean.setTargetownername(tar_bean_file.getTargetownername());
         work_bean.setMappletbean(mapplet);
         work_bean.setSou_linkname(sou_bean.getLinkname());
         work_bean.setTar_linkname(tar_bean_file.getLinkname());
         work_bean.setParampath(par_bean.getParam_path());
         work_bean.setSource_dbtype(sou_bean.getDatabasetype());
         work_bean.setTarget_dbtype(tar_bean_file.getDatabasetype());
         work_bean.setS_file_name(sou_bean.getFilename());
         work_bean.setT_file_name(tar_bean_file.getFilename());
         work_bean.setS_file_path(sou_bean.getFilepath());
         work_bean.setT_file_path(tar_bean_file.getFilepath());
         new WORKFLOW();
         WorkflowUtil wu = new WorkflowUtil();
         WORKFLOW var55 = wu.getWorkflow(sou_bean, tar_bean_file, tar_bean_database, work_bean, tengine);
         folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(var55);
         repository.getFOLDER().add(folder);
         powermart.getREPOSITORY().add(repository);
         List<Object> alllist = new ArrayList();
         alllist.add(powermart);
         OutputStream f = null;
         String xmlFileStr = "masking_task";
         FileTool.createFolder(tengine.getXmldir() + File.separator + xmlFileStr + File.separator + par_bean.getTaskname());
         OutputStream var59 = new FileOutputStream(tengine.getXmldir() + File.separator + xmlFileStr + File.separator + par_bean.getTaskname() + File.separator + sou_bean.getSo_name() + ".xml");
         ToObjutil.marshalmapplet("com.chenyang.nse.bussiness.engine.infa.basic.xmlbean", alllist, var59, "");
      } catch (Exception e) {
         e.printStackTrace();
      }

   }
}
