This patch involved massive rafactoring. I would try to summarize the main rafactoring things here.
There are numerous ways in which we can refactor this class. The code is bit complex and big. I followed the following design.
The previous executeStatement has been restructured and modular based on the functionality implemented in that. The new method that are included in this patch are:
bindData
bindIdentity
bindNewEntity
bindOldEntity
executeUpdate
executeQuery
processData
prepareStatement
closeStatement
executeStatement
As you can see, each function name is self explainatory about the functionality that is contained with in them. The identity size check has been shifted to bindIdentity method for the time being but in the next subtast this will be removed from this class. Similarly the code for extended classes is still there and this will be removed in the next subtasks.
Comments ??
As far as null values are concerned. This is an issue of compatibility with different db engines. I can imagine two solutions to that
1) We should follow one base db engine dialect and construct our queries according to that. And then at the very last step of query construction we check on which db this query is going to execute. According to the type of db engine, we should mold our query.
2) The second approach which can be possible is to have separate classes from different database engines.
I think it should be better to touch these things while doing new implementation according to new Class Heirarchy concept.
Regards, Ahmad
Also separate functionality to bind idenity, new values and old values to the prepared statement in separate methods.
For database enigines that do not support binding of null values in where conditions the update statement is modified at the moment. Can you please outline how we handle these cases prior of starting with this subtask.