castor
  1. castor
  2. CASTOR-1435

Refactor internal handling of identities

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.0.2
    • Component/s: JDO
    • Labels:
      None
    • Number of attachments :
      7

      Description

      For single field identities of entities Castor internaly holds the object identity itself while multi field identities are wrapped by Complex class. According to this design single and multi field identities need to be treated different in many places by:

      if (object instanceof Complex) {
      // handle multi filed identity
      } else {
      // handle single field identity
      }

      desicions. To omit this all identities should be wrapped by Complex class.

      1. Identity.java
        3 kB
        Ralf Joachim
      2. patch-C1435-20060523.txt
        121 kB
        Ralf Joachim
      3. patch-C1435-20060610.txt
        137 kB
        Ralf Joachim
      4. patch-C1435-20060612.txt
        147 kB
        Ralf Joachim
      5. patch-C1435-20060613-01.txt
        151 kB
        Ralf Joachim
      6. patch-C1435-20060615.txt
        188 kB
        Ralf Joachim
      7. patch-C1435-20060617.txt
        199 kB
        Ralf Joachim

        Activity

        Hide
        Ralf Joachim added a comment -

        Patch of work in progress. Replaced single identity objects and Complex class at all areas where identities are handled with a new Identity class. Only relation fields are missing at the moment. Will rename new Identity class to Complex after the old when have been thrown out everywhere.

        Show
        Ralf Joachim added a comment - Patch of work in progress. Replaced single identity objects and Complex class at all areas where identities are handled with a new Identity class. Only relation fields are missing at the moment. Will rename new Identity class to Complex after the old when have been thrown out everywhere.
        Hide
        Ralf Joachim added a comment -

        Added some more changes but still field Object[] does not hold Identities.

        Show
        Ralf Joachim added a comment - Added some more changes but still field Object[] does not hold Identities.
        Hide
        Ralf Joachim added a comment -

        New class Identity missing at the last patch.

        Show
        Ralf Joachim added a comment - New class Identity missing at the last patch.
        Hide
        Ralf Joachim added a comment -

        Now also fields Object[] holds Identities but 7 test of CTF are failing.

        • TC87 TestLazy1To1.testLoadBookWithLazyAuthorProperty() (test tempoary commented out)
        • TC97 TestTestPolymorphism.testLoadOwner() (test tempoary commented out)
        • TC70 (reason key in map is Identity instead of object itself)
        • TC89
        • TC96
        • TC200
        • TC201
        Show
        Ralf Joachim added a comment - Now also fields Object[] holds Identities but 7 test of CTF are failing. TC87 TestLazy1To1.testLoadBookWithLazyAuthorProperty() (test tempoary commented out) TC97 TestTestPolymorphism.testLoadOwner() (test tempoary commented out) TC70 (reason key in map is Identity instead of object itself) TC89 TC96 TC200 TC201
        Hide
        Ralf Joachim added a comment -

        Resolved problem with TC70.

        Show
        Ralf Joachim added a comment - Resolved problem with TC70.
        Hide
        Ralf Joachim added a comment -

        Havings said that TC71 seams to fail now

        Show
        Ralf Joachim added a comment - Havings said that TC71 seams to fail now
        Hide
        Ralf Joachim added a comment -

        I was able to resolve all of the problems mentioned above but one:

        • TC87 TestLazy1To1.testLoadBookWithLazyAuthorProperty() (test tempoary commented out)

        Will attach a new patch and try to look into the remaining problem tomorrow.

        Show
        Ralf Joachim added a comment - I was able to resolve all of the problems mentioned above but one: TC87 TestLazy1To1.testLoadBookWithLazyAuthorProperty() (test tempoary commented out) Will attach a new patch and try to look into the remaining problem tomorrow.
        Hide
        Ralf Joachim added a comment -

        After all I was able to resolve all problems and also cleaned up codechanges after the refactoring.
        And here you get the final patch for review.

        Show
        Ralf Joachim added a comment - After all I was able to resolve all problems and also cleaned up codechanges after the refactoring. And here you get the final patch for review.
        Hide
        Ralf Joachim added a comment -

        Final patch with comments to release-notes and changelog.

        According to a discussion with Werner on IRC I left Complex declared deprecated as is and introduce the new Identity class being able to be constructed when it gets an Complex instance passed. This allows for a smoth migration from Complex to Identity. The only influence for the user is the changed return type of Database.getIdentity(Object) as highlighted in release-notes.

        Show
        Ralf Joachim added a comment - Final patch with comments to release-notes and changelog. According to a discussion with Werner on IRC I left Complex declared deprecated as is and introduce the new Identity class being able to be constructed when it gets an Complex instance passed. This allows for a smoth migration from Complex to Identity. The only influence for the user is the changed return type of Database.getIdentity(Object) as highlighted in release-notes.

          People

          • Assignee:
            Ralf Joachim
            Reporter:
            Ralf Joachim
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: