Today in learning to follow the teacher learning Mybatis – plus technology found god in the use of the test class testing to add and delete operation, display Closing non transactional SqlSession [org. Apache. Ibatis. Session. Defaults. DefaultSqlSession @ 656922 a0] after no information feedback, no results after searching for some information.
Eventually find the main class does not start:
@ MapperScan (com. Kuang. "mapper") code>
pay attention to the point, we need to start class up to scan our mapper package of all interface font>
to add @ MapperScan (" com. Kuang. Mapper ") scans we
mapper under code>
UserMapper code> interface inheritance parent class
BaseMapper< User> code>. In order to identify all methods in the parent class.
import org.mybatis.spring.annotation.MapperScan; @MapperScan("com.kuang.mapper")
Then test the class again and find that the data is present and the information is fed back.