Тёмный

Spring Data JPA tutorial - Unboxing Spring Data JPA Magic | Spring Boot | JPA | MySQL | Hibernate 

Selenium Express
Подписаться 104 тыс.
Просмотров 29 тыс.
50% 1

In this video, we will unbox the magic of spring data jpa. The Goal here is to understand how Spring Data JPA works internally.
This spring data jpa tutorial will give a step-by-step walkthrough on
1. Build a spring project
2. Configuring Hibernate / JPA / Spring / MYSQL with our Java spring project.
3. Doing CRUD operation with Spring Data JPA
4. Once done, Converting the spring project to Spring Boot
5. Explore spring data jpa with spring boot
6. How spring data JPA works internally
If you want to build a spring boot project that connects to a database, the first thing you will create is a data source.
Datasource in Java holds the connection objects. We can use a DriverManagerDatasource in spring to create a datasource object.
Once the Datasouce setup is done, we can create a EntityManager, which will help us with CRUD operation. EntityManager manages our entities (alternatively called persistence context) and provides a wide range of methods, like persist, remove, find, merge,findAll, etc. This will help us to save, delete, update, and query data from a database.
To create an EnityManager, we can create an EntityManagerFactory first. We only can create an EntityManager from an EntityManagerFactory. In Spring, we need a LocalcontainerEntityManagerFactoryBean to initalize an entity manager factory.
Once the LocalcontainerEntityManagerFactoryBean is set up, then it's time to set up a TransactionManager (PlatformTransactionManager). We can use the JpaTransactionManager to feed it the entity manager factory object to have a fully functional connection setup.
In our DAO, We can use now use an EntityManager with a @PersistenceContext annotation. This will enable us to call the API methods to do CRUD operation.
We can use a @Transactional Annotation on top of our API method to activate and begin/commit the transaction.
Spring Data JPA enables us to automatic repository creation. With the @EnableJpaRepositories we no longer need to write repository classes and the basic CRUD methods to perform data manipulation.
Spring Data JPA will do it all and allows us to have a fully functional CRUD Repository just by extending JpaRepository.
When our custom repository interface extends JpaRepository, it inherits different methods from its super interfaces (CrudRepository, ListCrudRepository, Repository). These methods' implementation is generated in runtime by Spring. Spring Generates this implementation class by using JDK dynamic proxy / AOP proxy.
Data Jpa configuration is so easy when it comes to Spring Boot. We have a one-stop solution to add all the dependencies. We can use a spring boot starter project called "spring boot starter data jpa," and it brings in all the different dependencies that we need to develop a JPA application with spring boot. For MySQL db, we can just add the MySQL driver, and we are ready to go.
We may need to use @EntityScan and @EnableJpaRepositories to scan our Entities and Repository classes.
Let's explore all these concepts in this video! Let's jump right in.
Timestamp
--------------
Introduction - 00:00:00
Build a Maven project - 00:05:34
Building an Entity - 00:07:00
JPA setup - jakarta.persistence-api - 00:08:48
Setting up Repository and EntityManager - 00:13:50
LocalContainerEntityManagerFactoryBean and DataSource setup- 00:23:36
Introducing Hibernate - 00:47:56
Uses of @PersistenceContext - 00:56:42
@Transactional / TransactionManager setup - 01:02:27
Introducing JpaTransactionManager - 01:06:00
EntityManager persist method in action (save) - 01:13:00
Introducing Spring Data JPA - 01:20:00
findAll() implementation with JPA - 01:24:26
Why Spring Data JPA: The Need - 01:29:51
@EnableJpaRepository - 01:37:01
Doing CRUD with Spring Data JPA - 01:38:20
spring data jpa with spring boot - 01:46:19
Spring Boot data jpa autoconfiguration - 01:53:07
@EntityScan - 01:59:04
What's inside the spring-boot-starter-data-jpa dependency?
Activating show-sql in Spring / Spring boot app -02:05:34
The End - 02:07:02
#springdatajpa #springboot #jpa #hibernate
For More free/paid courses visit
www.seleniumexpress.com
LINKS AND FREE LEARNING RESOURCES
========
Watch my new mock interview series for java developers
• Java interview questio...
Watch Spring boot Hot topics
• @Reposicotry Vs @Servi...
Java Interview / Question and Answer series
• Java collections inter...
spring core
• Spring framework tutor...
spring mvc
• Spring MVC course intr...
spring mvc intermediate
• [INTERMEDIATE] Spring ...
For more courses visit
www.seleniumexpress.com
you can ask for support in my website forum
www.seleniumexpress.com
Subscribe to my youtube channel
/ @seleniumexpress
Follow me on Insta
/ selenium_express

Опубликовано:

 

