Details
-
Type:
Sub-task
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.3.1
-
Component/s: JDO queries
-
Labels:None
-
Number of attachments :
Description
The idea behind this refactoring task is to separate the Construction part of SQL statement from the execution part.. We are introducing the new class hierarchy which will handle all the query construction process. The query construction is split in to many different classes and each class is responsible to the task it is assigned for. The base class should be 'Delete' class because SQLStatementRemove invovles delete query. Then we will have Table class, Condition class and so on. In the end we will just call the toString() method on the base class to retrieve the constructed SQL
The attached patch is for review purposes. Some of the classes overlaps the classes included in the Delete class hierarchy implementation. The delete class hierarchy task is
CASTOR-2743. But after the design has been finalized then this overlapping will be removed in the final patch submission.Just to describe the way of using this class hierarchy, I have added the main method in the Update base class which adds generated the sql using this new class hierarchy. In order to check this, you have to run the Update class as simple java application. The code snippet for using this class hierarchy is shown below
This way, the whole sql construction code will be moved out of SQLStatementStore. The new class hierarchy will provide that abstraction. This is easy to use and looks more modular and logical.
Best Regards, Hassan