Spring Boot, MyBatis One-to-Many and One-to-One Selects - Annotations Example
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbq2M_q7zYJSeujapU_8hoar7w7xiWG2RdOceiQiA23MbhSXlTixZ73v0meHzz906gN3MWG5uO7W4p0t3xI77l3x-2FQEX797p91IahXZGVLSjfGxqCowIFrFp191B8pnfPFd9cUkfjG-d_tD4_kR4T92rl5i6rw1kgz-zi65hV3Cmi_n4qdS_Bf1U2A/w400-h223/mybatis-springboot-one-tomany-oneto-one.png)
In this section, we will learn how to handle One-to-Many and One-to-One selects in Spring Boot, MyBatis application (Annotations example). Technologies used: Spring Boot 3.0.2 MyBatis 3 Java 17 Maven H2 Database Creating a simple spring boot web application: First, open the Spring initializr https://start.spring.io/ Then, Provide the Group and Artifact name. We have provided Group name com.knf.dev.demo and Artifact spring-boot-mybatis-one-to-many-one-to-one . Here I selected the Maven project - language Java 17 - Spring Boot 3.0.2 and add Spring web dependency , MyBatis Framework and H2 Database . Then, click on the Generate button. When we click on the Generate button, it starts packing the project in a .zip( spring-boot-mybatis-one-to-many-one-to-one ) file and downloads the project. Then, Extract the Zip file. Then, import the project on your favourite IDE. Final Project directory: pom.xml <? xml version ="1.0" encoding ="UTF-8" ?> < pr