8 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 44   
@SeleniumExpress
@SeleniumExpress Год назад
Hi. There is a delay in uploading the next scheduled video on Spring Boot Foundation series. New video coming on this Wednesday. It will be a 10 hours crash course. Stay tuned to the below playlist for updates ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-F_rGkDeihBg.html Have a good day !
@shanmukhavuyyuri4414
@shanmukhavuyyuri4414 Год назад
excited for upcoming video sir
@45_ritiksharma32
@45_ritiksharma32 Год назад
Waiting
@debiprasaddash654
@debiprasaddash654 Год назад
Waiting
@priyanshu-ji1uk
@priyanshu-ji1uk Год назад
When will the video come? We are eagerly waiting for your video
@debiprasaddash654
@debiprasaddash654 Год назад
Abhilas when are you going to upload this?
@Ramesh-re4eu
@Ramesh-re4eu Год назад
I don't know why abhilash is sooo underrated.. hope you will get wat you deserve..❤❤
@SeleniumExpress
@SeleniumExpress Год назад
Thank you so much, Ramesh ! 😊
@satyajitparija6033
@satyajitparija6033 11 месяцев назад
He is a star
@chintu4609
@chintu4609 Год назад
You are the first person on youtube that deliver this type of content. Hats off👏🙌
@SeleniumExpress
@SeleniumExpress Год назад
Thank you for the kind words !! Hope it helps🥰
@baidyanathpanda1964
@baidyanathpanda1964 5 месяцев назад
First time saw such in depth analysis on jpa
@chukwukaegbujio1450
@chukwukaegbujio1450 8 месяцев назад
This explanation is very clear
@Mohamed-uf5jh
@Mohamed-uf5jh 3 месяца назад
Nice vidoe ! First time saw such in depth analysis on jpa
@akashpisal3582
@akashpisal3582 10 месяцев назад
Fabulous tutorial, invaluable ...Thanks Abhilash
@unemployedcse3514
@unemployedcse3514 5 месяцев назад
Awesome vedio ❤, I don't think any book gives this much knowledge on Springboot, In single vedio I got know difference between spring and springboot,multiple data base configuration, etc ❤
@LeoLeo-nx5gi
@LeoLeo-nx5gi Год назад
Thanks a ton!! This is very awesome and so much informative
@SeleniumExpress
@SeleniumExpress Год назад
Glad you liked it ☺️
@joelchabzola8870
@joelchabzola8870 Год назад
Thanks for this series.
@SeleniumExpress
@SeleniumExpress Год назад
Welcome! ❤️
@eprohoda
@eprohoda Год назад
Nice to meet you!so interesting shots!Selenium- 💫
@SeleniumExpress
@SeleniumExpress Год назад
Glad you liked it 😊
@vino7tech
@vino7tech Год назад
Thank you very much spring boot guru ji 🙏🙏🙏
@SeleniumExpress
@SeleniumExpress Год назад
My pleasure 😀
@shekhar1497
@shekhar1497 4 месяца назад
Thank you
@csrchandra8832
@csrchandra8832 Год назад
Vedio super information macha 🎉 it helps alot for all of us
@SeleniumExpress
@SeleniumExpress Год назад
Glad to hear that ☺️
@santhoshchandran6952
@santhoshchandran6952 Год назад
Thank you Abhi❤
@SeleniumExpress
@SeleniumExpress Год назад
My pleasure, Santhosh 😊
@kalidsherefuddin
@kalidsherefuddin 7 месяцев назад
Thanks for
@user-xo1oj8vs7p
@user-xo1oj8vs7p 8 месяцев назад
Hi Selenium, One Request, Can you guide or make videos on one to one and other relationship, Where when and which scenario approach should follow to join the tables.
@DurgaShiva7574
@DurgaShiva7574 Год назад
100th like by me, great job abhilash.
@SeleniumExpress
@SeleniumExpress Год назад
Thank you, Durga !
@akashpisal3582
@akashpisal3582 10 месяцев назад
Abhilash, Do you know how to map hibernate entity to postgres json column in Spring boot using data jpa..... also if possible w/o using any external library
@mohammadabrarbaqtiyar3142
@mohammadabrarbaqtiyar3142 9 месяцев назад
Hi is it possible to call a oracle function with output parameters using spring Data JPA?
@RahulVerma-yl8bd
@RahulVerma-yl8bd 5 месяцев назад
We want videos on hibernate mappings please🙏🙏
@kanchanshelke9992
@kanchanshelke9992 Год назад
sir, please make videos on spring boot. I have completed the full spring playlist. please upload ASAP SpringBoot playlist.
@dileepsimham9302
@dileepsimham9302 Год назад
sir, can you please make a video on oauth2.0
@DeepakSharma-cv2tj
@DeepakSharma-cv2tj 11 месяцев назад
failed to configure a datasource: 'url' attribute is not specified and no embedded datasource could be configured. reason: failed to determine a suitable driver class action: consider the following: if you want an embedded database (h2, hsql or derby), please put it on the classpath. if you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
@user-me7jk9lx1m
@user-me7jk9lx1m Год назад
spring kafka ku video poduga bro
@sanskaari.24
@sanskaari.24 9 месяцев назад
How can we attend your live lectures too?
@phaniharshadasari8685
@phaniharshadasari8685 4 месяца назад
Named query, named native query and jpql not covered in video?
@hiteshsharma9192
@hiteshsharma9192 3 месяца назад
This is the first video of urs which is confusing me
@Alexis-nv9gl
@Alexis-nv9gl 11 месяцев назад
'Promo sm'
Далее
What is JPA? | JPA Implementation
26:21
Просмотров 377 тыс.
когда мучает жажда // Eva mash
00:58
Просмотров 386 тыс.
Spring Data JPA from 0-100 in 60 minutes
1:02:31
Просмотров 81 тыс.
Top 10 Spring Annotations to know in 2024
26:41
Просмотров 74 тыс.