Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top