castor
  1. castor
  2. CASTOR-2396

Refactor OQL query engine during GSoC 2008

    Details

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

      Description

      During GSoC 2008 Udai Gupta will work at refactoring OQL query engine. The original project idea is:

      The object query language that Castor supports today is quite limited and has to be improved in some ways. On the other hand this task is very difficult as the codebase of the query engine is a bit crapy and split over many classes in different packages. To overcome this situation we plan to approach the problem from 2 sides. One is to refactor the generation of SQL queries at the current codebase. We think that this should make it much easier to replace the OQL to SQL transformation and plugin a new object query language later on. The implementation of the new OQL from scratch is the other side to approach a solution.

      For the new object query language we like to conform to EJB QL specified at persistence part of EJB 3.0 specification. The specification can be downlaoded from http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html.

      As it will be quite difficult to implement the whole language at once, the first task will be to define a roadmap for the implementation. The roadmap should contain a list of features as well as the BNF for each step of the implementation. Based on this roadmap we intend to define your targets for the project together with you.

      The base idea for the implementation is the create a class for every element of the language. This will enable us to represent a query with a hierarchy of objects of these classes. By calling toString() at the root of the hierarchy a string representation of the query can be generated. For the opposit direction, to transfor a query string into a class hierarchy, you generate a parser using a parser generator like JavaCC or antlr. Apart of the featurs you have to implement junit tests to verify that your implementation works as expected.

      To limit the scope of this project, we do not expect you to implement the full specification nor to integrate the new object query language into Castor. This will be done later on at a follow up project. We only expect you to implement the query string to object transformation and vice versa for a subset of the language.

      1. query-engine.txt
        794 kB
        Ralf Joachim
      2. Udai_Gupta.tar.gz
        4.33 MB
        Udai Gupta

        Issue Links

          Activity

          Hide
          Ralf Joachim added a comment -

          Udai created a series of howto documents about setting up Castor with eclipse and about execution of Castor's JDO test suites based on the introduction from me.

          Show
          Ralf Joachim added a comment - Udai created a series of howto documents about setting up Castor with eclipse and about execution of Castor's JDO test suites based on the introduction from me.
          Hide
          Ralf Joachim added a comment -

          To get familiar with external interfaces of Castor and also the codeing conventions I suggested Udai to meigrate soem test cases from old to new test suite.

          Show
          Ralf Joachim added a comment - To get familiar with external interfaces of Castor and also the codeing conventions I suggested Udai to meigrate soem test cases from old to new test suite.
          Hide
          Ralf Joachim added a comment -

          Udai and I agreed on the following schedule for the implementation phase.

          Coding Phase I (Starts at May 26.)
          ----------------------------------------------------------------------

          Week I and II (26 May - 7 June)
          """""""""""""""""""""""""""""""
          Extract current Castor OQL BNF from parser and lexer source code of org.exolab.castor.jdo.oql package. Improve current parser tests to verify any possible syntax against current parser to verify that BNF is correct.

          Divide EJB QL BNF of EJB 3.0 specification given at the end of chapter 4.12 into smaller parts. First part starts with very simple select statements. The other parts add more and more features until full EJB QL support.

          Analysis find the parser generator that best suits the needs to cerate parser for Castor OQL and EJB QL.

          Define features and requirements for "Query Objects" and Castor interface to use them.

          Week III (8 June - 14 June)
          """""""""""""""""""""""""""
          Create UML diagrams for "Query Objects"

          Week IV (15 June - 21 June)
          """""""""""""""""""""""""""
          Start implementation of "Query Objects" for simple "SELECT" statement including junit test cases. Create parser that translates simple "SELECT" queries into "Query Objects". Integrate "Query Objects" with Castor and verify that things are working as expected against various database engines.

          Week V (22 June - 28 June)
          """"""""""""""""""""""""""
          Extend "Query Objects" and parser to support "ORDER BY" clauses.

          Week VI (29 June - 5 July)
          """"""""""""""""""""""""""
          Reserved for refactorings and code improvements.

          ----------------------------------------------------------------------
          Coding Phase I (Ends July 6.)
          ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
          MID TERM EVALUATION (7 July - 14 July)
          ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
          Coding Phase II (Starts July 15.)
          ----------------------------------------------------------------------

          Week VII and VIII (15 July - 26 July)
          """""""""""""""""""""""""""""""""""""
          Extend "Query Objects" and parser to support "WHERE" clauses.

          Week IX and X (27 July - 2 Aug)
          """""""""""""""""""""""""""""""
          Extend "Query Objects" and parser to support any missing clauses of Castor OQL.

          ----------------------------------------------------------------------
          Coding Phase II (Ends August 10.)
          ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
          Suggested Pencils Down Week (11 August - 17 August)
          ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
          Final Evaluations Phase (August 18 - September 1,)
          ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
          Submit Code Samples to Google (September 3 - September 12)
          ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

          Show
          Ralf Joachim added a comment - Udai and I agreed on the following schedule for the implementation phase. Coding Phase I (Starts at May 26.) ---------------------------------------------------------------------- Week I and II (26 May - 7 June) """"""""""""""""""""""""""""""" Extract current Castor OQL BNF from parser and lexer source code of org.exolab.castor.jdo.oql package. Improve current parser tests to verify any possible syntax against current parser to verify that BNF is correct. Divide EJB QL BNF of EJB 3.0 specification given at the end of chapter 4.12 into smaller parts. First part starts with very simple select statements. The other parts add more and more features until full EJB QL support. Analysis find the parser generator that best suits the needs to cerate parser for Castor OQL and EJB QL. Define features and requirements for "Query Objects" and Castor interface to use them. Week III (8 June - 14 June) """"""""""""""""""""""""""" Create UML diagrams for "Query Objects" Week IV (15 June - 21 June) """"""""""""""""""""""""""" Start implementation of "Query Objects" for simple "SELECT" statement including junit test cases. Create parser that translates simple "SELECT" queries into "Query Objects". Integrate "Query Objects" with Castor and verify that things are working as expected against various database engines. Week V (22 June - 28 June) """""""""""""""""""""""""" Extend "Query Objects" and parser to support "ORDER BY" clauses. Week VI (29 June - 5 July) """""""""""""""""""""""""" Reserved for refactorings and code improvements. ---------------------------------------------------------------------- Coding Phase I (Ends July 6.) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ MID TERM EVALUATION (7 July - 14 July) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Coding Phase II (Starts July 15.) ---------------------------------------------------------------------- Week VII and VIII (15 July - 26 July) """"""""""""""""""""""""""""""""""""" Extend "Query Objects" and parser to support "WHERE" clauses. Week IX and X (27 July - 2 Aug) """"""""""""""""""""""""""""""" Extend "Query Objects" and parser to support any missing clauses of Castor OQL. ---------------------------------------------------------------------- Coding Phase II (Ends August 10.) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Suggested Pencils Down Week (11 August - 17 August) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Final Evaluations Phase (August 18 - September 1,) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Submit Code Samples to Google (September 3 - September 12) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
          Hide
          Udai Gupta added a comment -

          I have created the first four sub - task I will be working on in the same order.

          Show
          Udai Gupta added a comment - I have created the first four sub - task I will be working on in the same order.
          Hide
          Ralf Joachim added a comment -

          Issue castor-324 have previously been used to discuss about refactoring OQL query engine. It contains various useful information so I decided to link it from here.

          Show
          Ralf Joachim added a comment - Issue castor-324 have previously been used to discuss about refactoring OQL query engine. It contains various useful information so I decided to link it from here.
          Hide
          Ralf Joachim added a comment -

          Created a branch starting with 1.2 for this issue and its subtasks called "query_engine"

          Show
          Ralf Joachim added a comment - Created a branch starting with 1.2 for this issue and its subtasks called "query_engine"
          Hide
          Ralf Joachim added a comment -

          Patch with all changes of GSoC 2008 project

          Show
          Ralf Joachim added a comment - Patch with all changes of GSoC 2008 project
          Hide
          Udai Gupta added a comment -

          File to be submitted at GSoC 2008 code base.

          Show
          Udai Gupta added a comment - File to be submitted at GSoC 2008 code base.
          Hide
          Ralf Joachim added a comment -

          Query objects created during GSoC 2008 have been added to trunk with CASTOR-2796. The parser still waits on its integration. In addition the translation from query objects to SQL is still missing.

          Show
          Ralf Joachim added a comment - Query objects created during GSoC 2008 have been added to trunk with CASTOR-2796 . The parser still waits on its integration. In addition the translation from query objects to SQL is still missing.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: