Tim Holloway wrote:Also, since this is a JPA Entity class, you need a no-argument constructor
Yes, but that's there already - the default constructor.
and overrides for the hashCode() and equals() methods.
Those aren't necessary, and I hardly ever write them. JPA doesn't need it for equality in many-to-many or one-to-many collections, it uses the id for that. That means there is need for an @Id column. I assumed it was omitted for brevity.
hashCode and
equals are only needed for @Embeddable classes that are used as compound key. For the rest JPA really doesn't care.