
Develop rest apis with spring data rest and spring boot, starting from spring data jpa basics, and master pagination, sorting, validations, and HAL Explorer with practical source code.
Install the JDK (Oracle or OpenJDK), install Apache Maven, and set JAVA_HOME and M2_HOME environment variables; download and configure STS or your preferred IDE to start building with Spring.
Download Postman from its official website, install it on your operating system and local machine, then open it to craft requests with query params and a body payload.
Download and install MySQL server and MySQL Workbench on your local machine, start the service, connect with Workbench on port 3306, and prepare schemas for the Spring Boot app.
Explore how Spring Data serves as an umbrella for multiple databases, including MongoDB, Cassandra, and Neo4j, and learn the essentials of Spring Data REST for building RESTful APIs.
Outline the CRUD REST API flow in Spring Boot—from controller to service to repository to database—highlighting boilerplate code and noting that Spring Data REST resolves this in the next lecture.
Exposes repository crud operations as rest endpoints, removing the need for controllers or services, with support for gpa, mongodb, neo4j, salat, cassandra, and gemfire.
Demonstrates how HATEOAS and HAL enable hypermedia in JSON responses, letting clients navigate to other resources, with Spring HATEOAS handling the implementation.
Explore the fundamentals of Java Persistence API, mapping entity classes to database tables, and using repositories to perform CRUD in a Spring Boot application.
Set up a MySQL database using the bicycle workbench, creating a university schema and a four-column table with auto-increment, and import the provided SQL file to your local setup.
Create a Spring Boot app by setting up the Spring Boot project, adding Spring Web and MySQL dependencies, and wiring a controller to a service with component scanning.
Configure a Spring Boot application to connect to a MySQL database by setting datasource properties, including schema university, and credentials, enabling access to the bicycle database.
Create a student entity class that maps to the student table, defining id, first name, last name, and email fields with @Entity, @Table, @Id, @GeneratedValue, and @Column mappings.
Create a student repository interface, annotate with @Repository, and extend the repository to enable CRUD operations on the Glass entity with a Long ID, in a Spring Boot app.
Learn to fetch all records from a student table using Spring Data JPA, relying on generated queries via the repository.findAll(), and exposing the data through the service and controller layer.
Learn how to fetch a single record by id in a Spring Boot rest API using JPA, via controller, service, and repository, with sql logging to see the generated query.
Insert a new record into the sequel table using a post API and a json payload. Let Spring Data JPA handle persistence and auto-generated IDs while returning the created record.
Update a record via a put request with the ID in the payload, using Spring Data JPA's save. Create when the ID is null; update when it is non-null.
Learn to delete a record by its primary key using a delete mapping in a Spring Data REST API, invoking repository.deleteById(id) and returning a confirmation string.
Explore why Spring Data REST simplifies CRUD operations by exposing repositories as APIs, replacing controller and service boilerplate in our student database example.
Create a spring boot app with spring data rest by configuring dependencies, enabling JP repository, and wiring a repository for entities in the main class; no controller or service layer.
Spring Data REST automatically exposes repository data as REST endpoints, providing hypermedia links and support for paging, sorting, and find-by-id operations, demonstrated with the student entity.
Configure spring data rest to expose id values in json by implementing a repository rest configuration and listing entity classes, such as student and department.
Create records with Spring Data REST and Spring Boot by posting details via the post API and verifying insertion in the database, showcasing the no-controller simplicity of Spring Data REST.
Update records with the Spring Data REST put operation by sending a full payload to avoid nullifying unchanged fields; demonstrated by changing a first name.
Learn to perform partial updates with http patch in Spring Data REST, updating only selected attributes via targeted payload, and verify results in the database.
Delete a record in Spring Data REST by sending an API request with the record ID; receive no content when deletion succeeds, showing Spring Data REST handles delete operations automatically.
Annotate the student repository with RepositoryRestResource and set its collectionResourceRel to customize the api collection name for all student endpoints.
Configure the base path by setting spring.data.rest.base-path to /api to expose repositories and their entities through the rest api. Then verify the endpoints in the browser.
Learn to customize JSON keys with the @JsonProperty annotation in a Spring Boot REST API, aligning camel case fields for both request and response while using built-in Jackson support.
Protect sensitive data by using Jackson's JsonIgnore to omit fields like email from JSON responses and requests in Spring Boot REST APIs.
Explore modeling relational data with Spring Data REST by introducing department, subject, and student tables and mapping many-to-one relationships from student to department and subject to student.
Define three entity classes and three repositories for department and subjects learning, map their tables and columns, and set up many-to-one relationships to prepare the Spring Boot app.
Define secure relationships in Spring Data JPA by mapping many-to-one associations from student to department and from subject to student using join columns and entity classes.
Learn how to create records in a three-table Spring Data REST application by using foreign key references instead of full objects, linking departments, students, and subjects through IDs.
Explains cascade delete in Spring Data JPA by modeling one-to-many relationships, deleting child records before the parent to avoid foreign key errors, and enabling cascade behavior in the entity mappings.
Exclude specific tables from being exposed as REST resources by setting exported = false on their repositories in Spring Data REST with Spring Boot.
Learn how validations in Spring Data REST prevent inserting records when the first name is null and how clear error messages guide API consumers.
Create a Spring validator to ensure the first name is not null or empty by casting the input to a student and rejecting the value with 'name is required'.
Register a custom validator with Spring Data REST by wiring a repository event listener and setting its order to run before create, ensuring student data validation.
Apply a validator in spring data rest before creating records, showing how to enforce required fields, handle 400 errors with clear messages, and guard all post operations across entities.
Learn how to enforce validations when updating records using an update validator, registered before update events, ensuring last name is not null or empty across rest resources.
Explore pagination and sorting in spring guitarist using page number, size, and sort, and review the default page size of 20, total elements, and total pages.
Explains how to paginate Spring Data REST APIs with Spring Boot, using the bids parameter and zero-based page indices to fetch pages of 20 records and identify empty pages.
Configure the default page size in Spring Data REST by setting a property to 10; pages show 10 records per page, with zero-based page indexing using the page parameter.
Learn how to sort data in Spring Data REST with Spring Boot using the sort parameter to order by first name, ascending by default or descending when specified.
Discover how to create custom APIs with Spring data rest and Spring Boot by writing repository methods (find by email, first name, last name) exposed automatically, avoiding explicit rest controllers.
Learn to query the customer base with find by email and find by first name in a Spring Data REST repository, returning a single record for unique emails.
Learn to build REST APIs with Spring Data REST and Spring Boot by finding records using multiple fields, such as first name and last name, via query parameters.
Learn to set custom API paths in Spring Data REST by annotating repositories with RestResource, exposing selected methods, and hiding others with exported=false.
Discover how to implement pagination with custom APIs in spring data rest and spring boot by adding pageable parameters, returning appropriate entity types, and enabling sorting by first name.
Do you want to expose your database with REST APIs ? If yes then you can go for Spring Data REST.
In this course you will learn Spring Data REST with Spring Data JPA & MySQL Database. Once you will learn Spring Data REST with Spring Data JPA then you can use Spring Data REST with other databases like MongoDB, Neo4j etc.
In this course, first you will learn basics of Spring Data JPA and then we will jump to Spring Data REST. After that you will learn how to handle SQL relationships while working with Spring Data REST.
In this course you will learn Hypermedia as the Engine of Application State (HATEOAS) principle and we will use Hypertext Application Language (HAL) for the implementation of HATEOAS.
You will learn how to customize JSON response using Jackson Library. Validations are very important while developing REST APIs and this course covers validations with Spring Data REST.
You will learn how to achieve Pagination & Sorting while working with Spring Data REST.
Spring Data JPA provides findBy methods and with that we can develop custom APIs using Spring Data REST.
To provide dynamic JSON response Spring Data REST provides Projection & Excerpt.
With HAL Explorer, you can get UI to call your APIs and it can be considered as REST API documentation.
In this course you will learn
Develop REST APIs with Spring Data REST
Customize JSON Using Jackson Library
Spring Data REST Using SQL Relationships
Validations with Spring Data REST
Pagination & Sorting with Spring Data REST
Custom APIs Using Spring Data REST
Projection & Excerpt with Spring Data REST
HAL Explorer
Course Topics & Lectures :-
• Introduction To Spring Data REST
What is Spring Data ?
Problem Statement
What is Spring Data REST ?
What are HATEOAS and HAL ?
• Basics of Spring Data JPA
What is Spring Data JPA ?
Set Up MySQL Database
Create Spring Boot App
Spring Boot-MySQL Connection With JPA
Create First Entity Class
Create First Repository Using @Repository Annotation -DONE
Get All Records Using JPA
Get Single Record Using JPA
Save Record Using JPA
Update Record Using JPA
Delete Record Using JPA
• Getting Started with Spring Data REST
Overview of Spring Data REST
Create Spring Boot App with Spring Data REST
Spring Data REST In Action
Expose ID Field's Value
Create Record using Spring Data REST
Update Record using Spring Data REST
Partial Update using Http Patch and Spring Data REST
Delete Record using Spring Data REST
Configure API Path & Collection Key
Configure Base Path
• Customize JSON Using Jackson Library
@JsonProperty Usage
@JsonIgnore Usage
• Spring Data REST Using SQL Relationships
MySQL Database Overview
Configure Spring Boot App
Define SQL Relationships Using Spring Data JPA
Create Record with Reference
Cascade Delete Using Spring Data JPA
Restricting To Expose as REST Resource
• Validations with Spring Data REST
Introduction To Validations
Create Validator
Register Validator
Validator In Action
Validation While Updating Record
• Pagination & Sorting
Introduction To Pagination & Sorting
Pagination In Action
Configure Default Page Size
Sorting In Action
• Custom APIs Using Spring Data REST
Introduction To Custom APIs
REST API Using findBy Field
Find By Multiple Fields
Set Path For Custom API
Pagination with Custom APIs
• Projection & Excerpt In Spring Data REST
Introduction To Projection & Excerpt
Create Projection
Projection In Action
Concat Values Using Projection
More with Projection
Excerpt In Action
• HAL Explorer
Introduction To HAL Explorer
HAL Explorer In Action