Mybatis逆向工程生成mapper和entity

1.pom中添加plugin让maven支持Mybatis逆向工程:

	 
          org.mybatis.generator
          mybatis-generator-maven-plugin
          1.3.2
          
            true
            true
          
          
            
            
              mysql
              mysql-connector-java
              8.0.11
              runtime
            
          
        

2、resources下面添加GeneratorConfig.xml文件





	
		
			
			
		
		
		
		
		

		
		
			
		

		
		
			
			
			
			
		
        
		
			
			
		
		
		
			
			
		
		
		

3、运行:
右键工程名run as – maven build – Goals – mybatis-generator:generate
点击apply – run ;
4、刷新后相应目录下出现mapper和entity

你可能感兴趣的:(SSM)