
Explore the course structure and the basics of rest api with Spring Boot and Spring Data JPA. Understand what rest api is and why we need it, Json data format.
Define what a rest api is and how it connects web and mobile apps using json, with http methods such as get, post, put, and delete, built with spring boot.
Overview Of JSON ( JavaScript Object Notation )
Set up your local development environment with the JDK and Apache Maven. Install a Java IDE (STS recommended) and configure JAVA_HOME, M2_HOME, and PATH for Windows, macOS, or Linux.
Install and use Postman to test REST APIs built with Spring Boot and Spring Data JPA, configure local URLs, and send GET, POST, PUT, and DELETE requests.
Create your first spring boot app using spring tool suite and spring initializer with spring web, then run on the embedded tomcat at port 8080.
Create a dedicated controller and service layer in a Spring Boot app. Organize packages for controller and service, and configure component scan and rest mappings such as /api/student.
Use the @Value annotation to read application.properties values in a Spring Boot app, illustrated with app.name. Learn values with colon syntax and understand that @Value works only in Spring-managed beans.
Learn to return json from a Spring Boot get api by creating a student response class and letting Spring Boot convert objects to json using Jackson.
Build the Spring Boot application and generate a runnable jar from the project using Maven. Run the jar with Java -jar and access the API on port 8080.
Change the Spring Boot application port from 8080 by setting server.port in application.properties or VM arguments, with VM arguments taking precedence, to run on 8081, 8082, or 8083.
Discover how to customize json keys with the Jackson @JsonProperty annotation, switching between camelCase and underscores and avoiding mixed keys for fields like first name and last name.
Install and configure MySQL locally, start server at 3306, connect with MySQL Workbench, and create a spring schema with a student table using auto-increment id for JPA in spring boot.
Connect a Spring Boot application to a MySQL database using Spring Data JPA by configuring the database properties in application.properties, avoiding code-based connection.
Create the repository for the student table by annotating an interface with @Repository and extending JpaRepository with the student entity and its ID type to enable CRUD, pagination, and sorting.
Create a post api to add a new student by posting json to /api/students/create, map request body to a model, persist via repository, and return the student with id.
Perform server-side validation of incoming json payloads with Spring Boot, applying not blank and @Valid annotations to enforce first name presence in the create student api.
Learn to implement a put API in a spring boot app using spring data jpa to update a student by id, updating only the provided fields.
Update student records with a put API by sending only the fields to update, including the id. Validate non-null values like first name before saving via the repository.
Use Spring Data JPA to fetch records by a mapped column, and leverage find by first name to return a list of student responses via the repository and service layers.
Learn how to implement a starts with query in Spring Data JPA by defining a repository method, using method proxy, and passing the first name as a path variable.
Learn to write jpql with the @Query annotation in Spring Boot app; jpql refers to entities and fields, not tables and columns, and is converted to native sql by jpa.
Write a native sql select query in Spring Data JPA using @Query and @Param to compare first name and last name. Call the API to retrieve matching students.
Implement a delete by first name using jpql in a spring boot app, returning the number of records deleted via a path variable.
***** Some Reviews From Students *****
It was good. I am happy.
Our instructor teaches us very well. He shows us how we can test our APIs with Postman. He also attached the source code to the lessons so we can test some interesting features and need not type in the entire code. He explains the connections between controller, services and repository very well.
Has been easy to follow, I like his added tips on methodology, makes me feel back in a class at in school; He even has my professors accent!
This course is to the point. It really helped me to get familiar with the framework.
In this course you are going to learn to Build RESTful APIs With Spring Boot and Spring Data JPA.
Now a days Spring framework is widely used among Java Developers and specifically Spring Boot is in high demand.
In this course you will learn what is REST API and difference between REST API and SOAP. You will learn to build REST APIs with http methods - GET, POST, PUT and DELETE. We will use JSON ( JavaScript Object Notation ) as data format in REST APIs.
Spring Data JPA ( Java Persistence API ) is very much popular to handle your database. Using JPA we can avoid writing native SQL queries so we can say that using JPA we can write database independent queries. JPA provides method proxy using which we can write queries very quickly. In this course you will learn to use Spring Data JPA in Spring Boot using JPA Repository. Using JPA you will learn to perform CRUD ( Create, Read, Update, Delete ) operations with MySQL Database.
You will learn how to write Select Query, AND Query, OR Query, In Query, Like Query, Starts with Query, Ends with Query Using Spring Data JPA. You will also learn to achieve pagination and sorting using Spring Data JPA. Behind the scene JPA will create native SQL queries for us and you will learn how to check those SQL Queries generated by JPA. You will learn when to use @Transient annotation provided by Spring Data JPA.
You will learn Java Persistence Query Language (JPQL). Using JPQL you can write database independent queries. In this course you will learn to write -
JPQL Select Query
JPQL Update Query
JPQL Delete Query
You will learn how to handle your database tables' relationship with JPA. You will learn different relationships -
OneToOne
OneToMany
ManyToOne
Documentation of your REST APIs is very important for your consumers. In this course you will learn to document your APIs with OpenAPI Specification (Swagger UI).
Logging is very important in your application to debug and troubleshoot the issue. In this course you will learn logging with Spring Boot and slf4j.
One of the key features that Spring Framework provides is Spring AOP ( Aspect Oriented Programming ). In this course you will learn real time implementation for Spring AOP in Spring Boot. You will learn different advices -
Before Advice
After Advice
AfterReturning Advice
Around Advice
Project lombok is used to avoid boiler plate code in your Java Application. In this course you learn how to use project lombok with Spring Boot Application and you will learn -
How to have getter methods for Java Class using @Getter Annotation.
How to have setter methods for Java Class using @Setter Annotation.
How to have constructor for Java Class using @NoArgsConstructor and @AllArgsConstructor Annotations.
Spring Boot Scheduler - Cron Job If you want to run task periodically then you can use Scheduler with Spring Boot. For this cron expression is used for this purpose.
Spring Boot Deployment to Heroku (Cloud Platform) Heroku is cloud platform where you can deploy your Spring Boot Application. In this course you will learn to deploy your Spring Boot App along with MySQL Database. Heroku is owned by Salesforce which is well known company for cloud services.