XMLWordPrintable

    Details

    • Release Notes Text:
      Hide
      The problem was caused by customers' use of custom equals/hashCode overrides. In some situations the equals and hashCodes end up changing while it is "in" internal Hibernate Maps. Hibernate was putting these entries into the map before they are fully initialized. A small change was made to "queue up" the additions until after the ResultSet is done being processed.
      Show
      The problem was caused by customers' use of custom equals/hashCode overrides. In some situations the equals and hashCodes end up changing while it is "in" internal Hibernate Maps. Hibernate was putting these entries into the map before they are fully initialized. A small change was made to "queue up" the additions until after the ResultSet is done being processed.
    • Release Notes Docs Status:
      Documented as Resolved Issue
    • Docs QE Status:
      NEW
    • Target Release:

      Description

      https://hibernate.onjira.com/browse/HHH-7557

      I have a Map where both the key and value are entities.
      When I try to modify the map (for example, by adding an element to it), all but one of my map entries get deleted.
      The two things necessary to reproduce it seem to be:
      (1) The key entity has a many-to-one foreign key relationship to the value entity
      (2) Both key and value entities implement equals() and hashCode(), using the unique key fields for the class
      If I remove either of the above, the code works fine.
      It seems to be adding my entities to the map before initializing them, so equals() always returns true (all of the unique key fields are null).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brmeyer Brett Meyer (Inactive)
              Reporter:
              brmeyer Brett Meyer (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: