Hibernate Tip: Best way to remove entities from a many-to-many association

preview_player
Показать описание

Today I will show you the best way to remove entities from a many-to-many association. But, before we proceed, please subscribe and hit the bell icon so that you don’t miss any new hibernate tip videos.

Article links:-

Why you should avoid CascadeType.REMOVE for to-many associations and what to do instead:

Ultimate Guide – Association Mappings with JPA and Hibernate:

If you like this video, please give me your thumbs up and share it with your friends and co-workers.

Like my channel? Subscribe!

Join the free Member Library:

Want to connect with me?

#hibernate #JPA #mappings #HibernateTips
Рекомендации по теме
Комментарии
Автор

just now I stuck with the problem while deleting user has many roles.
I watch your video sir I really understand now how the association works. Thank you, sir

rahhi
Автор

You all explain the problems I have, thanks for everything

quanautruong
Автор

Is there a way to like I'm adding @ManyToMany in my entity and trying to pull the 2000 record and around 50 association of each record. This is taking too much time as it's hitting single query every time to bring association
Is there a way we can improve performance?

astha
Автор

thanks you so much for this video's sir, these tips and tricks are life saving for new learners like me :) i have once question do we still use this utility method when using spring data JPA with hibernate ?

AkashJadhavIT
Автор

just watched your video and wanted to run your example using CascadeType.REMOVE. I cannot reproduce the deletion of all books. Only the book written by Author1 gets deleted (Book1) when deleting Author1. Did Hibernate improve by not deleting all associated entities which are also referenced by other entities?

valle
Автор

Sir, if I use Set then I am getting continued loopng, what can I do here

thiru
Автор

thanks for a wonderful video, you explained it well.

kumarabhishek
Автор

Could you make a video on proper use of junction table classes instead of an @ManyToMany annotation? I often see myself needing an additional column and I also feel like it makes my model easier to understand when I use junction table classes instead of @ManyToMany annotations

genericperson
Автор

Thanks a lot. To the point explanation

anurag
Автор

Hi Sir,

Just wanted to confirm, can we use generate property inside an @Embedable class?

himanshusrivastava
Автор

I wish full code was available to proof check

Adyel-YT
Автор

Do you also have the same tips for one-to-many association?

stephanmaier