5

I am using ebean as ORM and SQL Server in the back. I got an exception of SQL syntax error when I try to setMaxRows. The generated sql has something like

select .... from ... where ... LIMIT 5

while this might work for mysql, SQLServer doesn't like it.

After some search I found that the default SqlLimiter used by EBean,LimitOffsetSqlLimiter, creates sql like this. I am wondering if I can configure ebean so that it can use other implementation, such as RowNumberSqlLimiter, or even my own implementation as mentioned here?

Wei Ma
  • 3,125
  • 6
  • 44
  • 72

2 Answers2

0

This is not currently possible. If you look at the code here, you can see that ServerConfig only gets loadable classes. But since it is so easy to disable ebean, just disable the plugin, roll your own and add it to play.plugins. Then you can transform ServerConfig in any way suitable.

Mirko Adari
  • 5,083
  • 1
  • 15
  • 23
0

This is an old question now, note that Ebean has 3 SQLServer platforms for 2017, 2016 and 2005.

Rob Bygrave
  • 3,861
  • 28
  • 28