Equals and hashcode how to for Hibernate and JPA in general


This morning I was manually writing a Hibernate bean and, when I got to question myself whether or not implementing equals and hashcode, I stumbled upon quite a few dilemmas: shall I create them at all? (well yeah coz you want to use them in collections and the comparison between two objects should rely upon … Continue reading Equals and hashcode how to for Hibernate and JPA in general

Mapping a many-to-many join table with extra column using JPA


Intro It is not straightforward to realise a many-to-many association with JPA when in the join table there is at least an extra column. In this small tutorial I’m going to show how to design entity objects that will handle the many-to-many relation and which annotations are needed in order to fix a redundancy that … Continue reading Mapping a many-to-many join table with extra column using JPA