We're updating the issue view to help you get more done. 

Empty composite values with primitive or initialized attributes can never be equivalent to null

Description

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 value, ComponentType#isEqual will always return false (because a primitive attribute cannot be null).

Also, if the empty composite has an initialized value, as in the following example, ComponentType#isEqual will always return false.

1 2 3 4 5 @Embeddable public class Value { private Integer value = -1; ... }

If the composite has a parent attribute (e.g., mapped with @Parent), that attribute is ignored by ComponentType#isEqual.

Environment

None

Status

Assignee

Gail Badner

Reporter

Gail Badner

Labels

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Affects versions

5.2.10
5.1.9

Priority

Major