When used today mybatis-generator to automatically generate code and found only generate insert method,
All previous methods can all be generated after viewing online solutions and check the database table structure,
It found that two kinds of solution can:
1. Modify mybatis-generator.xml configuration arranged on a table generated
Modify table corresponding query, modify, delete
enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
Changed
enableSelectByPrimaryKey="true" enableUpdateByPrimaryKey="true" enableDeleteByPrimaryKey="true"
It can be run again (this method also Example correspondence table generated table, and the table database operations using Example)
2. Check whether a database table create a primary key, no primary key, then mybatis-generator is no way to check the corresponding deletion operation,
After the increase in primary database table key to run the project again, to generate a corresponding normal CRUD operations.
Add a primary key
Form