Тёмный

JPA @ManyToMany Mapping With Embedded ID as the Composite Key And How to Insert Data 

Don Hash
Подписаться 891
Просмотров 12 тыс.
50% 1

This tutorial explains about the way that we need to create entities with composite keys where the linking table has more attributes than the two IDs from the parent table.
How to use embedded id in such situations and how to insert data to the linking table when an embedded id is used.
github: github.com/lahiruhashan/Sprin...
Happy Coding.

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

 

8 июл 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 21   
@diegoinzakl
@diegoinzakl 3 года назад
Thanks for your work, i can added this method in my project, greetings :)
@deletefromusers5573
@deletefromusers5573 2 года назад
This video helped me a lot. I'm really thankful. Btw throug your video i have found an amazing book that cover a lot of common issues with jpa, the book is "Hibernate tips more than 70"
@Gohel95
@Gohel95 4 года назад
Thanks, Dude... It was a nice explanation. keep it up .
@josesalas2944
@josesalas2944 2 года назад
Nice video, thanks for your work :)
@user-wy7bb7gz4o
@user-wy7bb7gz4o Год назад
Thank you so much, it really helped me a lot🙏🏻🙏🏻!!!
@mullertm4778
@mullertm4778 3 года назад
Thank you so much
@nguyentrongvan9647
@nguyentrongvan9647 Год назад
thanks for yours work
@kiransekhar5997
@kiransekhar5997 Год назад
thanks this helped me
@moisescanta2444
@moisescanta2444 Год назад
How do i do update?
@santhoshshetty4500
@santhoshshetty4500 4 года назад
Thanks Lahiru Hashan, can you please explain me, how to fetch the records from these tables. say, I want all the vehicles owned by a customer. Thank you.
@krzysztofp6329
@krzysztofp6329 4 года назад
Hey! Thanks for your work. Is it possible for you to add an example how to add single customer, vehicle and connection between them in code? Also can you insert whole project on github with pom file etc?
@krzysztofp6329
@krzysztofp6329 4 года назад
To CustomerService add: @PostConstruct public void populateTestData() { Customer newCustomer = new Customer("John"); Vehicle newVehicle = new Vehicle("Mazda"); customerRepository.save(newCustomer); vehicleRepository.save(newVehicle); Sale newSale = new Sale(); newSale.setCustomer(newCustomer); newSale.setVehicle(newVehicle); newSale.setDiscount(1); newCustomer.getSales().add(newSale); customerRepository.save(newCustomer); }
@klebergoes896
@klebergoes896 Год назад
When I try to update by composed primary key, receive "Duplicate entry for key primary". Is there some way to update and delete register from sales table into format you made?
@gorkaurzelai5072
@gorkaurzelai5072 Год назад
Can you make a video about how to manage data with this relation? I have some problems like FetchType.LAZY for example. Even I put that to the lists I can't access the other side entity. That one of the examples
@kojofosuedue3686
@kojofosuedue3686 4 года назад
hello, please what is the name of the plugin you are using for the database in intellij
@kojofosuedue3686
@kojofosuedue3686 4 года назад
@@DonHash wow ..thanks ..I'll need to download that then
@Gorky25
@Gorky25 3 года назад
Where is good place to learn and how to use stream(), map(), collect(),...
@tomvanlaeken4392
@tomvanlaeken4392 3 года назад
Streams and Lambda's sure u will find a video abt it
@alonewolf2485
@alonewolf2485 4 года назад
excuse me. i want lean spring boot thymeleaf but many to many. i don't search insert, update, delete like code you, please help me
@southcroydon7462
@southcroydon7462 3 года назад
If the goal is -create entities with composite keys...why talk about other things? Also you didn't put pom. Anyways not what I'm looking for
@blackwalker4157
@blackwalker4157 2 года назад
Hello, please How can I do @GetMapping with Composite key @IdClass? or @Embedded ? I try it but I can't get composite Id key to put into @PathVariable Help me please
Далее
Complex Mapping - Composite Foreign Keys
12:06
Просмотров 9 тыс.
Каха и суп
00:39
Просмотров 1,7 млн
Дарю Самокат Скейтеру !
00:42
Просмотров 250 тыс.
Dependency Injection, The Best Pattern
13:16
Просмотров 760 тыс.
Spring Boot JPA ManyToMany
16:31
Просмотров 607
I've been using Redis wrong this whole time...
20:53
Просмотров 335 тыс.
Rust Data Modelling Without Classes
11:25
Просмотров 164 тыс.