Тёмный

Spring Boot | JPA / Hibernate Composite Primary Key Example | JavaTechie 

Java Techie
Подписаться 173 тыс.
Просмотров 34 тыс.
50% 1

This tutorial will guide you how to map a composite primary key in Spring Boot application using spring data JPA
#javatechie #SpringBoot #SpringDataJPA #MySQL
GitHub:
github.com/Java-Techie-jt/spr...
Blogs:
/ javatechie
Facebook:
/ 919464521471923
guys if you like this video please do subscribe now and press the bell icon to not miss any update from Java Techie
Disclaimer/Policy:
--------------------------------
Note : All uploaded content in this channel is mine and its not copied from any community , you are free to use source code from above mentioned GitHub account

Наука

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

 

27 дек 2020

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 59   
@anilmaurya55
@anilmaurya55 3 года назад
You are the only one great teacher on RU-vid who gives proper explanation with example thanks
@Javatechie
@Javatechie 3 года назад
Thanks buddy
@prajapati-parmod
@prajapati-parmod Месяц назад
Thanks, Java Techie. got a clear picture in a short time.
@user-ue8jm7ys3k
@user-ue8jm7ys3k 3 года назад
Excellent Sir I have learn lots concept your video and also implement my project. Thank You Sir
@anuragarora2960
@anuragarora2960 11 месяцев назад
One in very few channels on RU-vid who provide good industry level knowledge in technology after learning from here one can easily work in industry level projects
@Javatechie
@Javatechie 11 месяцев назад
Thanks buddy keep learning 😃
@lyriobatanga6303
@lyriobatanga6303 2 года назад
Thanks a lot. You saved my day!
@deeplife9654
@deeplife9654 2 месяца назад
Super nice ❤. Short and crispy. No too much talking but on the point.
@raghuvardhansaripalli9636
@raghuvardhansaripalli9636 3 года назад
Thanks Bro. You ate awesome..keep it up..God Bless You..😊
@venkychannel2798
@venkychannel2798 3 года назад
Good stuff .. keep on update..
@jorgevalverde9064
@jorgevalverde9064 2 года назад
Nice, thanks!!!
@mountinrose6722
@mountinrose6722 3 года назад
Thank you !! It's solve may problem in fews days. I am using @IdClass, before I used @EmbeddedId and it make me headaches. Great jobs Brother !!
@surajbaranwal56.
@surajbaranwal56. Год назад
Helpful thanks men
@yuwaan2.0
@yuwaan2.0 Год назад
Good explanation
@pratishrutipanda6461
@pratishrutipanda6461 3 года назад
Nice video sir
@bhaktilatadash7619
@bhaktilatadash7619 3 года назад
Thank u👍👍
@umamaheswarreddy9204
@umamaheswarreddy9204 3 года назад
Very nice
@learningjavawithme915
@learningjavawithme915 3 года назад
You are excellent
@perumalsamygiri2645
@perumalsamygiri2645 Год назад
Very nice sir
@phanirajnagalamadugu254
@phanirajnagalamadugu254 3 года назад
Nice. It will be helpful if you create another video which explains Composite key with one to many relationship between parent and child tables.
@Javatechie
@Javatechie 3 года назад
Okay I will
@deepakmarneni2110
@deepakmarneni2110 3 года назад
Thank you. nice. could you please make a video on one to one, many to one, many to many, and all CASCADE types with examples.
@Javatechie
@Javatechie 3 года назад
Hi Deepak it's already there please cross verify once
@subhashreesahoo5760
@subhashreesahoo5760 Год назад
is it possible to get findby one pair , nd delete and update operation possible?
@goku6272
@goku6272 3 года назад
As we know there should be one primary key in table, if one using composite primary key(@EmbeddedId) can i use @Id also
@vaishnavinaik1559
@vaishnavinaik1559 Год назад
Very explained !! But what I have observed is even though I have updated primary key from one column to composite key with 2 columns in DB it is working fine in spring boot application without changing entity class. Entity class is still using old PK as @Id.
@Javatechie
@Javatechie Год назад
Yes it will allow as we haven't created constraints in db
@sureshmaheshuni372
@sureshmaheshuni372 3 года назад
Can you do the playlist on java 8 features
@shaileshsingh5664
@shaileshsingh5664 3 года назад
Much needed tutorial since old hibernate wasn't able to support composite key Now it supports. Hi sir need to store spatial and JSON data from hibernate. Can you please make a tutorial. And cucumber tutorial with spring Boot.
@Javatechie
@Javatechie 3 года назад
Cucumber tutorial is already uploaded please search in javatechie
@vrijilk8532
@vrijilk8532 3 года назад
Is it possible for auto entity generation based on sql schema instead of manual creation?? Like Asp.net Entity Framework?
@Javatechie
@Javatechie 3 года назад
Virij in mybatis there is an option but am not much aware about this
@vrijilk8532
@vrijilk8532 3 года назад
@@Javatechie can we try? That is much better .
@srikanthchowdary8595
@srikanthchowdary8595 3 года назад
Hai bro great explanation can you also explain why we need to override the equals nd hashcode method of compositeId class ?
@angajam
@angajam Год назад
HahCode and equals method will used internally for equality of entities. If two entities with same hashCode and equals are inserted then hibernate will allow only one using equals and hashCode.
@varshapardeshi4779
@varshapardeshi4779 Год назад
Thank You.. Do you have any video on shared primary key for springboot jpa?
@Javatechie
@Javatechie Год назад
Please check my association mapping videos
@vinodkumarsahu7726
@vinodkumarsahu7726 3 года назад
How to update with composite key?
@bollywood90ssongs65
@bollywood90ssongs65 2 года назад
can you please make video on how to use Employee and Department as @OnetoMany relationship with composite key that will help us more.
@Javatechie
@Javatechie 2 года назад
You can checkout my one to many video using jpa
@puneetsaneja3007
@puneetsaneja3007 3 года назад
Hi. Which approach is preferable. @Idclass or @embeddable ?
@Javatechie
@Javatechie 3 года назад
Embedded
@abhishekgupta7675
@abhishekgupta7675 2 года назад
ankur bhaiya ke ads still annoy the same.
@Javatechie
@Javatechie 2 года назад
Brother as I mentioned earlier to you.add decided by RU-vid algorithm. I don't have any option to choose add by myself 😜
@luckytheracer4557
@luckytheracer4557 9 месяцев назад
sir i actually do not understand the need of composite key. Cant it get solved with table normalization. Where is the real usecase still confuse
@pravinchavan7147
@pravinchavan7147 3 года назад
how can we use @generatedvalue for employeeId?
@Javatechie
@Javatechie 3 года назад
It won't work for no SQL you need to create custom approach please check already I explained how you can do same using mongo DB
@vaibhavasrivastava3957
@vaibhavasrivastava3957 Год назад
how will findByID or deleteById work in this case??
@Javatechie
@Javatechie Год назад
Even though we declared composite key still we have 1 pk right? Using that we can play
@Cosmicwaves9909
@Cosmicwaves9909 3 года назад
Please make one to one, one to many, many to many using composite primary key in jpa
@Javatechie
@Javatechie 3 года назад
Okay Many to Many I will try
@prajyotlawande193
@prajyotlawande193 3 года назад
You gotta be really careful with Lombok there. @Data already includes @EqualsAndHashCode. Hence using @Data on Employee entity will lead to inclusion of all the Employee fields in its equals and hashcode methods, which I don't quite think will be correct.🙄
@Javatechie
@Javatechie 3 года назад
Agreed 👍
@krishnasaic
@krishnasaic 2 года назад
How to use findById() here where i want to particularly search by one of the Pkey where it can return list of entities associated with that id.
@Javatechie
@Javatechie 2 года назад
No you should search with composite key
@krishnasaic
@krishnasaic 2 года назад
@@Javatechie Then should i go for custom query?? If i want to search by specific pKey
@krishnamohan5771
@krishnamohan5771 8 месяцев назад
in those we have to go by @idClass approach@@krishnasaic
@Raj-hm6qi
@Raj-hm6qi 3 года назад
Nice video sir
Далее
iPhone 16 - НЕ СТОИТ ПРОПУСКАТЬ
4:50
Samsung laughing on iPhone #techbyakram
0:12
Просмотров 676 тыс.