mybatis generator逆向工程

项目结构:

mybatis generator逆向工程_第1张图片

log4j.properties:

# Global logging configuration
log4j.rootLogger=DEBUG, stdout
# MyBatis logging configuration...
log4j.logger.org.mybatis.example.BlogMapper=TRACE
# Console output...
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n

MybatisGenerratorUtil.java

public class MybatisGenerratorUtil {

	public static void main(String[] args) {
		try {
			generator();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static void generator() throws Exception {
		List warnings = new ArrayList();
		boolean overwrite = true;
		File configFile = new File("generatorConfig.xml");
		ConfigurationParser cp = new ConfigurationParser(warnings);
		Configuration config = cp.parseConfiguration(configFile);
		DefaultShellCallback callback = new DefaultShellCallback(overwrite);
		MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
		myBatisGenerator.generate(null);
	}

}

generatorConfig.xml




	
		
			
			
		
		
		
		
		
		
		
		
			
		

		
		
			
			
			
			
		

		
		
			
			
		

		
		
 
  



你可能感兴趣的:(笔记)