Mybatis学习(一):Mybatis GeneratorConfig.xml配置





<generatorConfiguration>
    
    <properties resource="osmall.properties">properties>
    
    <classPathEntry location="${db.driverLocation}"/>
    
    <context id="default" targetRuntime="MyBatis3" defaultModelType="flat">
        
        <property name="autoDelimitKeywords" value="true"/>
        <property name="beginningDelimiter" value="`"/>
        <property name="endingDelimiter" value="`"/>
        
        
        

        
        <plugin type="org.mybatis.generator.plugins.CachePlugin">
            <property name="cache_eviction" value="LRU"/>
            <property name="cache_size" value="1024"/>
        plugin>

        
        <commentGenerator type="com.osmall.util.MyCommentGenerator">
            <property name="suppressDate" value="true"/>
            <property name="suppressAllComments" value="true"/>
            <property name="addRemarkComments" value="true"/>
        commentGenerator>

        
        <jdbcConnection
                driverClass="${db.driverClassName}"
                connectionURL="${db.url}"
                userId="${db.username}"
                password="${db.password}">
        jdbcConnection>

        
        <javaTypeResolver>
            
            <property name="forceBigDecimals" value="false"/>
        javaTypeResolver>


        
        <javaModelGenerator targetPackage="com.osmall.model.pojo" targetProject="./src/main/java">
            
            <property name="enableSubPackages" value="false"/>
            
            <property name="constructorBased" value="true"/>
            
            <property name="trimStrings" value="true"/>
            
            <property name="immutable" value="false"/>
            
            
        javaModelGenerator>

        
        <sqlMapGenerator targetPackage="mappers" targetProject="./src/main/resources">
            
            <property name="enableSubPackages" value="false"/>
        sqlMapGenerator>

        
        
        <javaClientGenerator type="XMLMAPPER"
                             targetPackage="com.osmall.dao"
                             targetProject="./src/main/java">
            
            <property name="enableSubPackages" value="false" />
        javaClientGenerator>

        
        
        <table tableName="sys_user"
               domainObjectName="SysUser"
               enableCountByExample="false"
               enableUpdateByExample="false"
               enableDeleteByExample="false"
               enableSelectByExample="false"
               selectByExampleQueryId="false">table>
    context>
generatorConfiguration>

你可能感兴趣的:(MyBatis)