简体   繁体   中英

MyBatis generator - Generate mapper implementation

I'm using MyBatis generator and the files created are correct: model class, java mapper, xml mapper. The problem is that the java mapper is just generating the interface, not the implementation. As far as I see it, it should be easy to generate also the implementation, using the methods in the xml mapper.

Is there any way to generate the implementation to the mapper interface? Or am I misunderstanding the concept?

Mapper Implementation is created by mybatis as proxy class during the application startup. Your mapper xml file corresponding to the interface would be translated to plain java jdbc code and would be implemented in proxy class. And using the interface you access these proxy classes.

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