1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.socialsignin.spring.data.dynamodb.query;
17
18 import com.amazonaws.services.dynamodbv2.model.QueryRequest;
19 import org.socialsignin.spring.data.dynamodb.core.DynamoDBOperations;
20
21 public class QueryRequestCountQuery extends AbstractSingleEntityQuery<Long> {
22
23 private final DynamoDBOperations dynamoDBOperations;
24 private final QueryRequest queryRequest;
25
26 public QueryRequestCountQuery(DynamoDBOperations dynamoDBOperations, QueryRequest queryRequest) {
27 super(null, Long.class);
28 this.queryRequest = queryRequest;
29 this.dynamoDBOperations = dynamoDBOperations;
30 }
31
32 @Override
33 public Long getSingleResult() {
34
35 return Long.valueOf(dynamoDBOperations.count(clazz, queryRequest));
36 }
37
38 }