Part I (Getting started)|Part II (Pagination & Sorting)| Part III (Auditing)

In Previous posts I explained how to get started, Pagination & Sorting and Auditing with Spring boot Data JPA. In this post we will discuss how to use Projections with Spring Data.

When using Spring Data JPA, the repository typically returns one or more instances of the root class. There may be cases where we do not want an entire entity from the query method but are interested only in few attributes of that entity or subset of that entity with some manipulation in it. …


Part I (Getting started)|Part II(Pagination & Sorting)|Part IV (Projections)

In Previous posts I explained how to get started, Pagination & Sorting with Spring boot Data JPA. In this post we will discuss how to use Auditing with Spring Data.

In the context of ORM, auditing means tracking and logging events related to persistent entities, or simply entity versioning. Spring Data provides sophisticated support to transparently keep track of who created or changed an entity and the point in time this happened.

Let’s start:

we will use Spring Initializer generate the base for our project, in my previous post I have…


Part I (Getting started)| Part III (Auditing) |Part IV (Projections)

In Previous post I explained how to get started with Spring boot Data JPA. In this post we will discuss how to use Pagination and Sorting with Spring Data.

Pagination is often helpful when we have a large dataset and we want to present it to the user in smaller chunks.

Also, we often need to sort that data by some criteria while paging.

Let’s start:

we will use Spring Initializer generate the base for our project, in my previous post I have explained how to get starting with Spring…


Part II (Pagination & Sorting)| Part III (Auditing) |Part IV (Projections)

In Previous post I explained how to get started with Spring boot. In this post we will use Spring Boot along with Spring Data.

Spring Data JPA provides complete abstraction over the DAO layer. We don’t need to write the implementation for the DAO layer anymore. Spring Data JPA handles most of the complexity and reduces the boilerplate code required by JPA.

Let’s start:

we will use Spring Initializer generate the base for our project, in my previous post I have explained how to get starting with Spring Boot…


Validation is a common requirement in all the services. When developing a REST API, it’s important to validate request data, and in case of invalid data, return a 4xx response with a precise body containing field-wise error details. Spring Boot provides strong support for this common, yet critical, task straight out of the box.

Let’s start

we will use Spring Initializr generate the base for our project, in my previous post i have explained how to get starting with Spring Boot REST web services.


Introduction

REST resources can have multiple presentations (e.g. JSON or XML) as different clients can request different representation. The mechanism for selecting a correct representation is known as content negotiation.

Content negotiation allows clients to request specific content type(s) to be returned by the server. With content negotiation, we enable a single endpoint to support different types of resource representations

Content Negotiation Strategies

Content Negotiation can be done in following ways

  • Using Path Extension This has the highest preference. In the request we specify the required response type using the extension like .json,.xml or .txt.
  • Using url parameter This has the second highest preference…


In Previous post I explained how to get started with Spring boot. In this post we will go through how to create RESTfull web services with Spring boot.

Developing Your First RESTfull Application

let’s use https://start.spring.io/ web site to generate the base for our project.

Provide basic details like Project name, Java version, spring boot version and packaging type etc..


Overview

Spring Boot helps us to create stand-alone, production-grade Spring-based applications that we can run.

Spring Boot is an opinionated addition to the Spring platform, focused on convention over configuration — highly useful for getting started with minimum effort. You can use Spring Boot to create Java applications that can be started by using java -jar or more traditional war deployments.

Primary goals are:

  • Provide a radically faster and widely accessible getting-started experience for all Spring development.
  • Be opinionated out of the box but get out of the way quickly as requirements start to diverge from the defaults.
  • Provide a range…

Mahesh Bonagiri

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store