There are 2 different discussions here:
1) How to implement `#equals` to account for HibernateProxy
2) How to implement `#equals` in a MappedSuperclass
These things are at odds here.
With regards to (1), as discussed above, you have to allow subclasses in
the equality comparison *if* you want to
Please see below...
On Tue, Aug 27, 2019 at 8:00 PM Jan-Willem Gmelig Meyling <
jan-wil...@youngmediaexperts.nl> wrote:
> I tend to use this.getClass().isInstance(o) and this.getClass().cast(o)
> which works even in a mapped super class on most occasions. (Assuming that
> the proxy delegates equa
I tend to use this.getClass().isInstance(o) and this.getClass().cast(o) which
works even in a mapped super class on most occasions. (Assuming that the proxy
delegates equals to a concrete target).
Jan-Willem
> Op 27 aug. 2019 om 22:29 heeft Steve Ebersole het
> volgende geschreven:
>
> Gen
Generally speaking an `#equals` method would not allow subclasses to
match. For entity mappings specifically I this it is generally considered
kosher to allow subclass matching in `#equals`. Interestingly, when
generating `#equals` overrides through IntelliJ it even asks specifically
whether subc