Spring Data REST example in Spring Boot

In this tutorial, we’re gonna build a Spring Data REST example in Spring Boot CRUD REST API with Maven that uses Spring Data JPA to interact with H2 database without having to manually implement controller and handling HTTP requests. You’ll know:

  • How to configure Spring Data REST, JPA, Hibernate to work with Database
  • How to define Data Models and Repository interfaces
  • Way to use Spring Data JPA to interact with H2 Database
  • How to check CRUD operations with Postman

More Practice:
Spring JPA @Query example
JPA Repository query example | Derived Query
JPA Native Query example
Spring Boot Security Login example with JWT and H2 Database
Spring Boot Rest XML example
Spring Boot + GraphQL example
Spring Boot Multipart File upload example
– Documentation: Spring Boot + Swagger 3 example (with OpenAPI 3)
– Caching: Spring Boot Redis Cache example
– Testing: Spring Boot Unit Test for JPA Repository

Associations:
Spring Boot One To One example with JPA, Hibernate
Spring Boot One To Many example with JPA, Hibernate
Spring Boot Many to Many example with JPA, Hibernate

Read More

Spring Boot + GraphQL example

GraphQL is a query language that offers an alternative model to developing APIs (REST, SOAP or gRPC) with detailed description.

In this tutorial, we’re gonna build a Spring Boot GraphQL example with H2 database that will expose CRUD APIs to create, read, update and delete objects with the help of graphql-spring-boot-starter and Spring Data JPA.

Related Post:
Spring Boot + GraphQL + MySQL example
Spring Boot + GraphQL + PostgreSQL example
Spring Boot + GraphQL + MongoDB example
Spring Boot 3 Rest API example: CRUD Application
Spring Boot Security: Login and Registration example with JWT
Spring Boot Thymeleaf CRUD example
– Documentation: Spring Boot Swagger 3 example
– Unit Test: @DataJpaTest example for Spring Data Repository
– Caching: Spring Boot Redis Cache example

Read More

JPA @ManyToOne example | Spring Boot

In this tutorial, I will show you how to implement Spring Data JPA Many-to-One example in Spring Boot for One-To-Many mapping using @ManyToOne annotation. You’ll know:

  • How to configure Spring Data, JPA, Hibernate to work with Database
  • How to define Data Models and Repository interfaces for JPA One-To-Many relationship using @ManyToOne
  • Way to use Spring JPA to interact with Database for Many-to-One association
  • Way to create Spring Rest Controller to process HTTP requests

Related Posts:
Spring Boot + GraphQL example
JPA One To One example with Hibernate in Spring Boot
JPA Many to Many example with Hibernate in Spring Boot
Validate Request Body in Spring Boot
Spring Boot Token based Authentication with Spring Security & JWT
Spring JPA + H2 example
Spring JPA + MySQL example
Spring JPA + PostgreSQL example
Spring JPA + Oracle example
Spring JPA + SQL Server example
– Documentation: Spring Boot Swagger 3 example
– Caching: Spring Boot Redis Cache example

Read More

Spring Boot + Angular 16 example: CRUD

In this tutorial, we will learn how to build a full stack Spring Boot + Angular 16 example with a CRUD Application. The back-end server uses Spring Boot with Spring Web MVC for REST Controller and Spring Data JPA for interacting with embedded database (H2 database). Front-end side is made with Angular 16, HttpClient, Router and Bootstrap 4.

Run both Project on same server/port:
How to Integrate Angular with Spring Boot Rest API

Security: Angular 16 + Spring Boot: JWT Authentication example

Upload: Angular 16 + Spring Boot: File upload/download example

Pagination: Angular + Spring Boot: Pagination example

Read More