1629802500
Learn how to add pagination & sorting to your Spring Boot REST API using Spring Data JPA.
We create a web application using the spring starter (http://start.spring.io/). We then expose an API for books. We then use Spring Data JPA to add pagination & sorting to the API.
Check out the code on GitHub here: https://github.com/kriscfoster/Spring-Boot-Pagination-Sorting
Don’t forget to Subscribe here: https://www.youtube.com/channel/UCWkzkhQ3syxBjjAYwqCbzYg?sub_confirmation=1
#rest #api #jpa #spring
1629716040
Learn how to use Spring Data JPA relationships such as ManyToMany, ManyToOne & OneToMany.
We create a web application using the spring starter (http://start.spring.io/). We then expose an API for 3 entities. We then use Spring Data JPA to create relationships between these entities.
Check out the code on GitHub here: https://github.com/kriscfoster/Spring-Data-JPA-Relationships
Don’t forget to Subscribe here: https://www.youtube.com/channel/UCWkzkhQ3syxBjjAYwqCbzYg?sub_confirmation=1
#spring #jpa
1629629580
Learn how to use Spring Boot with Thymeleaf to create full-stack web applications.
We create our project using the Spring Initializer (https://start.spring.io/) & then we will be using Thymeleaf (https://www.thymeleaf.org/) to template HTML content. We will be using bootstrap for style.
Don’t forget to Subscribe here: https://www.youtube.com/channel/UCWkzkhQ3syxBjjAYwqCbzYg?sub_confirmation=1
#spring boot #thymeleaf #spring
1629319680
In this video, we will talk about spring bean scopes. This is one of the hot topics for the spring interview as well. So today, I will give you an in-depth deep dive on the 6 different bean scopes that we have.
We will explore various beans scopes like singleton, prototype, request, session, application, and WebSocket. Not only I will tell you about the uses of it, but also I will make you familiar with various spring interview questions.
This bean scope in the spring framework tutorial also covers a comparison between various scopes.
Introduction: 00:00:00
[ The default scope of the bean ]
Singleton scoped bean: 00:10:16
Introducing @Scope spring annotation: 00:19:04
How to define Singleton scoped bean [Animations]: 00:20:15
Prototype scoped bean[example]: 00:21:53
[When to use singleton and prototype scope in spring]
Singleton vs prototype tricky question: 00:30:51
Bean Initialization (Singleton vs Prototype): 00:38:52
Injecting prototype bean inside a singleton bean: 00:47:00
singleton bean with prototype dependencies: 00:49:36
Injecting prototype scoped bean inside a singleton scoped bean Problem: 00:51:30
spring aop scoped proxy: 00:58:34
Introducing Spring CGLIB/ Proxy: 01:06:30
Singleton Scoped bean Vs GOF singleton design pattern: 01:26:40
singleton scope vs singleton pattern (Interview FAQ ): 01:37:30
@LookUp walkthrough: 01:13:37
lookup (abstract) method injection in spring: 01:20:00
@LookUp annotation homework/ Assignment : 01:25:53
Spring web-aware bean scopes: 01:38:29
Spring bean scope Assignment 02- 01:42:24
[Request scope in spring]
Request bean scope: 01:43:29
The standard way to define request scope: 02:10:29
Session bean scope: 02:11:50
Request Vs Prototype scoped bean: 02:19:29
Application scope theory: 02:25:39
Application scoped bean example: 02:41:32
Websocket bean scope: 03:14:29
This topic is popular for the “ spring interview questions and answers for experienced " and "spring interview questions and answers for freshers“ category. Make sure to explore every scenario that I have covered in this video. Make sure these are the same bean scopes that we use in spring boot as well.
1629308640
In this video, we will learn to use ResultSetExtractor. I will also walk you through the differences between RowMapper and ResultSetExtractor. So far in this spring jdbc course, we have learned to use insert, delete, and select operation. Before you start doing the Spring CRUD - update, I feel it’s important to understand the ResultSetExtractor concept which is crucial to solving some real-time problems. In our next spring database tutorial, we will learn to do the update operation.
Timestamp :
Discover how a ResultSetExtractor works?
Introduction : 00:00
Spring CRUD - Set Up- 01:46
Spring CRUD - Develop a DAO method - 05:05
What is a ResultSetExtractor - 06:23
How ResultSetExtractor works in Spring JDBC - 10:03
RowMapper Vs ResultSetExtractor - 22:08
Coming up: 34:26
1629297720
In this video, we will learn to fetch data from the database. So far in this spring jdbc course, we have covered insert, delete and batch update. Now it’s time for the most important select operation(Spring CRUD - Read).
So Let’s read data by using jdbctemplate’s query method. We will also learn how to query for an individual object by using jdbctemplate’s queryForObject method.
Note that to perform a select operation using jdbctempalte, We have to understand a concept called RowMapper. The RowMapper is going to help us to fetch database records in form of a resultset. Using the RowMapper’s mapRow method we can also bind our DB record with our domain(POJO) class object.
The rowmapper fetch the complete resultset and make it available inside the maprow method one by one so that we don’t have to manually loop over the resultset.
Once we understand the RowMapper concept, we will understand Spring’s Row mapper implementation called BeanProeprtyRowMapper. It is going to help us to bind our database resultset with our domain class object without even writing a custom row mapper.
Timestamp:
Introduction : 00:00
Spring JDBC Select - Gameplan : 01:52
Spring JDBC perform a batch update: 08:29
Spring CRUD - Read Data from the database: 12:53
Spring Framework (JDBC) : QueryForObject : 37:13
Why BeanPropertyRowMapper (concept) : 44:09
Let’s code- BeanPropertyRowMapper:49:18
1629286800
In this video, we will develop a few DAO methods using spring's JdbcTemplate. First, we will develop a delete method to delete an individual's record by using spring jdbc.
We will also develop a couple of methods to delete records by using some criteria. We will also develop a method that can execute DDL commands like truncate.
Section 2 of this video focused on the batch insert. We will understand, how to insert multiple records altogether by using spring jdbc ( jdbcTemplate).
So, In spring crud perspectives, we are only going to cover Delete and Insert operation in this spring framework tutorial.
Timestamp:
Introduction 00:00
Spring JDBC Delete + JdbcTemplate: 02:00
Spring CRUD - Delete hands-on
Delete records using different criteria: 09:16
Develop a cleanUp() [ Executing ddl sql queries[Truncate]] : 17:06
DDL Vs DML: 21:05
Spring JDBC update() vs execute() 25:21
Spring JDBC batch insert:28:36
1629275820
Hi, In this video we will set up and configure the spring jdbc. I have clubbed up three different videos of my spring jdbc course together. So first, please have a look at the contents that we are going to cover.
#spring
1629243000
As discussed, we are going to implement the spring mail API in our project. So to get started, we must develop an email screen first.
In this video, we are going to create the UI for the email form.
I am also going to explain, How to transfer data between different screens.
In episode no 4, We learned how to use @RequestParam.
Well, The @RequestParam will help, when you are receiving data through the query string. But imagine a URL "myUrl/{DynamicData1}/{DynamicData2}.
How can we handle this kind of URL which contains dynamic data?
Well, Today I will also give you an Introduction to @PathVariable. The @PathVariable will help you handle the URL containing dynamic data in it.
Last but not least, I will also explain why it's not good to send data using URL. I will walk you through some scenarios, where sending data through URL can be a headache. (WHEN should we not transfer data through URL)
Once I cover all of this, I will talk about the session and cookies in the next video of my spring MVC intermediate series.
Here's the Video Map :
⏱️TIMESTAMPS⏱️
Introduction 00:00
Requirement walkthrough 02:38
Solving a Puzzle 26:21
Sending data With URL 35:27
@PathVariable 37:50
1629232080
In this video, we will have a hands-on session on Property Editor, Validator, Converter, Formatter, Init Binder. We will go through different scenarios and, we will fix them as well.
You will also learn to configure property place holders in a properties file and, you will be able to deal with the type miss-match problem in a Spring MVC application.
So the first goal for today is to learn the init binder and then to configure property editor with our spring application. I will also teach you to create custom property editors in this video. We are not only going to write our editors, but We will be using some built-in property editors as well.
Once we completed learning editors, We will be creating some form validators. As we have completed learning about the JSR 303/349 validators in the earlier videos, we will be learning about the spring's validation API.
Spring has its validation support and, we can create our custom validator using the spring's validator interface. I will be giving you a few examples and assignments on this concept.
Apart from this, We will cover the difference between formatter and editor. I will compare the formatter, editor, and converter together.
Video Map:
⏱️TIMESTAMPS⏱️
Introduction 00:00
init binder : 00:05:12
String trimmer editor: 00:16:42
Property Editor Theory: 00:31:26
webdata binder: 00:38:36
String trimmer editor debugging: 00:45:30
Custom Date Editor: 00:51:40
custom number editor: 01:02:08
create custom editor: 01:09:50
create custom currency editor: 01:22:18
Init binder formatter registration: 01:36:12
formatter vs property editor: 01:39:46
introducing Converter: 01:51:41
Introducing Validator: 02:03:31
Custom Email Validator: 02:28:13
property Placeholders : 02:47:34
Type Miss Match Problem 03:00:50
1629220980
Let's learn to create ANNOTATIONS to validate web forms. In this video, We will develop our custom validators.
We must aware of these concepts as there is no real-world application exists which doesn't use custom validators.
There are different ways to build custom validators. Today we will develop custom validators using the JSR 303/ 349/ 380. We will use the hibernate validators / Java bean validation API as the dependency.
Our goal is here to create some annotations like @Size, @NotNull, @NotBlank. In this video, we will create an annotation called @Age to validate the age field of our project.
Below are the contents we will be covering in this tutorial.
Video Map:
⏱️TIMESTAMPS⏱️
Introduction 00:00
Bean Validation API [remaining] : 06:09
Create Custom Annotation[Theory] : 15:05
Java Retention Policy : 21:10
Custom Validation constraint[Theory] : 29:27
The 20 Minutes Challenge: 32:56
Looking into Hibernate Validator source code
@Size/ @NotBlank Source code Analysis: 34:53
Understanding the Resource bundle: 45:16
Developing @Age annotation: 55:50
Writing a validation constraint class: 01:03:27
Implementing the logic: 01:11:24
Let's Debug: 01:30:35
An important scinario : 01:36:14
Configuring properties file with our app(Analysis) 01:39:07
Adding a properties file : 01:45:35
Implementing the MessageSource bean/ResourceBundleMessageSource : 01:48:19
Implementing LocalValidatorFactoryBean :02:01:47
Wrapping up with assignment: 02:08:35
1629210060
Spring MVC Formatter: First of all, Why do we need a formatter? Well, The importance of a formatter comes when our app requires some special formartting. Imagine a phone number like 91-213132131212, which needs to be bind with a Phone object having a string country code, phone number properties.
A scenario like this needs to be handled by the developer by using an interface called Formatter.
When The user submits a form, all the input we get in string format. Spring framework internally converts all the values to a required data type.
Now, The problem comes when the auto data binding fails. Think about the phone number example, Where the user gives the phone input as the String and, We need to convert the string to a phone object.
Here, We need to bind the data manually by using the Spring Formatter interface.
We will have a deep dive into this concept here in this video.
To Use the Formatter interface, We need to understand three different interfaces.
Formatter Interface
Printer Interface
Parser Interface
The Printer and the Parser Interface have the print() and the parse() methods, respectively.
The print() helps for displaying the object, whereas the parse helps for the conversion of an object.
We will take the help of an eclipse debugger to understand the flow of execution. I will encourage everyone to start debugging the web app as it will help us to have a batter clarity.
----------
Here is the video map :
Video contains : 00:00:00
Why Late upload? : 00:02:16
Adding a communication channel to our app: 00:06:20
Do's and Don't: 00:12:56
How to handle nested objects: 00:15:01
Why a Formatter is required: 00:24:58
Formartter introduction : 00:37:00
Printer and Parser deep dive: 00:38:51
Writing a Phon number formatter: 00:40:00
Registering the formatter with the app: 00:44:00
Print method Logic implementation: 00:53:53
Parse method implementation : 01:06:49
Bug Fixes: 01:24:11
Assignment one (Defect) : 01:35:55
Assignment two (Story): 01:40:28
Wait for a Twist: 01:45:23
Bye Bye: 01:52:00
1629199020
The Bean Validation API is the key concept that we are going to learn today. When we work in a web application, we need to do the form validation to make sure our business logic satisfies.
To perform the bean validation/ form validation, we need the JSR 303/349/380.
Hibernate provides the implementation to the above JSR's otherwise called as hibernate validators. We are going to use the hibernate validation 6.0 series for our spring MVC app.
-----------
Here is the video map for this video:
Introduction 00:00
spring MVC form validation introduction :
Why Serverside validation?:
Client-side vs Server-side validation:
What is JSR/JCP?
Introduction to bean validation API :
Spring MVC/ Spring Boot Form Validation hands-on:
Using the client-side and the server-side validation together:
Designing the term and condition checkbox for our app:
-------
#spring
1629177180
InThis tutorial, We will build a registration form using the Spring MVC form tag. Spring MVC tags are special tags that are helpful for data binding. I will give you a complete code walkthrough of some of the most used form elements. eg. textbox,radio button,dropdown,password field,checkbox etc. These elements could be
created by using form:input, form:radiobutton, form:select, form:password , form:checkbox respectively.
We will be building a registration form and will go through a full stack tech walkthrough.
1.Creating a Registration controller
2.Design Registration form using spring MVC form tag
2.Design a registration dto(data transfer object) for data binding
3. Handling the form submission.
4.Capturing data using @ModelAttribute (model)
5.using jstl for the array data iteration
1629166200
'Spring MVC/Spring boot' data binding' is one of the foundations for spring application development. In this video, I am going to give you a step by step walkthrough to transfer data page-to-page. Here is the video map for this video.
Design the LC App Landing Page - 02:11
Understand the application URL - 15:43
What is a query string? Deep Dive - 15:43
Using the Google Developer tool - 28:44
Capturing data using @RequestParam annotation - 32:19
Data transfer object in spring MVC Introduction - 48:12
How to transfer data in spring using a DTO - 50:00
How the spring MVC data binding work behind the scene - 01:03:21
Spring MVC form tags Introduction - 1:15:19
Two-way Data binding in Spring MVC/ Spring Boot - 01:07:59
@ModelAttribute annotation in Spring MVC/ Spring Boot - 01:27:44