1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.socialsignin.spring.data.dynamodb.core;
17
18 import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.FailedBatch;
19 import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperTableModel;
20 import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression;
21 import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBScanExpression;
22 import com.amazonaws.services.dynamodbv2.datamodeling.KeyPair;
23 import com.amazonaws.services.dynamodbv2.datamodeling.PaginatedQueryList;
24 import com.amazonaws.services.dynamodbv2.datamodeling.PaginatedScanList;
25 import com.amazonaws.services.dynamodbv2.model.QueryRequest;
26
27 import java.util.List;
28 import java.util.Map;
29
30
31
32
33 public interface DynamoDBOperations {
34
35 <T> int count(Class<T> domainClass, DynamoDBQueryExpression<T> queryExpression);
36 <T> int count(Class<T> domainClass, DynamoDBScanExpression scanExpression);
37 <T> int count(Class<T> clazz, QueryRequest mutableQueryRequest);
38
39 <T> PaginatedQueryList<T> query(Class<T> clazz, QueryRequest queryRequest);
40 <T> PaginatedQueryList<T> query(Class<T> domainClass, DynamoDBQueryExpression<T> queryExpression);
41 <T> PaginatedScanList<T> scan(Class<T> domainClass, DynamoDBScanExpression scanExpression);
42
43 <T> T load(Class<T> domainClass, Object hashKey, Object rangeKey);
44 <T> T load(Class<T> domainClass, Object hashKey);
45 <T> List<T> batchLoad(Map<Class<?>, List<KeyPair>> itemsToGet);
46
47 <T> T save(T entity);
48 List<FailedBatch> batchSave(Iterable<?> entities);
49
50 <T> T delete(T entity);
51 List<FailedBatch> batchDelete(Iterable<?> entities);
52
53 <T> String getOverriddenTableName(Class<T> domainClass, String tableName);
54
55
56
57
58
59
60
61
62
63
64
65 <T> DynamoDBMapperTableModel<T> getTableModel(Class<T> domainClass);
66 }