diff --git a/node/src/main/kotlin/net/corda/node/services/vault/NodeVaultService.kt b/node/src/main/kotlin/net/corda/node/services/vault/NodeVaultService.kt index aad9f132c0..2f5fbd43a6 100644 --- a/node/src/main/kotlin/net/corda/node/services/vault/NodeVaultService.kt +++ b/node/src/main/kotlin/net/corda/node/services/vault/NodeVaultService.kt @@ -771,7 +771,7 @@ class NodeVaultService( private fun queryTotalStateCount(criteria: QueryCriteria, contractStateType: Class): Long { val (criteriaQuery, criteriaParser) = buildCriteriaQuery(criteria, contractStateType, null) - criteriaQuery.select(criteriaBuilder.countDistinct(criteriaParser.vaultStates)) + criteriaQuery.select(criteriaBuilder.count(criteriaParser.vaultStates)) val query = getSession().createQuery(criteriaQuery) return query.singleResult }