mybatis を利用した web application 開発についてのご紹介
TRANSCRIPT
- 1. MyBatis Web Application LINE Corp. Service Dev. 1Tokuhiro Matsuno
- 2. LINE Corp Service Dev.1 B2C MyBatis
- 3. MyBatis? for Java
- 4. SQL interface java.lang.reect.Proxy Bean Mapping
- 5. MyBatis DB
- 6. DB
- 7.
- 8. N+1 )
- 9. 3 Mapper XML: XML Annotation: Statement builder: Java DSL
- 10. 1. Mapper XML
- 11. -parameters @Param
- 12. Java8 -parameters
- 13. Usage String resource = "mybatis-cong.xml";InputStream inputStream = Resources.getResourceAsStream(resource);SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
- 14. try (SqlSession session = sqlSessionFactory.openSession()) {BlogMapper mapper = session.getMapper(BlogMapper.class);Blog blog = mapper.ndById(101);System.out.println(blog);}
- 15. 2. Annotation
- 16.
- 17. 3. Statement builder
- 18. LINE 27% 73% XML Annotation Statement builder
- 19. @Select("SELECT *" + " FROM blog" + " id=#{id}") Blog findById(long id);
- 20. Annotation 1% 4% 95% Java Kotlin Groovy
- 21. Kotlin fun findById(id: Long): List Groovy Blog findById(long id) Java Blog findById(long id);
- 22. LINE Mapper XML Annotation Groovy or kotlin Statement builder
- 23. Spring support Spring boot
- 24. MyBatis SQL
- 25. MyBatis (2)
- 26. MyBatis (3)
- 27. MyBatis (4) Debugger
- 28. MyBatis XML, Statement builder, Annotation Annotation XML