Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Must
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Milestone 3
    • Labels:
    • Complexity:
      Undetermined
    • Sprint:
      Sync 2.0 Sprint 11, Sync 2.0 Sprint 12

      Description

      We need to override default hashCode function. It will be used to calculate hashcode of an object. If generic function is impossible to implement, we should write hashCode function for all object classes or try a different approach.

      Example of use:

      You pull Patient category entity form Parent to Child. You calculate hashcode of pulled object and compare it with existing in Child instance hashcode saved on last pull of this object from Parent.

      Note:

      We should exclude at least date_voideddate_changed from affecting hashcode. Hashcode should only be different for the same object if its fields were modified. Note that if you change i.e. name of this Patient to the same name, its name will be the same but date_changed will be updated. That is why we should exclude at least those two fields.

       

      ACC:

      • hashCode function calculates hashcode for every object
      • calculated hashcodes before and after updating i.e. name of a Patient to the same name should not differ
      • calculating the same hashcode for two different objects should be very close to impossible

      Update 11/13/18:

      • We should also exclude entity id form the hashcode because they will be different in different openmrs instances for the same object.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                wbulawa Wojciech Buława
                Reporter:
                rstencel Rafał Stencel
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 5 hours Original Estimate - 5 hours
                  5h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 4 hours, 30 minutes
                  1d 4h 30m