Skip to main content

REST tutorial : Create repository


This is the 2nd post of our tutorial series. Previous part is here
In this part let's create our domain quickly.

You can find the complete source code here Todoapp

Spring Data JPA

Spring Data JPA improves the implementation of data access layers by reducing boilerplate codes. For the repository interfaces Spring provides the implementation automatically.
Lombok reduces boilerplate code for model objects. It can generate getter, setter, toString, hashCode, equals, constructors for you.

To make it simple, we will have Todo with Id, title and summary.

Step 1: Modify database properties

Step 2: Create Todo model

NOTE: Lombok will eliminate getter, setter, toString, hashCode burden.

Step 3 : Create Todo repository

With magic of Spring that is all ;)