Uploaded image for project: 'Hibernate ORM'
  1. HHH-11898

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

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.2.10, 5.1.9
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      As of HHH-7610 Closed , 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.

      @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.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                gbadner Gail Badner
                Reporter:
                gbadner Gail Badner
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: