MyBatis to generate reverse engineering
(Generating entity class, mapper.xml, mapper.java)
mybatis programmers need to write your own sql statement, mybatis official reverse engineering can be for a single table automatic code generation (mapper.java, mapper.xml, pojo ...) mybatis required for execution, allowing the programmer to put more effort in the complex business logic.
The actual development companies, the commonly used reverse engineering methods: java code generated by the table in the database.
The emphasis on the word single table, because the operating Mybatis reverse engineering generated Mapper is carried out for a single table, maybe you might think that this bit tasteless, but in large projects, there is little multi-table associated with complex queries, so the role is still very large.
Introduction
MyBatis generator (the MBG) is MyBatis MyBatis and iBATIS code generator. It will generate code for all versions of iBATIS after MyBatis 2.2.0 and version. Introspection a database table (or tables), and the resulting table can be used to access the workpiece. This relieves the set target and profile to the trouble to interact with the database table. MBG trying to have a significant impact on the majority of database operations simple CRUD (create, retrieve, update, delete). You will still need to manually write SQL and object code for the join query or stored procedure.
Start on the Code
The overall directory structure: