简体   繁体   中英

MyBatis custom queries: why not generate model and mapper methods?

Why does the MyBatis Java generator not create:

  1. a Java model for custom result maps; and
  2. Java mapper methods for custom queries?

Custom queries and result maps are based on MyBatis SqlMap XML, and thus I would think that it should be possible to create the model class and add the methods to the Mapper class.

Or am I misunderstanding something?

I have never used it, but reading the Introduction to MyBatis Generator , I understand it generates Java POJOs and CRUD SQL statements XML + matching Java Mappers.

No result maps since generated POJOs properties name matches table columns names: no need because this mapping is implicitly handled.

MyBatis Generator generates stuff from DB, not from sqlMap XML.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM