SpringBoot和JPA使用SQLServer2008數據庫搭建後臺的時候排序報錯

一般的排序代碼是這樣的

Sort sort = new Sort(Direction.ASC, "seq");

PageRequest pageRequest = PageRequest.of(Integer.valueOf(pageNumber) - 1, Integer.valueOf(pageSize), sort);

page = questionTypeService.findAll(pageRequest);

但是會報以下的錯誤

Hibernate: select questionty0_.questionTypeId as question1_3_, questionty0_.remark as remark2_3_, questionty0_.seq as seq3_3_, questionty0_.type as type4_3_, questionty0_.version as version5_3_ from question_type questionty0_ order by questionty0_.seq asc offset 0 rows fetch next ? rows only
2020-03-10 16:20:36.402  WARN 12036 --- [io-8080-exec-10] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 102, SQLState: S0001
2020-03-10 16:20:36.403 ERROR 12036 --- [io-8080-exec-10] o.h.engine.jdbc.spi.SqlExceptionHelper   : Incorrect syntax near 'offset'.

看到報錯語句中有offset 0 rows fetch next ? rows only這幾個單

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章