<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" > <generatorConfiguration> <classPathEntry <!-- 驅動的絕對路徑 --> location="D:\maven\repository\org\postgresql\postgresql\9.3-1103-jdbc41\postgresql-9.3-1103-jdbc41.jar" /> <context id="context1"> <commentGenerator> <property name="suppressAllComments" value="true" /><!-- 是否取消注釋 --> <property name="suppressDate" value="false" /> <!-- 是否生成注釋代時間戳 --> </commentGenerator> <jdbcConnection driverClass="org.postgresql.Driver" connectionURL="jdbc:postgresql://192.168.1.1:14132/dev" userId="userId" password="password" /> <!-- targetPackage是目標包名, targetProject是包所在的位置--> <!-- javaModelGenerator生成的是實體類, sqlMapGenerator生成的是映射文件, javaClientGenerator生成的是dao --> <javaModelGenerator targetPackage="auto.dto" targetProject="testProject\src\main\java" /> <sqlMapGenerator targetPackage="auto.xml" targetProject="testProject\src\main\java" /> <javaClientGenerator targetPackage="auto.dao" targetProject="testProject\src\main\java" type="XMLMAPPER" /> <!-- domainObjectName是表對應的實體類名, tableName是對應的表名--> <!-- table可以配置多個,enable*幾個參數是為了自動生成一些額外的sql操作,可以關閉--> <table domainObjectName="StudentInfoDto" tableName="student_info" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> </table> <table domainObjectName="TeacherInfoDto" tableName="teacher_info" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> </table> </context> </generatorConfiguration>