Package cn.org.rapid_framework.generator.ext.tableconfig.model

Examples of cn.org.rapid_framework.generator.ext.tableconfig.model.TableConfig$Convert2SqlsProecssor


    gf.getGenerator().addTemplateRootDir(FileHelper.getFileByClassLoader("for_generate_by_table_config_set"));
    gf.generateByMap(map);
  }
 
  public void testload() throws IOException {
      TableConfig config = new TableConfigXmlBuilder().parseFromXML(FileHelper.getFileByClassLoader("for_test_table_config_xml_builder/pdc_card.xml"));
      OperationConfig oc = config.getOperation("getRealNameCardsByParentCardNo");
      assertTrue(oc.getSql().indexOf("WHERE parent_card_no = ?  AND status = ? AND type = 'R'") >= 0);
      assertFalse(oc.getSql(),oc.getSql().indexOf("<dynamic>") >= 0);
      assertTrue(oc.getSqlmap().indexOf("<dynamic>") >= 0);
      assertFalse(oc.getSqlmap().indexOf("WHERE parent_card_no = ?  AND status = ? AND type = 'R'") >= 0);
      for(Object item : config.getOperations()) {
      }
  }
View Full Code Here


    }
  }
 
    public TableConfig parseFromXML(InputStream inputStream) throws SAXException, IOException {
        NodeData nodeData = new XMLHelper().parseXML(inputStream);
        TableConfig config = new TableConfig();
       
        // table
        BeanHelper.copyProperties(config, nodeData.attributes,true);
       
        for(NodeData child : nodeData.childs) {
            // table/operation
            if("operation".equals(child.nodeName)) {
                OperationConfig target = new OperationConfig();
                BeanHelper.copyProperties(target, child.attributes,true);
                for(NodeData opChild : child.childs) {
                    // table/operation/extraparams
                    if("extraparams".equals(opChild.nodeName)) {
                        // table/operation/extraparams/param
                        for(NodeData paramNode : opChild.childs) {
                            ParamConfig mp = new ParamConfig();
                            BeanHelper.copyProperties(mp, paramNode.attributes,true);
                            target.extraparams.add(mp);
                        }
                    }else {
                        BeanHelper.setProperty(target, opChild.nodeName, getNodeValue(opChild));
                    }
                }
                config.operations.add(target);
            }
            // table/column
            if("column".equals(child.nodeName)) {
                ColumnConfig target = new ColumnConfig();
                BeanHelper.copyProperties(target, child.attributes,true);
                config.columns.add(target);
            }
            // table/sql
            if("sql".equals(child.nodeName)) {
                SqlConfig target = new SqlConfig();
                BeanHelper.copyProperties(target, child.attributes,true);
                target.setSql(getNodeValue(child));
                config.addSqlConfig(target);
            }
            // table/resultmap
            if("resultmap".equals(child.nodeName)) {
                ResultMapConfig target = new ResultMapConfig();
                BeanHelper.copyProperties(target, child.attributes,true);
View Full Code Here

  @Override
    protected List<Map> getGeneratorContexts() {
        if("*".equals(tableSqlName)) {
            return toMaps(tableConfigSet.getTableConfigs());
        }else {
            TableConfig tableConfig = tableConfigSet.getBySqlName(tableSqlName);
            if(tableConfig == null) {
                log("根据表名"+tableSqlName+"没有找到配置文件");
                return null;
            }
            Map map = toMap(tableConfig);
View Full Code Here

            for(TableConfig tableConfig : tableConfigSet.getTableConfigs()) {
                result.addAll(toMaps(tableConfig));
            }
            return result;
        }else {
            TableConfig tableConfig = tableConfigSet.getBySqlName(tableSqlName);
            if(tableConfig == null) {
                log("根据表名"+tableSqlName+"没有找到配置文件");
                return null;
            }
            List<Map> result = toMaps(tableConfig);
View Full Code Here

TOP

Related Classes of cn.org.rapid_framework.generator.ext.tableconfig.model.TableConfig$Convert2SqlsProecssor

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.