Advertisement

Ultimate Guide to Implementing Equals & HashCode with Hibernate & JPA

Ultimate Guide to Implementing Equals & HashCode with Hibernate & JPA In today’s video, I will show you how to implement the equals and hashcode mehods of your entities. You will learn how to implement these methods so that they fulfil the requirements of the Java language, the JPA specification and Hibernate. I will also show you which attributes you should never include in your equals method.

My consulting clients and people in my workshops and conference talks ask me all the time about these two methods. So, let’s answer these questions once and for all in this video.
But before we start, if this is your first time here, and you want to learn how to create your entity mappings with ease, build incredible efficient persistence layers with Hibernate and all types of other Java persistence related stuff, start now by subscribing and clicking the bell, so you don't miss anything.
OK, let’s get into today’s topic.
The implementation of the equals() and hashCode() methods for entity classes is an often discussed question.
Do you really need them? There are lots of applications that work perfectly fine using Java’s default methods provided by the Object class.
And if you need to implement them, how should you do that? Should you use all attributes or just the primary keys?

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:



Read the accompanying post:

Want to connect with me?
Blog:
Twitter:
Facebook:

#hashcode #equals #JPA #hibernate

Hibernate,JPA,How to,Tutorial,Beginners,Java,Getting Started,JPQL,Equals,HashCode,mapping,primary keys,composite primary keys,

Post a Comment

0 Comments