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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top