最近使用mybatisgenerator时,希望生成annotation的mapper,在网上基本桑没有相关配置,记录,做以下记录:
- <?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="jar包位置" />
- <context id="context1" >
- <jdbcConnection driverClass="driver" connectionURL="jdbc" userId="**" password="**" />
- <javaModelGenerator targetPackage="package" targetProject="project" />
- <sqlMapGenerator targetPackage="package" targetProject="project" /></span>
- <javaClientGenerator targetPackage="package" targetProject="project" type="<span style="color:#ff0000;">ANNOTATEDMAPPER/XMLMAPPER</span>" />
- <table schema="schema" tableName="table" domainObjectName="javaBean" >
- </table>
- </context>
- </generatorConfiguration>