Question

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?

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top