JPA And Hibernate Tutorial For Beginners with Spring Boot and Spring Data JPA

Sdílet
Vložit
  • čas přidán 25. 07. 2024
  • JPA And Hibernate Tutorial For Beginners with Spring Boot.
    ► LEARN "Big Picture" of FULL-STACK, CLOUD, AWS, MICROSERVICES with DOCKER and KUBERNETES in **30 MINUTES** - links.in28minutes.com/in28min...
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Join Our Free Courses
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ► FREE 5 DAY CHALLENGE - Learn Spring and Spring Boot - links.in28minutes.com/yt-free...
    ► Learn Spring Boot in 10 Steps - links.in28minutes.com/yt-free...
    ► Learn Docker in 10 Steps - app.rebrandly.com/links/5d3a1...
    ► Download Presentation and Notes - courses.in28minutes.com/p/in2...
    ► All Spring Boot Articles - www.springboottutorial.com/spr...
    LEARN "Big Picture" of FULL-STACK, CLOUD, AWS, MICROSERVICES with DOCKER and KUBERNETES in **30 MINUTES** - • 01 - Microservices, Do...
    Follow Ranga on LinkedIn - / rangakaranam_thank-you...
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Our Top 10 Courses
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    30+ Courses. 500,000+ Learners. Amazing Reviews.
    ► 1. Master DEVOPS with Docker, Kubernetes and Azure DevOps - links.in28minutes.com/DevOps-SBT
    ► 2. Become FULL STACK DEVELOPER with SPRING BOOT and REACT - links.in28minutes.com/in28min...
    ► 3. Master MICROSERVICES with Spring Boot and Spring Cloud - links.in28minutes.com/in28min...
    ► 4. Become AWS CERTIFIED Solution Architect - links.in28minutes.com/aws-arc...
    ► 5. Learn SPRING in 100 Steps - links.in28minutes.com/in28min...
    ► 6. JAVA PROGRAMMING for Complete Beginners in 250 Steps - links.in28minutes.com/in28min...
    ► 7. Go FULL STACK DEVELOPER with Spring Boot and Angular - links.in28minutes.com/in28min...
    ► 8. Master Java Unit Testing with Spring Boot & Mockito - links.in28minutes.com/in28min...
    ► 9. Spring INTERVIEW GUIDE - links.in28minutes.com/in28min...
    ► 10. Java INTERVIEW GUIDE - links.in28minutes.com/in28min...
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    FREE Courses For You
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ► 01. Learn Full Stack, AWS, Cloud, and Microservices - • Learning Paths - Java ...
    ► 02. Learn Spring and Spring Boot in 5 DAYS - links.in28minutes.com/5-day-s...
    ► 03. AWS Certified Solutions Architect Associate - links.in28minutes.com/sbt-tea...
    ► 04. Getting Started with DevOps and Cloud - links.in28minutes.com/5-day-s...
    ► 05. Learn Docker in 10 Steps - links.in28minutes.com/in28min...
    ► 06. Learn Kubernetes in 10 Steps - links.in28minutes.com/in28min...
    ► 07. Learn AWS in 10 Steps - links.in28minutes.com/in28min...
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Other Recommendations
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ► MOST WATCHED VIDEOS - • Our Most Watched Tutor...
    ► 25+ PLAYLISTS - czcams.com/users/rithustu...
    Github Code - github.com/in28minutes/gettin...
    JPA And Hibernate Tutorial For Beginners
    In this video, we learn the basics of JPA and understand how it compares with the earlier attempts of persistence frameworks used to store data to database.
    How does it compare to JDBC?
    How does it compare to Spring JDBC?
    We will understand the basic concepts of JPA
    Entities
    Mappings
    Relationships
    We will create a Spring Boot project with Spring Initializr and create an Entity and Repository to get a big picture of JPA, Spring Data and Spring Data JPA.
    JPA and Hibernate in 10 Steps with H2
    Steps
    Step 1 : Object Relational Impedence Mismatch - Understanding the problem that JPA solves
    Step 2 : World before JPA - JDBC, Spring JDBC and myBatis
    Step 3 : Introduction to JPA
    Step 4 : Creating a JPA Project using Spring Initializr
    Step 5 : Defining a JPA Entity - User
    Step 6 : Defining a Service to manage the Entity - UserService and EntityManager
    Step 7 : Using a Command Line Runner to save the User to Database
    Step 8 : Magic of Spring Boot and In Memory Database H2
    Step 9 : Introduction to Spring Data JPA
    Step 10 : More JPA Repository : findById and findAll

