A simple project created annotation-based mybatis

The IUserDao.xml removed using the method of dao @Select annotation interface, and specify the SQL statement, also need mapper disposed in mybatis-config.xml, the class attribute to specify the fully qualified class name of the dao interface.
IUserDao.java:

@Select("select * from user")
    List<User> findAll();

mybatis-config.xml:

<mappers>
	<mapper class="net.togogo.dao.IUserDao"></mapper>
</mappers>
Published 31 original articles · won praise 1 · views 268

Guess you like

Origin blog.csdn.net/weixin_41605945/article/details/104113629