| Probably we should delegate CustomType#equals and CustomType#hashCode to the underlying UserType. But beyond that, its really not possible for Hibernate to know that one UserType is "equal to" another for the same UserType class - UserType accepts configuration that can change its behavior - we have no idea about this. But delegating these calls from CustomType to your custom UserType should address this - then your UserType has control over this. But treating your UserType impls as effectively singleton like we do for some of the internal types is simply not feasible. |