Komentáře • 89

  • @deveshtyagi7871
    @deveshtyagi7871 Před 3 lety +32

    15:17 example jpa mapping
    18:50 example jpa with spring boot
    27:32 entity class mappings
    30:39 entity manager
    31:30 repository
    34:28 command line runner
    39:56 jpa dependency configuration

  • @sandeshmaskey1955
    @sandeshmaskey1955 Před 3 lety +7

    22:12 Difference between JPA and Hibernate. Thank you for pointing it out. Good thing to know.

  • @Carayoto
    @Carayoto Před 3 lety

    Great tutorial, I managed to solve the problem where I was stuck, appreciated.

  • @indrajithvinodnair
    @indrajithvinodnair Před rokem

    Bruh this stuff is just liquid gold. More power to you mate.

  • @pushparay5554
    @pushparay5554 Před 4 lety

    U r doing great job man.. Want ur success in every way .

  • @mrinalraj7166
    @mrinalraj7166 Před 3 lety

    Exactly what I was looking for

  • @MrDroy13
    @MrDroy13 Před 5 lety +1

    This was a really great step by step tutorial. Thank you!

  • @efm2275
    @efm2275 Před 2 lety +3

    That fart at 1:57 gives me life

  • @kislayaaakash7769
    @kislayaaakash7769 Před rokem

    Very nicely explained , my basics are now super clear

  • @veerrajumandavilli9114

    Excellent one.. You have explanation is super and covered most of important things to know

  • @habibbenmammar2203
    @habibbenmammar2203 Před 5 lety

    Hi, with Hibernate can I map my columns dynamically? I have many users and each one can define a different set of columns to use(those preferences are stored in a table) and when hibernate starts I don't know which columns will be used by every user before I load the preferences table.

  • @afifkhaja
    @afifkhaja Před 2 lety

    Thanks for this

  • @krzysztofstrzegomski5662

    That's quite a tutorial. Great work!

  • @manasbhatt1892
    @manasbhatt1892 Před 3 lety +1

    ❤️❤️ amazing and short

  • @learnandearn131
    @learnandearn131 Před rokem

    Awesome lecture, thank you bro.

  • @souvikpodder9515
    @souvikpodder9515 Před 3 lety +1

    What is the reason behind having the default constructor?
    I just tried out findAll method throws exception if the default constructor is not provide.

  • @deveshtyagi7871
    @deveshtyagi7871 Před 3 lety

    Thanks sir for such tutorial

  • @spnarayanrao
    @spnarayanrao Před 3 lety

    Thanks for nice explanation video, can you please provide Many to many relational ship example also.

  • @ntigirishari
    @ntigirishari Před 4 lety

    Thank you, sir :-) This tutorial helped me a lot!

  • @avirajsingh516
    @avirajsingh516 Před 4 lety +4

    I did not get msg of "New User is created" means...my record has not been inserted...even no error msg

  • @_randomstuff
    @_randomstuff Před 2 lety

    I am having a doubt, if we are creating a new command line runner class for save and findbyid method in it. What abt the initial command line runner where main is present which gets run fist. We know that thread starts from main how new command line runner starts.

  • @umangabhatta6304
    @umangabhatta6304 Před 5 lety

    HELP PLEASE!!
    it keeps on giving the error Consider defining a bean of type 'service.UserDAOService' in your configuration.

  • @sohilgandhi2820
    @sohilgandhi2820 Před 4 lety +2

    Hello, I am having an issue with running the java application at 37:44. It shows Application Failed To Start and it says Port 8080 is already in use. Please help!

  • @mathemankwana
    @mathemankwana Před 4 lety

    This is a great review. thanks alot

  • @chinmayabehera513
    @chinmayabehera513 Před 3 lety

    Good Morning Ranga Sir.
    I have created a Springboot,Jpa project and configured
    2 databases. Can we update the existing records with Unique constraint? Table doesn't have Primary Key.
    Here, I am fetching the records from Azure MS SQL Server View and Loading into On Premise Oracle DB Table. In Azure Microsoft SQL Server View, most of columns are having duplicate values. Here, I am fetching the data from Azure DB , then deleting the existing records from Oracle table and inserting the Azure Db data into Oracle DB table. Instead of deleting the existing records from Oracle Db table, can we update the existing records in Oracle DB table ??

  • @TheMunishprashar
    @TheMunishprashar Před 4 lety

    sir i have few doubt on JPA , please help me
    1) i do not want to define PK/FK at db level but in my jpa @query i want to implement joins , how can we achive this (with regular code its giving error or trying to create ddl (ddl=true enabled) )
    2) sometimes we use self join so there as well the relation changes based on requirement, so what to use joins without defining relation
    3) in JPA is it possible to define entity without PK ?
    Please help me

  • @ursfren
    @ursfren Před 3 lety

    How to index pdf content by using spring-data?
    We will really appreciate if some one can answer this question.

  • @mariojulioosminzaldivaralv9172

    I think the course should be updated. The spring initializr project that is downloaded in the video is too old, but if we follow the steps with the newer version of initialzr, things are broken. Like, in the case of the JPA project, I had the following error right after trying to start the server: "Error creating bean with name 'dataSource' defined in class path resource". Great content, but needs to be updated for newer students. Thanks!

    • @the_rocker7786
      @the_rocker7786 Před rokem

      It should be a dependency issue try removing version from dependency

  • @swathihegde7475
    @swathihegde7475 Před 4 lety

    Your video is nice but can u make a video using intellij without using springboot and using SQL or oracle dB I am trying but I don't know how to do

  • @jackieg3291
    @jackieg3291 Před 2 lety

    Thank you, magician. amazing video. Do you provide a course where I can watch your lecture with (paper study source)pdf or ppt...etc, which will help me revise without machine?

  • @raghavendrac1053
    @raghavendrac1053 Před 2 lety

    What about how to fectch r modify data in mysql using java criteria builder quire's ?

  • @vivekbhargav2320
    @vivekbhargav2320 Před 5 lety +1

    Can you please make a video on EclipseLink ORM?

  • @asashish905
    @asashish905 Před 2 lety

    How can I clear EM cache if I'm using Spring Data JPA?

  • @mohangabhale5555
    @mohangabhale5555 Před rokem

    I am using Linux OS Ubuntu so where can I get Hibernate Jar files for eclipse

  • @AbhishekSharma7
    @AbhishekSharma7 Před 5 lety +2

    Hi, thanks for this video, it was really helpful. I have issues and unable to figure it out. I have 3 table: 1. Pics; 2. Album 3. Pics-Album relation.
    Now, let's say I have 100 pics and I have created an Album 'abhi' and put 5 pics into that album. This will add 5 records in Pics-Album relation table. Then if I update Album name, hibernate is running a delete query and removing all records from Pics-Album relation table. Can you please help ?

  • @Shiva-zy7jq
    @Shiva-zy7jq Před 4 lety +4

    JPA starts at 13:15

  • @alejandrobazaco992
    @alejandrobazaco992 Před 2 lety

    you are the beeeeeeeeeest

  • @sureshmanne7245
    @sureshmanne7245 Před rokem

    26:20 can use lombok now and avoid manual implementation of getters/setters

  • @manideep7717
    @manideep7717 Před 4 lety

    Sir please help us in MySQL database

  • @ankitagupta6232
    @ankitagupta6232 Před 2 lety

    Is @EnableTransactionManagement important to be added if we are adding @Transaction?

    • @ankitagupta6232
      @ankitagupta6232 Před 2 lety

      Can you tell me any tutorial where you have explained about @EnableTransactionManagement and when this is to be used

  • @nabackgames
    @nabackgames Před 3 lety

    I'm getting an error when inserting the data in database... It's returning a nullPointer...

    • @rohittambat8552
      @rohittambat8552 Před 3 lety

      Check if you have added @Transactional annotation on class if that also dont work, try adding it to the method.

  • @sriramkumar6673
    @sriramkumar6673 Před 4 lety +1

    Tutorial bahut Acha but itta kaun padta hai :p

  • @Channel_24_7
    @Channel_24_7 Před 3 lety +1

    7:48

    • @rveach02
      @rveach02 Před 3 lety

      I came here just for this.

  • @geraldlerman786
    @geraldlerman786 Před rokem +2

    I'm halfway through but there are a couple of things that are outdated that may give you grief if you are trying to do this tutorial hands-on.
    1. Package names can no longer start with "javax" as in javax.persistent.Entity. Due to Oracle owning the name "Java", they now begin with "jakarta".
    2. Most importantly, do not create an Entity class "User" as instructed in this video. Hibernate will try creating a table named, "user" which is now a reserved word (unless surrounded by double quotes which you can't do) and the database creation will fail with a syntax error. I refactored the class name from "User" to "UserRecord" and the syntax error went away.
    3. When trying to use the H2 console, the name of the database isn't what the video provides. You'll see it printed in the console when the code begins to run. Mine is showing within this line: "H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:dc546f69-7404-4bd1-9488-77d7a7d543b4'

    • @in28minutes
      @in28minutes  Před rokem +2

      1. Absolutely right. Spring Boot 3 uses Jakarta EE.
      2. Easier way would be to add @Entity Annotation. @Entity(name = "user_details") public class User {
      3. I would recommend setting up a proper URL: spring.datasource.url=jdbc:h2:mem:testdb (add to application.properties)
      Debugging guide has more details - github.com/in28minutes/in28minutes-initiatives/blob/master/The-in28Minutes-TroubleshootingGuide-And-FAQ/jpa-and-hibernate.md#tables-are-not-created

    • @geraldlerman786
      @geraldlerman786 Před rokem

      @@in28minutes Nice! Thank you very much for the updates. I will make them and play some more. And, thank you for the huge amount I've learned from several of your Udemy courses already!

  • @ayushman_sr
    @ayushman_sr Před 5 lety +10

    1:55 Strange!!

    • @emanuelb.2559
      @emanuelb.2559 Před 5 lety

      that was a bug

    • @yahya2765
      @yahya2765 Před 5 lety

      hahaha. I yelled at my roommate for no reason 😂😂😂

    • @peterhall4216
      @peterhall4216 Před 5 lety +1

      @@emanuelb.2559 A stomach bug

    • @saif477
      @saif477 Před 5 lety +3

      if you hear it closely you know he is farting in middle of video

    • @brianolsen87
      @brianolsen87 Před 5 lety +2

      8:34 is another one 😂

  • @victorbear4904
    @victorbear4904 Před rokem

    It’s nice tutorial but it’s old and sometimes has fart sounds

  • @nicktolmie6102
    @nicktolmie6102 Před 4 lety

    user repository has no inbuilt method called save according to eclipse

    • @nicktolmie6102
      @nicktolmie6102 Před 4 lety

      ahh it ignore. it just wasn't registering because i hadn't saved the user repository file.

  • @pronoy.sarkar
    @pronoy.sarkar Před 3 lety

    ok

  • @joshuacaponong3397
    @joshuacaponong3397 Před 4 lety +4

    What's with the farts lol

    • @joshuacaponong3397
      @joshuacaponong3397 Před 4 lety

      @@in28minutes Haha okay. Great tutorial btw, if only I knew this before I could have applied this from my previous jobs.

  • @murali71
    @murali71 Před 3 lety

    In 28 minutes became in 60 minutes

  • @ehsandmt3710
    @ehsandmt3710 Před 2 lety +2

    Fart ..? 1:57

  • @hetalpadia8381
    @hetalpadia8381 Před 3 lety

    getting this in browser:
    Whitelabel Error Page
    This application has no explicit mapping for /error, so you are seeing this as a fallback.
    Sat Mar 06 23:20:45 IST 2021
    There was an unexpected error (type=Not Found, status=404).

  • @lakshmanpalli2925
    @lakshmanpalli2925 Před 2 lety +1

    vague explanation :(

  • @shredharc
    @shredharc Před 3 lety

    voice pitch should be consistent, pitch is going up and down and up and so on...

  • @madhusudan6840
    @madhusudan6840 Před 3 lety

    7:48 12:00

  • @kipitrash9403
    @kipitrash9403 Před 4 lety +2

    What the fuck is that squeaking

  • @sumityadav257
    @sumityadav257 Před 3 lety +1

    Your voice is very irritating at the end of sentence.

  • @varunmanjunath8933
    @varunmanjunath8933 Před rokem

    I am not getting the transactional annotation(javax.persistence.annotation). Can some one help me to solve this!