使用mybatis generator 生成annotation形式的mapper

        最近使用mybatisgenerator时,希望生成annotation的mapper,在网上基本桑没有相关配置,记录,做以下记录:


  1. <?xml version="1.0" encoding="UTF-8" ?>  
  2. <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >  
  3. <generatorConfiguration ><classPathEntry  
  4.         location="jar包位置" />  
  5.   <context id="context1" >  
  6.     <jdbcConnection driverClass="driver" connectionURL="jdbc" userId="**" password="**" />  
  7.     <javaModelGenerator targetPackage="package" targetProject="project" />  
  8.     <sqlMapGenerator targetPackage="package" targetProject="project" /></span>  
  9.     <javaClientGenerator targetPackage="package" targetProject="project" type="<span style="color:#ff0000;">ANNOTATEDMAPPER/XMLMAPPER</span>/>  
  10.   
  11.     <table schema="schema" tableName="table"  domainObjectName="javaBean" >  
  12.     </table>  
  13.       
  14.   </context>  
  15. </generatorConfiguration>  


posted @ 2018-01-17 12:01  星朝  阅读(1448)  评论(0编辑  收藏  举报