Sitemap

Member-only story

Spring Boot Rest API with MyBatis and PostgreSQL

7 min readJul 4, 2022

--

In this story, we’ll implement a sample REST API that uses Spring Boot with MyBatis and PostgreSQL.

If you are not a Medium member, then click here to read for free.

· Prerequisites
· Overview
What is MyBatis?
Why Mybatis?
· Getting Started
Project Structure
Database initialization
· Spring MyBatis integration
Create Book Model
Create Book Repository
Service Layer
Create Book Controller
· Test the application
· Conclusion
· References

Prerequisites

This is the list of all the prerequisites:

  • Spring Boot 4 or later
  • Maven 3.9.12 or later
  • Java 21
  • Liquibase for schema versioning
  • Your favorite IDE (IntelliJ IDEA, Eclipse, or VS Code)
  • Postman / insomnia or any other API testing tool.
  • PostgreSQL 14 or higher

--

--