Uploaded image for project: 'JTalks Common'
  1. JTalks Common
  2. JTALKSCOMMON-85

Equals of Entity should use instanceof not the class comparison

VotersWatchers
    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: common 0.11
    • Fix Version/s: common 0.11
    • Labels:
      None

      Description

      Right now we have:

              if (getClass() != obj.getClass()) {
                  return false;
              }

      This is not a correct way to work with entities managed by Hibernate, it should use instanceof, otherwise Entity and Proxy of Entity will be different even if it's a proxy for the very same entity.

        Attachments

          Structure

            Activity

              People

              • Assignee:
                ancient_mariner Alex Lysak
                Reporter:
                ctapobep Stanislav Bashkyrtsev
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0.25h
                  0.25h
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.25h
                  0.25h

                    Structure Helper Panel