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.