Package org.mybatis.generator.config

Examples of org.mybatis.generator.config.Configuration


    boolean overwrite = true;
    String genCfg = "generatorConfig.xml";
    File configFile = new File(MyBatisGeneratorTool.class.getResource(
        genCfg).getFile());
    ConfigurationParser cp = new ConfigurationParser(warnings);
    Configuration config = null;
    try
    {
      System.out
          .println("--------->>>Start to generate code....--------------------");
      config = cp.parseConfiguration(configFile);
View Full Code Here


      if (parseErrors.size() > 0) {
        throw new XMLParserException(parseErrors);
      }

      Configuration config;
      Element rootNode = document.getDocumentElement();
      DocumentType docType = document.getDoctype();
      if (rootNode.getNodeType() == Node.ELEMENT_NODE
          && docType.getPublicId().equals(XmlConstants.IBATOR_CONFIG_PUBLIC_ID)) {
        config = parseIbatorConfiguration(rootNode);
View Full Code Here

    }
  }

  public Configuration parseIbatorConfiguration(Element rootNode) throws XMLParserException {

    Configuration configuration = new Configuration();

    NodeList nodeList = rootNode.getChildNodes();
    for (int i = 0; i < nodeList.getLength(); i++) {
      Node childNode = nodeList.item(i);
View Full Code Here

    }
  }

  public Configuration parseConfiguration(Element rootNode) throws XMLParserException {

    Configuration configuration = new Configuration();

    NodeList nodeList = rootNode.getChildNodes();
    for (int i = 0; i < nodeList.getLength(); i++) {
      Node childNode = nodeList.item(i);
View Full Code Here

      }
    }

    try {
      ConfigurationParser cp = new ConfigurationParser(warnings);
      Configuration config = cp.parseConfiguration(configurationFile);

      DefaultShellCallback shellCallback = new DefaultShellCallback(arguments.containsKey(OVERWRITE));

      MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, shellCallback, warnings);
View Full Code Here

    try {
      Properties p = propertyset == null ? null : propertyset.getProperties();

      ConfigurationParser cp = new ConfigurationParser(p, warnings);
      Configuration config = cp.parseConfiguration(configurationFile);

      DefaultShellCallback callback = new DefaultShellCallback(overwrite);

      MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
View Full Code Here

    @Test
    public void testGenerateMyBatis3() throws Exception {
        List<String> warnings = new ArrayList<String>();
        ConfigurationParser cp = new ConfigurationParser(warnings);
        Configuration config = cp.parseConfiguration(this.getClass().getClassLoader().getResourceAsStream("generatorConfigMyBatis3.xml"));
           
        DefaultShellCallback shellCallback = new DefaultShellCallback(true);
       
        boolean gotException = false;
        try {
View Full Code Here

    @Test
    public void testGenerateIbatis2() throws Exception {
        List<String> warnings = new ArrayList<String>();
        ConfigurationParser cp = new ConfigurationParser(warnings);
        Configuration config = cp.parseConfiguration(this.getClass().getClassLoader().getResourceAsStream("generatorConfigIbatis2.xml"));
           
        DefaultShellCallback shellCallback = new DefaultShellCallback(true);
       
        boolean gotException = false;
        try {
View Full Code Here

  public void main1(String fileName) {
    try {
      List<String> warnings = new ArrayList<String>();
      ConfigurationParser cp = new ConfigurationParser(warnings);
      Configuration config = cp
          .parseConfiguration(this.getClass().getClassLoader().getResourceAsStream(fileName));

      DefaultShellCallback shellCallback = new DefaultShellCallback(true);

      MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, shellCallback, warnings);
View Full Code Here

    }

    public Configuration parseConfiguration(Element rootNode)
            throws XMLParserException {

        Configuration configuration = new Configuration();

        NodeList nodeList = rootNode.getChildNodes();
        for (int i = 0; i < nodeList.getLength(); i++) {
            Node childNode = nodeList.item(i);
View Full Code Here

TOP

Related Classes of org.mybatis.generator.config.Configuration

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.