GetAttributesRequest req = SdbMappingUtils.createGetRequestFromKey(domain, clazz, key);
// sets consistent read to true when reading one single object
req.setConsistentRead(isReadConsistent());
GetAttributesResult res = sdb.getAttributes(req);
if(res.getAttributes().size() == 0){
throw new SienaException(req.getItemName()+" not found in domain "+req.getDomainName());
}
T obj = Util.createObjectInstance(clazz);
SdbMappingUtils.fillModel(req.getItemName(), res, clazz, obj);
// join management
if(!ClassInfo.getClassInfo(clazz).joinFields.isEmpty()){
mapJoins(obj);
}
return obj;
}catch(AmazonClientException ex){
throw new SienaException(ex);
}
}