Recently when using Mybatisgenerator, want to generate annotation mapper, on-line basic Mulberry No related configuration, record, do the following records:
[HTML]View PlainCopyPrint?
- <? 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 >
<?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