spring Integration MyBatis step

Ideas:

SqlsessionFactory -> Sqlsession -> StudentMapper -> CRUD

  1. Import jar
    Here Insert Picture Description
  2. Prepare the test data (type - Table)
    , such as: Student (stuno, name, age )
  3. Create and configure studentMapper.xml
    Here Insert Picture Description
  4. MyBatis configuration file
    Here Insert Picture Description
  5. Write StudentDaoImpl
    Here Insert Picture Description
  6. Create a profile db.properties
    Here Insert Picture Description
  7. Db.properties introduced in the spring configuration file
    Here Insert Picture Description
  8. Before configuring the database in MyBatis, the configure now in the spring
    Here Insert Picture Description
  9. Creating mybatis in springIOC in core classes sqlSessionFactoryBean, and mybatis configuration file is loaded into spring
    Here Insert Picture Description
  10. IOC created StudentMapper (before StudentDao) and StudentService, pay attention to the creation StudentMapper
    Here Insert Picture Description
    Here Insert Picture Description
Released eight original articles · won praise 0 · Views 76

Guess you like

Origin blog.csdn.net/flipped___/article/details/104303205