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

Examples of cn.org.rapid_framework.generator.ext.tableconfig.model.TableConfig.OperationConfig


    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


    assertEquals(sql.getResultClass(),"CustomUserInfo");
   
    }
   
    public OperationConfig newOperation(String name,String sql) {
      OperationConfig operation = new OperationConfig();
      operation.setSql(sql);
      operation.setName(name);
      return operation;
    }
View Full Code Here

        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);
                // table/resultmap/column
                for(NodeData c : child.childs) {
                    if("column".equals(c.nodeName)) {
                        ColumnConfig column = new ColumnConfig();
                        BeanHelper.copyProperties(column, c.attributes,true);
                        target.getColumns().add(column);
                    }
                }
                config.resultMaps.add(target);
            }
        }
View Full Code Here

TOP

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

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.