public <T> T getByKey(Class<T> clazz, Object key) {
String domain = SdbMappingUtils.getDomainName(clazz, prefix);
try {
checkDomain(domain);
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);
}