[hibernate-dev] SQLServer getLimitString() refactoring

Łukasz Antoniak lukasz.antoniak at gmail.com
Mon Jun 11 14:01:20 EDT 2012


Hello Guenther,

I have discussed with Strong Liu about aliases and it seems that HQL and Criteria API queries always add an alias to selected 
column or subquery (to @Formula expressions as well). IMO we could assume that aliases are preceded with "AS" keyword.

Steve agreed to delegate binding of limit parameters values to Dialect classes. This way API will be more flexible and consistent 
(possible implementation of HHH-7370), since Dialect classes already modify SQL queries to apply pagination.

I have noticed that TOP(100)PERCENT invalidates ORDER BY clause, so SQL Server dialect would have to bind 3 limit parameters (or 1 
in case of HHH-7370). I will try to apply changes to my testing branch 
(https://github.com/lukasz-antoniak/hibernate-core/tree/SQLServerLimitString) as soon as possible.

Regards,
Lukasz


More information about the hibernate-dev mailing list