As of HHH-7610, Hibernate should regard empty composite values and {{null}} as equivalent.
Currently, when a composite value is compared to {{null}} by either {{ComponentType#isEqual}} implementation, each value in the empty composite it compared to {{null}}.
If the empty composite has a primitive attribute , {{ComponentType#isEqual}} will always return {{false}} (because a primitive attribute cannot be null).
Also, if the empty composite has an initialized value, {{ComponentType#isEqual}} will always return {{false}}. For example,
{code:java} @Embeddable public class Value { public enum Status { NEW, ... } private Status status = Status.NEW;
} {code}
If the composite has a parent attribute { ( e.g., mapped with {{@Parent}} ) , that attribute is ignored by {{ComponentType#isEqual}}.
|
|