Daan de Wit, would you be able to test my CTE support for the SQLServer2005LimitHandler if I supply a PR with the fix? If you're using SQLServer 2008 or earlier, you need to: 1. Add the SQLServer2005LimitHandler from my PR to your application in a custom package, preferably using a custom name. 2. Create a dialect that extends the one you presently use if you aren't already using a custom dialect. 3. In the custom dialect, you want to override the #getDefaultLimitHandler() method and have it return a new instance of the handler you added in step 1. 4. If you aren't already using a custom dialect, you'll want to specify the dialect using org.hibernate.dialect in your hibernate configuration. If you're using SQLServer 2012 or later, you need to: 1. Add the SQLServer2005LimitHandler from my PR to your application in a custom package, preferably using a custom name. 2. Copy the ORM SQLServer2012LimitHandler into your code base and make it extend the limit handler in step 1. 2. Create a dialect that extends the one you presently use if you aren't already using a custom dialect. 3. In the custom dialect, you want to override the #getDefaultLimitHandler() method and have it return a new instance of the handler you added in step 2. 4. If you aren't already using a custom dialect, you'll want to specify the dialect using org.hibernate.dialect in your hibernate configuration. Given that SQLServer2012LimitHandler falls back to SQLServer2005LimitHandler under specific conditions, that is why you need to perform step 2 for the newer version. |