当前使用版本(3.3.2【3.4.2也有这个问题】)
当数据库 DbType 为 DbType.SQL_SERVER 是,分页不设置 排序字段,会报如下错误(拼装的SQL语法有误,缺少 order by):
org.springframework.jdbc.UncategorizedSQLException:
### Error querying database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: “@P0”附近有语法错误。
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT id,uuid,permission_id AS permissionId,business_unit_id AS businessUnitId FROM permission_business_unit OFFSET ? ROWS FETCH NEXT ? ROWS ONLY
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: “@P0”附近有语法错误。
; uncategorized SQLException; SQL state [S0001]; error code [102]; “@P0”附近有语法错误。; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: “@P0”附近有语法错误。
Comment From: miemieYaho
那你就给orderby