把文件夹中内容放到eclipse/MyEclipse对应的文件夹中,在eclipse/MyEclipse中新建->Other->MyBatis XXX,在生成的xml中填写数据库配置信息(别忘了配置驱动jar包),右键Generator MyBatis XXX 生成。以下是我的例子: <?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="/Users/jinweihe/plan/WebRoot/WEB-INF/lib/mysql-connector-java-5.1.9.jar" /> <context id="context1" > <!-- 去掉那些没用的注释 --> <commentGenerator> <property name="suppressAllComments" value="true" /> </commentGenerator> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://127.0.0.1:3306/plan" userId="root" password="root" /> <javaModelGenerator targetPackage="com.hjw.plan.mybatis.model" targetProject="plan" /> <sqlMapGenerator targetPackage="com.hjw.plan.mybatis.mapper" targetProject="plan" /> <javaClientGenerator targetPackage="com.hjw.plan.mybatis.dao" targetProject="plan" type="XMLMAPPER" /> <table tableName="plans" domainObjectName="Plan" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" > <property name="useActualColumnNames" value="true"/> </table> <table tableName="friendships" domainObjectName="Friendship" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" > <property name="useActualColumnNames" value="true"/> </table> </context> </generatorConfiguration>
- 1
- 粉丝: 17
- 资源: 2
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助