01 用Maven插件生成Mybatis代码
[url]http://blog.youkuaiyun.com/gufeng672/article/details/27196347[/url]
02 generatorConfig.xml文件配置
[url]http://stackoverflow.com/questions/32806225/mybatis-cannot-generator-using-oracle-database[/url]
03 MyBatis Generator官网
[url]http://www.mybatis.org/generator/running/runningWithMaven.html[/url]
04 我的问题:classPathEntry的配置。以下是我的配置文件:
[url]http://blog.youkuaiyun.com/gufeng672/article/details/27196347[/url]
02 generatorConfig.xml文件配置
[url]http://stackoverflow.com/questions/32806225/mybatis-cannot-generator-using-oracle-database[/url]
03 MyBatis Generator官网
[url]http://www.mybatis.org/generator/running/runningWithMaven.html[/url]
04 我的问题:classPathEntry的配置。以下是我的配置文件:
<?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">
<!-- 使用 mvn mybatis-generator:generate -->
<generatorConfiguration>
<properties resource="jdbc.properties"/>
<classPathEntry location="${maven.repository}\com\oracle\ojdbc6\11.2.0.1.0\ojdbc6-11.2.0.1.0.jar" />
<context id="shiroTables" targetRuntime="MyBatis3" defaultModelType="flat">
<commentGenerator>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<jdbcConnection driverClass="${oracle.driver}"
connectionURL="${oracle.url}"
userId="${oracle.username}"
password="${oracle.password}">
</jdbcConnection>
<javaModelGenerator targetPackage="qooco.crm.model"
targetProject="src/main/java">
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<sqlMapGenerator targetPackage="sqlMapperXml"
targetProject="src/main/resources">
</sqlMapGenerator>
<javaClientGenerator type="XMLMAPPER"
targetPackage="qooco.crm.dao" targetProject="src/main/java">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!-- schema:指定dao文件所属分类文件夹| doaminObjectName:指定生成对象名 -->
<table schema="" tableName="testKelvin" domainObjectName="TestKelvin"
enableCountByExample="false"
enableDeleteByExample="false"
enableUpdateByExample="false"
selectByExampleQueryId="false"
enableSelectByExample="false">
<generatedKey column="id_" sqlStatement="assigned" identity="true"/>
</table>
</context>
</generatorConfiguration>