List of usage examples for com.amazonaws.services.dynamodbv2.model GetItemRequest setExpressionAttributeNames
public void setExpressionAttributeNames(java.util.Map<String, String> expressionAttributeNames)
One or more substitution tokens for attribute names in an expression.
From source file:org.iternine.jeppetto.dao.dynamodb.DynamoDBQueryModelDAO.java
License:Apache License
@Override public T findById(ID id) throws NoSuchItemException, JeppettoException { GetItemResult result;//from w w w. j a v a 2 s . co m try { GetItemRequest getItemRequest = new GetItemRequest(tableName, getKeyFrom(id), consistentRead); getItemRequest.setProjectionExpression(projectionExpression); if (!projectionExpressionNames.isEmpty()) { getItemRequest.setExpressionAttributeNames(projectionExpressionNames); } result = dynamoDB.getItem(getItemRequest); } catch (AmazonClientException e) { throw new JeppettoException(e); } if (result.getItem() == null) { throw new NoSuchItemException(entityClass.getSimpleName(), id.toString()); } T t = ConversionUtil.getObjectFromItem(result.getItem(), entityClass); ((DynamoDBPersistable) t).__markPersisted(dynamoDB.toString()); return t; }