mybatis自动生成器生成所有表

参考:Mybatis-generator自动生成器。

基于参考链接内容,本文描述如何自动生成所有表。(注意:所有表不包括数据库的配置表,比如只包括oracle的SCOTT用户中的表)





<generatorConfiguration>
    
    <classPathEntry  location="D:\jars\com\oracle\ojdbc6\11.2.0.4.0\ojdbc6-11.2.0.4.0.jar"/>
    <context id="DB2Tables"  targetRuntime="MyBatis3">
        <commentGenerator>
            <property name="suppressDate" value="true"/>
            
            <property name="suppressAllComments" value="true"/>
        commentGenerator>
        
        <jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver" connectionURL="jdbc:oracle:thin://127.0.0.1:1521/orcl" userId="scott" password="tiger">
        jdbcConnection>
        <javaTypeResolver>
            <property name="forceBigDecimals" value="false"/>
        javaTypeResolver>
        
        <javaModelGenerator targetPackage="com.demo.model" targetProject="src/main/java">
            <property name="enableSubPackages" value="false"/>
            <property name="trimStrings" value="true"/>
        javaModelGenerator>
        
        <sqlMapGenerator targetPackage="mapping" targetProject="src/main/resources">
            <property name="enableSubPackages" value="false"/>
        sqlMapGenerator>
        
        <javaClientGenerator type="XMLMAPPER" targetPackage="com.demo.mapper" targetProject="src/main/java">
            <property name="enableSubPackages" value="false"/>
        javaClientGenerator>
        

		
        <table tableName="%" schema="SCOTT" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" >table>
    context>
generatorConfiguration>

你可能感兴趣的:(mybatis,idea)