castor
  1. castor
  2. CASTOR-2477

Let KeyGenerator taken over role of SQLSatementCreate

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.3.1
    • Component/s: JDO queries
    • Labels:
      None
    • Number of attachments :
      2

      Description

      Subjetc says it all.

      1. sequence-key-generator.pdf
        25 kB
        Ralf Joachim
      2. sequence-key-generator.pdf
        23 kB
        Ralf Joachim

        Issue Links

          Activity

          Hide
          Ralf Joachim added a comment -

          First part of refactoring.

          Show
          Ralf Joachim added a comment - First part of refactoring.
          Hide
          Ralf Joachim added a comment -

          Commented, attached file and closed wrong issue.

          Show
          Ralf Joachim added a comment - Commented, attached file and closed wrong issue.
          Hide
          Ralf Joachim added a comment -

          Fixed bug at HighLowKeyGenerator throwing exception if table for high low values is empty. I think this failure has been introduced at first refactoring step of this issue.

          Show
          Ralf Joachim added a comment - Fixed bug at HighLowKeyGenerator throwing exception if table for high low values is empty. I think this failure has been introduced at first refactoring step of this issue.
          Hide
          Ralf Joachim added a comment -

          Created subtasks for the work done already and moved attachements to these new subtasks.

          Show
          Ralf Joachim added a comment - Created subtasks for the work done already and moved attachements to these new subtasks.
          Hide
          Ralf Joachim added a comment -

          Let's see how code looks like after refactoring steps 4 to 7 before deciding about the next steps. ATM I think about creating abstract base classes for all key generators with the same style (before, during and after). Doing so would allow us to move code of SQLStatementCreate into this abstract key generators.

          Show
          Ralf Joachim added a comment - Let's see how code looks like after refactoring steps 4 to 7 before deciding about the next steps. ATM I think about creating abstract base classes for all key generators with the same style (before, during and after). Doing so would allow us to move code of SQLStatementCreate into this abstract key generators.
          Hide
          Ralf Joachim added a comment -

          Hi Ahmad, I have done a extensive analysis about sequence key generators. A PDF with the results is attached to this issue.

          First page shows which database engines Castor currently supports. The columns are:

          column description
          1. Name of database engine.
          2. Does checkSupportedFactory(PersistenceFactory) throw an exception.
          3. - 6. Does logic in constructor throw an exception and if not which style will be used dependend on database engine, returning and trigger.
          7. - 10. Does getValue() method throw an exception or does it return a value.
          11. - 13. Does old/new test suite cover this use case or have it been tested in the past
          14. For the use case not covered do I have used it at any time.

          On second page I have provided the possibilities that I have found for the different database engines to use sequences including the SQL statements to execute.

          Based upon this results I will now review logic of Castor.

          Regards
          Ralf

          Show
          Ralf Joachim added a comment - Hi Ahmad, I have done a extensive analysis about sequence key generators. A PDF with the results is attached to this issue. First page shows which database engines Castor currently supports. The columns are: column description 1. Name of database engine. 2. Does checkSupportedFactory(PersistenceFactory) throw an exception. 3. - 6. Does logic in constructor throw an exception and if not which style will be used dependend on database engine, returning and trigger. 7. - 10. Does getValue() method throw an exception or does it return a value. 11. - 13. Does old/new test suite cover this use case or have it been tested in the past 14. For the use case not covered do I have used it at any time. On second page I have provided the possibilities that I have found for the different database engines to use sequences including the SQL statements to execute. Based upon this results I will now review logic of Castor. Regards Ralf
          Hide
          Ralf Joachim added a comment -

          Improved version of the analysis with comments and conclusions. While change patch of CASTOR-2721 according to this and create new subtasks for further changes.

          Show
          Ralf Joachim added a comment - Improved version of the analysis with comments and conclusions. While change patch of CASTOR-2721 according to this and create new subtasks for further changes.
          Hide
          Ralf Joachim added a comment -

          Castor-977 demonstrates the original idea of a class hierarchy for SQL generation. Parts of this idea have been implemented with this issue.

          Show
          Ralf Joachim added a comment - Castor-977 demonstrates the original idea of a class hierarchy for SQL generation. Parts of this idea have been implemented with this issue.
          Hide
          Ralf Joachim added a comment -

          Major responsibilities of SQLStatementCreate have been moved to KeyGenerators. If more things to refactor in that area apear we will create a new issue for them.

          Show
          Ralf Joachim added a comment - Major responsibilities of SQLStatementCreate have been moved to KeyGenerators. If more things to refactor in that area apear we will create a new issue for them.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: