对mybatis-generator扩展项目的配置使用介绍

    首先附上我扩展后项目的github地址:点击打开链接,接下来的目标是实现生成的java代码的合并,而不是目前的简单覆盖。
1、增加了获取sqlServer数据库字段注释的功能(官网给出的解释是JDBC不支持获取sqlServer字段注释)。
 
  

2、扩展生成Bo,table里添加boObjectName属性,对应的XML配置如下:

       targetProject="java-generator-core/src/main/java">

      

      

3、(1)table里增加了

enableInsertSelective

enableUpdateByExampleSelective属性,其默认值为true;

(2)对应的enableUpdateByExample

enableUpdateByPrimaryKey

enableInsert默认改成了false ;

(3)新增enableSelectAll

enableSelectNotDele

enableSelectNotDeleteByPrimaryKey属性,默认为false;

对应的则在Mapper中添加了相应的方法。

4、结合freemarker和XML生成了简单的Service和domain,对应的XML配置如下:

           targetProject="java-generator-core/src/main/java">

      

           targetProject="java-generator-core/src/main/java">

5、 注意:javaBoGenerator、javaServiceGenerator均为可选不进行配置,javaDomainGenerator和javaServiceGenerator成对出现(要么都配置,要么都不配置)

 

6附上整个的generatorConfig.xml,。





    
    
	
	
	
	
	
        
        
        
		
		
		
        
        
        
        
        
	
		
		
		
		
		
		
		
        
	
		
			
			
		
	
	    
		
			
		
	
	    
		
		    
			
		
	
	    
		
		    
            
            
            
            
            
            
            
            
			
		
	
	    
		
			
		
	
	    
		
			
			
            
		
	
        
        
            
            
        
    
        
        
            
        
        
            
        
    
        
		
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            ---------------------------------
            
            
                
                
                
                
                
                
                
                
                
                
            
            
            
    
		





 
 

你可能感兴趣的:(java工具类)