public List<LeagueRecord> byType(GameType gameType) { PaginatedQueryList<LeagueRecord> results = tableMapper.query(new DynamoDBQueryExpression<LeagueRecord>() .withScanIndexForward(true) .withLimit(100) .withConsistentRead(false) .withHashKeyValues(LeagueRecord.builder().gameType(gameType).build()) .withIndexName("LeagueByType")); results.loadAllResults(); return results; }
public List<PlayerRecord> lookupByLeague(String leagueId) { PaginatedQueryList<PlayerRecord> results = tableMapper.query(new DynamoDBQueryExpression<PlayerRecord>() .withScanIndexForward(true) .withLimit(100) .withConsistentRead(false) .withHashKeyValues(PlayerRecord.builder().leagueId(leagueId).build()) .withIndexName("PlayerByLeague")); results.loadAllResults(); return results; }
public List<PlayerRecord> lookupByUser(String userId) { PaginatedQueryList<PlayerRecord> results = tableMapper.query(new DynamoDBQueryExpression<PlayerRecord>() .withScanIndexForward(true) .withLimit(100) .withConsistentRead(false) .withHashKeyValues(PlayerRecord.builder().userId(userId).build()) .withIndexName("LeagueByType")); results.loadAllResults(); return results; }
public UserRecord byEmail(String email) { UserRecord lookup = null; PaginatedQueryList<UserRecord> results = tableMapper.query(new DynamoDBQueryExpression<UserRecord>() .withLimit(1) .withConsistentRead(false) .withHashKeyValues(UserRecord.builder().email(email).build()) .withIndexName("UserByEmail")); if (results.size() > 0) { lookup = results.get(0); } return lookup; }
public Collection<T> findByPartition(String bucketName) { PaginatedQueryList<T> result = this.tableMapper.query( new DynamoDBQueryExpression<T>().withRangeKeyCondition(tableMapper.rangeKey().name(), new Condition() .withComparisonOperator(ComparisonOperator.EQ) .withAttributeValueList(new AttributeValue(bucketName)))); return result; }
@Override public <T> PaginatedQueryList<T> query(Class<T> domainClass, DynamoDBQueryExpression<T> queryExpression) { PaginatedQueryList<T> results = dynamoDBMapper.query(domainClass, queryExpression); maybeEmitEvent(new AfterQueryEvent<T>(results)); return results; }
@Override public <T> PaginatedQueryList<T> query(Class<T> clazz, QueryRequest queryRequest) { QueryResult queryResult = amazonDynamoDB.query(queryRequest); return new PaginatedQueryList<T>(dynamoDBMapper, clazz, amazonDynamoDB, queryRequest, queryResult, dynamoDBMapperConfig.getPaginationLoadingStrategy(), dynamoDBMapperConfig); }
public AfterQueryEvent(PaginatedQueryList<T> source) { super(source); }
/*** * Query DynamoDb using the given query expression * @param clazz - The Java class specifying the return type * @param queryExpression - The dynamoDb query expression * @return paginatedList */ public <T> PaginatedQueryList<T> query(final Class<T> clazz, DynamoDBQueryExpression<T> queryExpression){ final PaginatedQueryList<T> itemList = mapper.query(clazz, queryExpression); return itemList; }
public <T> PaginatedQueryList<T> query(Class<T> clazz, QueryRequest queryRequest);
public <T> PaginatedQueryList<T> query(Class<T> domainClass,DynamoDBQueryExpression<T> queryExpression);