Use MyBatis generator to generate mapper in annotation form

Source: Internet
Author: User

Recently when using Mybatisgenerator, want to generate annotation mapper, on-line basic Mulberry No related configuration, record, do the following records:


[HTML]View PlainCopyPrint?
  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 Package Location" />
  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. < Table schema="schema" tableName="table" domainobjectname="JavaBean" >
  11. </ Table >   
  12. </ Context >   
  13. </ 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 ><classPathEntry        location= "jar Package location"/>  <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>

Use MyBatis generator to generate mapper in annotation form

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.