mirror of
https://github.com/corda/corda.git
synced 2025-06-16 22:28:15 +00:00
MSSQL support (#3382)
* MSSQL support * changes per reviewer's comments; doc * clean up * CONTRIBUTORS.md * minor change in comment * another minor change in comment * minor formatting * Comments formatting per recommend style; contributors in alphabet order * more comment formatting per coding style * Change MSSQL to SQLServer in codes and comments * Change MSSQL to SQLServer in doc * Use generateSequence to build repeats of ?,?,...?
This commit is contained in:
@ -471,7 +471,11 @@ class NodeVaultService(
|
||||
if (paging.pageSize < 1) throw VaultQueryException("Page specification: invalid page size ${paging.pageSize} [must be a value between 1 and $MAX_PAGE_SIZE]")
|
||||
}
|
||||
|
||||
query.firstResult = (paging.pageNumber - 1) * paging.pageSize
|
||||
// For both SQLServer and PostgresSQL, firstResult must be >= 0. So we set a floor at 0.
|
||||
// TODO: This is a catch-all solution. But why is the default pageNumber set to be -1 in the first place?
|
||||
// Even if we set the default pageNumber to be 1 instead, that may not cover the non-default cases.
|
||||
// So the floor may be necessary anyway.
|
||||
query.firstResult = maxOf(0, (paging.pageNumber - 1) * paging.pageSize)
|
||||
query.maxResults = paging.pageSize + 1 // detection too many results
|
||||
|
||||
// execution
|
||||
|
Reference in New Issue
Block a user