|
The current design/implementation of LimitHandler requires creation of new instances for every query which needs limiting of the query result set. Even for queries without limiting a new instance of NoopLimitHandler is created. I propose to change the design/implementation of LimitHandler as follows:
-
Instances of LimitHandler does not hold anymore references to SQL query string and RowSelection instance.
-
The method LimitHandler#getProcessedSql() will be changed to #processSql(String sql, RowSelection selection).
-
All other methods of LimitHandler will get a new parameter of type RowSelection.
-
The method Dialect#buildLimitHandler(String sql, RowSelection selection) will be changed to #getLimitHandler().
-
The method Dialect#getLimitHandler() will return either a singleton instance of a LimitHandler or an instance associated with the current Dialect instance.
|