Package org.mybatis.generator.api

Examples of org.mybatis.generator.api.MyBatisGenerator


    {
      System.out
          .println("--------->>>Start to generate code....--------------------");
      config = cp.parseConfiguration(configFile);
      DefaultShellCallback callback = new DefaultShellCallback(overwrite);
      MyBatisGenerator myBatisGenerator = null;
      myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
      myBatisGenerator.generate(null);
      System.out
          .println("--------->>>Finished to generate code....--------------------");
    }
    catch (SQLException e)
    {
View Full Code Here


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

      DefaultShellCallback callback = new DefaultShellCallback(overwrite);

      MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);

      myBatisGenerator.generate(new AntProgressCallback(this, verbose), contexts, fullyqualifiedTables);

    } catch (XMLParserException e) {
      for (String error : e.getErrors()) {
        log(error, Project.MSG_ERR);
      }
View Full Code Here

           
        DefaultShellCallback shellCallback = new DefaultShellCallback(true);
       
        boolean gotException = false;
        try {
            MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, shellCallback, warnings);
            myBatisGenerator.generate(null);
        } catch (InvalidConfigurationException e) {
            assertEquals(3, e.getErrors().size());
            gotException = true;
        }
View Full Code Here

           
        DefaultShellCallback shellCallback = new DefaultShellCallback(true);
       
        boolean gotException = false;
        try {
            MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, shellCallback, warnings);
            myBatisGenerator.generate(null);
        } catch (InvalidConfigurationException e) {
            assertEquals(1, e.getErrors().size());
            gotException = true;
        }
View Full Code Here

      Configuration config = cp
          .parseConfiguration(this.getClass().getClassLoader().getResourceAsStream(fileName));

      DefaultShellCallback shellCallback = new DefaultShellCallback(true);

      MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, shellCallback, warnings);
      myBatisGenerator.generate(null);
    } catch (Exception e) {
      logger.error("Exception:", e);
    }
  }
View Full Code Here

        Configuration config = cp.parseConfiguration(this.getClass().getClassLoader().getResourceAsStream("generatorConfigMyBatis3.xml"));
           
        DefaultShellCallback shellCallback = new DefaultShellCallback(true);
       
        try {
            MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, shellCallback, warnings);
            myBatisGenerator.generate(null);
        } catch (InvalidConfigurationException e) {
            assertEquals(2, e.getErrors().size());
            throw e;
        }
    }
View Full Code Here

        Configuration config = cp.parseConfiguration(this.getClass().getClassLoader().getResourceAsStream("generatorConfigIbatis2.xml"));
           
        DefaultShellCallback shellCallback = new DefaultShellCallback(true);
       
        try {
            MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, shellCallback, warnings);
            myBatisGenerator.generate(null);
        } catch (InvalidConfigurationException e) {
            assertEquals(1, e.getErrors().size());
            throw e;
        }
    }
View Full Code Here

                    project.getProperties(), warnings);
            Configuration config = cp.parseConfiguration(configurationFile);

            ShellCallback callback = new MavenShellCallback(this, overwrite);

            MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config,
                    callback, warnings);

            myBatisGenerator.generate(new MavenProgressCallback(getLog(),
                    verbose), contextsToRun, fullyqualifiedTables);

        } catch (XMLParserException e) {
            for (String error : e.getErrors()) {
                getLog().error(error);
View Full Code Here

                    .parseConfiguration(configurationFile);

            subMonitor.worked(50);
            monitor.subTask("Generating Files from Database Tables");
           
            MyBatisGenerator generator = new MyBatisGenerator(config, new EclipseShellCallback(),
                    warnings);

            EclipseProgressCallback progressCallback = new EclipseProgressCallback(subMonitor.newChild(950));

            generator.generate(progressCallback, contexts, fullyqualifiedTables);

        } catch (XMLParserException e) {
            for (String error : e.getErrors()) {
                log(error, Project.MSG_ERR);
            }
View Full Code Here

                    warnings);
            Configuration config = cp.parseConfiguration(inputFile.getLocation().toFile());

            subMonitor.worked(50);

            MyBatisGenerator mybatisGenerator = new MyBatisGenerator(config, new EclipseShellCallback(), warnings);
            monitor.subTask("Generating Files from Database Tables");
            SubMonitor spm = subMonitor.newChild(950);
            mybatisGenerator.generate(new EclipseProgressCallback(spm));

        } catch (InterruptedException e) {
            throw new OperationCanceledException();
        } catch (SQLException e) {
            Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID,
View Full Code Here

TOP

Related Classes of org.mybatis.generator.api.MyBatisGenerator

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.