人生难得几回搏,此时不搏待何时。这篇文章主要讲述使用mybatis generator 生成annotation形式的mapper相关的知识,希望能为你提供帮助。
【使用mybatis generator 生成annotation形式的mapper】
最近使用mybatisgenerator时,希望生成annotation的mapper,在网上基本桑没有相关配置,记录,做以下记录:
[html] view plain copy print?
- < ?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>
< ?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 > < classPathEntrylocation="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>
推荐阅读
- Android开发中使用startActivityForResult()方法从Activity A跳转Activity B出现B退出时A也同时退出的解决办法
- Android中给layout下的布局文件添加动画效果
- Webform 内置对象 Session对象Application全局对象,ViewState
- There is no Action mapped for namespace [/] and action name [m_hi] associated with context path [](代
- 可集成到APP的车架号识别软件
- 在外围获取APP的重要信息
- 2018APP行业火爆依旧 娱乐化便捷化将是拐点
- 行业洞察(旅游APP软件开发未来发展走向)
- [MyBatis]mapperLocations属性通配符的使用