generatorConfig.xml文件配置
发布时间:2020-12-16 06:15:33 所属栏目:百科 来源:网络整理
导读:?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 locat
<?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:/lib/postgresql-9.4-1201-jdbc41.jar" /> <context id="MysqlContext" targetRuntime="MyBatis3" defaultModelType="flat" > <property name="beginningDelimiter" value="`"/> <property name="endingDelimiter" value="`"/> <commentGenerator> <property name="suppressDate" value="true"/> </commentGenerator> <jdbcConnection driverClass="org.postgresql.Driver" connectionURL="jdbc:postgresql://localhost/demo" userId="postgres" password="postgres" /> <javaModelGenerator targetPackage="gxfw.service.client" targetProject="gxfw.service" > <property name="enableSubPackages" value="true" /> <property name="trimStrings" value="true" /> </javaModelGenerator> <sqlMapGenerator targetPackage="gxfw.service.client" targetProject="gxfw.service" > <property name="enableSubPackages" value="true" /> </sqlMapGenerator> <javaClientGenerator targetPackage="gxfw.service.client" targetProject="gxfw.service" type="XMLMAPPER" > <property name="enableSubPackages" value="true" /> </javaClientGenerator> <table tableName="days_user" domainObjectName="User" > <generatedKey column="id" sqlStatement="JDBC"/> </table> </context> </generatorConfiguration> 如果 使用maven来管理lib,在 pom.xml文件中配置 mybatis-generator-maven-pluginer,就可以不需要使用<classPathEntry location="D:/lib/postgresql-9.4-1201-jdbc41.jar" />了 pom.xml的配置如下 <dependency> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin</artifactId> <version>1.3.2</version> </dependency> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |