Quick Start with mybatis-spring-boot-starter
Let's create a MyBatis Spring Boot Application quickly using the SPRING INITIALIZR . Create a project Create a Spring Boot standalone application for MyBatis + H2 Database using following command (or the SPRING INITIALIZR UI ). $ curl -s https://start.spring.io/starter.tgz\ -d name=mybatis-sample\ -d artifactId=mybatis-sample\ -d dependencies=mybatis,h2\ -d baseDir=mybatis-sample\ -d type=maven-project\ | tar -xzvf - Create sql files Create a sql file( src/main/resources/schema.sql ) to generate the city table. CREATE TABLE city ( id INT PRIMARY KEY auto_increment, name VARCHAR , state VARCHAR , country VARCHAR ); Create a domain class Create the City class( src/main/java/com/example/mybatissample/City.java ). package com . example . mybatissample ; public class City { private Long id ; private String name ; private String state ; private String country ; public Lo...