- Copy the Person class from the previous recipe:
public class Person { private Integer id; private String firstName; private String lastName; private String place; //required getters and setters }
- We will do the PersonMapper part in a different way. We will write all our SQL queries in a mapper XML file and then refer to them from the PersonMapper interface. We will place the mapper XML under the src/main/resources/mappers folder. We'll set the value of the mybatis.mapper-locations property to classpath*:mappers/*.xml. This way, the PersonMapper interface can discover the SQL queries corresponding to its methods.
- Create the com.packt.boot_rest_demo.PersonMapper interface:
@Mapper public interface PersonMapper { public ...