Duration 9:35

Best Practices for Many-To-One and One-To-Many Association Mappings

48 782 watched
0
556
Published 28 Nov 2017

Today, I want to talk about best practices for many-to-one and one-to-many association mappings. When you model your database, you will most likely define several of these associations. And it’s, of course, the same when you model your entities. It’s quite easy to do that with JPA and Hibernate. You just need an attribute that represents the association and annotate it with a @ManyToOne or @OneToMany association. But as easy as it seems, there are several pitfalls that you can avoid by following a few best practices. Why you should avoid CascadeType.REMOVE for to-many associations and what to do instead:- /watch/YcRCNJd8yFG8C If you like this video, please give me your thumbs up and share it with your friends and co-workers. Like my channel? Subscribe! ➜ http://bit.ly/2cUsid8 Join the free Member Library: https://goo.gl/dtyIIC Read the accompanying post: https://www.thoughts-on-java.org/best-practices-many-one-one-many-associations-mappings Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava

Category

Show more

Comments - 9