I used eclipse Luna to install my favorite plugins, and generator was one of them.
Recommended download Mybatis_generator_1.3.1.zip offline installation package
<?XML version= "1.0" encoding= "UTF-8"?> <!DOCTYPE generatorconfiguration Public "-//mybatis.org//dtd mybatis Generator Configuration 1.0//en" "Htt P://mybatis.org/dtd/mybatis-generator-config_1_0.dtd "> <generatorconfiguration> <!--classpathentry: JDBC-driven jar package address for database - <Classpathentry Location= "E:\oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar" /> <ContextID= "Db2tables"Targetruntime= "MyBatis3"> <Commentgenerator> <!--whether to remove automatically generated comments true: Yes: false: No - < Propertyname= "Suppressallcomments"value= "true" /> <!--Database connection Information: Driver class, connection address, user name, password - </Commentgenerator> <jdbcconnectionDriverclass= "Oracle.jdbc.driver.OracleDriver"Connectionurl= "JDBC:ORACLE:THIN:@198.17.1.1:1521:ORCL"userId= "Unuser"Password= "Password"> </jdbcconnection> <!--by default, the JDBC decimal and NUMERIC types are parsed to Integer true, and the JDBC decimal and NUMERIC types are resolved to Java.math.BigDecimal - <Javatyperesolver> < Propertyname= "Forcebigdecimals"value= "false" /> </Javatyperesolver> <!--Targetproject: Where to generate code automatically - <JavamodelgeneratorTargetpackage= "Com.soft.model"Targetproject= "E:\WebWorkSpace\workspace_js\downAttachdemo\src"> <!--enablesubpackages: Do you want the schema to be the suffix of the package - < Propertyname= "Enablesubpackages"value= "true" /> <!--The space returned from the database before and after the value is cleaned - < Propertyname= "Trimstrings"value= "true" /> </Javamodelgenerator> <SqlmapgeneratorTargetpackage= "Sqlmap"Targetproject= "E:\WebWorkSpace\workspace_js\downAttachdemo\conf"> < Propertyname= "Enablesubpackages"value= "false" /> </Sqlmapgenerator> <Javaclientgeneratortype= "Xmlmapper"Targetpackage= "Com.soft.mapping"Targetproject= "E:\WebWorkSpace\workspace_js\downAttachdemo\src"> < Propertyname= "Enablesubpackages"value= "true" /> </Javaclientgenerator> <!--tableName: A database table for automatic code generation; Domainobjectname: JavaBean class name that corresponds to a database table - <TableSchema= "Untodo"TableName= "Mocha_t_app"Domainobjectname= "Mochatodoapp" > </Table> </Context> </generatorconfiguration>
We may worry that once the generate is re-executed, the code we write ourselves will not be lost, and the plugin will not modify or discard the code we have written ourselves .
MyBatis Generator Auto-generated entity class, SQLMAP configuration file Detailed description