iBatis的代码自动生成工具abator
今天试了以下,感觉挺不错的 ,安装好 AbatorForEclipse1.1.0 插件后 点击
File ----- new ---- Abator for iBATIS Configuraction File 新建一个 abatorConfig.xml 文件
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE abatorConfiguration PUBLIC "-//Apache Software Foundation//DTD Abator for iBATIS Configuration 1.0//EN" "http://ibatis.apache.org/dtd/abator-config_1_0.dtd" >
<abatorConfiguration >
<abatorContext >
<jdbcConnection driverClass="???" connectionURL="???" userId="???" password="???" >
<classPathEntry location="???" />
</jdbcConnection>
<javaModelGenerator targetPackage="???" targetProject="???" />
<sqlMapGenerator targetPackage="???" targetProject="???" />
<daoGenerator targetPackage="???" targetProject="???" type="GENERIC-CI" />
<table schema="???" tableName="???" >
<columnOverride column="???" property="???" />
</table>
</abatorContext>
</abatorConfiguration>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE abatorConfiguration PUBLIC "-//Apache Software Foundation//DTD Abator for iBATIS Configuration 1.0//EN" "http://ibatis.apache.org/dtd/abator-config_1_0.dtd" >
<abatorConfiguration >
<abatorContext >
<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver" connectionURL="jdbc:oracle:thin:@192.168.0.108:1521:logi" userId="root" password="123456" >
<classPathEntry location="E:\project\demo\WebRoot\WEB-INF\lib\classes12.jar" />
</jdbcConnection>
<!--targetPackage指定一个包名存放model bean,targetProject是工程名-->
<javaModelGenerator targetPackage="com.unimas.bean" targetProject="Security" />
<sqlMapGenerator targetPackage="com.unimas.bean.mapping" targetProject="Security" />
<daoGenerator targetPackage="com.unimas.dao" targetProject="Security" type="SPRING" />
<table tableName="t_user" ></table>
</abatorContext>
</abatorConfiguration>
我用的myeclipse 6.5版本,oracle是10g版本,在连接的时候出现了以下问题:
java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-12705: Cannot access NLS data files or invalid environment specified
解决方法:
只需在eclipse目录下找到eclipse.ini文件,把
Duser.language=en 改成 Duser.language=zh就行了。