List of usage examples for com.amazonaws.services.dynamodbv2.model KeysAndAttributes setProjectionExpression
public void setProjectionExpression(String projectionExpression)
A string that identifies one or more attributes to retrieve from the table.
From source file:org.iternine.jeppetto.dao.dynamodb.DynamoDBQueryModelDAO.java
License:Apache License
@Override public Iterable<T> findByIds(ID... ids) throws JeppettoException { Collection<Map<String, AttributeValue>> keys = new ArrayList<Map<String, AttributeValue>>(); for (ID id : ids) { keys.add(getKeyFrom(id));/* ww w. j a va2 s. com*/ } KeysAndAttributes keysAndAttributes = new KeysAndAttributes().withKeys(keys); keysAndAttributes.setConsistentRead(consistentRead); keysAndAttributes.setProjectionExpression(projectionExpression); if (!projectionExpressionNames.isEmpty()) { keysAndAttributes.setExpressionAttributeNames(projectionExpressionNames); } BatchGetItemRequest batchGetItemRequest = new BatchGetItemRequest() .withRequestItems(Collections.singletonMap(tableName, keysAndAttributes)); return new BatchGetIterable<T>(dynamoDB, persistableEnhancer, batchGetItemRequest, tableName); }