Package siena

Examples of siena.SienaException


        Class<?> clazz = Class.forName(this.type);
       
        QueryOption opt = (QueryOption)JsonSerializer.deserializeMap(clazz, this.value);
        return opt;
      }catch(Exception ex) {
        throw new SienaException("Unable to restore QueryOption", ex);
      }
    }
View Full Code Here


          mapJoins(obj);
        }
      }
    }
    catch (Exception e) {
      throw new SienaException(e);
    }
  }
View Full Code Here

    }
    catch(EntityNotFoundException e){
      return null;
    }
    catch (Exception e) {
      throw new SienaException(e);
    }
  }
View Full Code Here

      q.setAncestor(ancestorKey);
     
      return ds.prepare(GaeQueryUtils.addFiltersOrders(query, q, ancestorKey));
    }
    else {
      throw new SienaException("Only one aggregation per query allowed");
    }
   
  }
View Full Code Here

          GaeMappingUtils.getKindWithAncestorField(info,
              ClassInfo.getClassInfo(aggreg.aggregator.getClass()), aggreg.field));
      q.setAncestor(GaeMappingUtils.getKey(aggreg.aggregator));
    }
    else {
      throw new SienaException("Only one aggregation per query allowed");
    }
   
    return ds.prepare(GaeQueryUtils.addFiltersOrders(query, q).setKeysOnly());
  }
View Full Code Here

        for(Field field: fieldMap.keySet()){
          Map<Key, Entity> entities = ds.get(fieldMap.get(field));
          entityMap.put(field, entities);
        }
      }catch(Exception ex){
        throw new SienaException(ex);
      }
      // associates linked models to their models
      // linkedModels is just a map to contain entities already mapped
      Map<Key, Object> linkedModels = new HashMap<Key, Object>();
      Object linkedObj;
      Entity entity;
     
      for(Field field: fieldMap.keySet()){
        Object objVal = field.get(model);
        Key key = GaeMappingUtils.getKey(objVal);
        linkedObj = linkedModels.get(key);
        if(linkedObj==null){
          entity = entityMap.get(field).get(key);
          linkedObj = objVal;
          GaeMappingUtils.fillModel(linkedObj, entity);
          linkedModels.put(key, linkedObj);
        }
     
        field.set(model, linkedObj);       
      }

      return model;
    } catch(IllegalAccessException ex){
      throw new SienaException(ex);
    }   
  }
View Full Code Here

  public void init(Properties p) {
    String awsAccessKeyId = p.getProperty("awsAccessKeyId");
    String awsSecretAccessKey = p.getProperty("awsSecretAccessKey");
    if(awsAccessKeyId == null || awsSecretAccessKey == null)
      throw new SienaException("Both awsAccessKeyId and awsSecretAccessKey properties must be set");
    prefix = p.getProperty("prefix");
    if(prefix == null) prefix = "";
    sdb = new AmazonSimpleDBClient(new BasicAWSCredentials(awsAccessKeyId, awsSecretAccessKey));
  }
View Full Code Here

   
    try {
      checkDomain(domain);
      sdb.putAttributes(SdbMappingUtils.createPutRequest(domain, clazz, info, obj));
    }catch(AmazonClientException ex){
      throw new SienaException(ex);
    }
  }
View Full Code Here

        }
       
      }
    }catch(AmazonClientException ex){
      throw new SienaException(ex);
    }
    return nb;
  }
View Full Code Here

      GetAttributesRequest req = SdbMappingUtils.createGetRequest(domain, clazz, obj);
      // 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());
      }
       
      SdbMappingUtils.fillModel(req.getItemName(), res, clazz, obj);
     
      // join management
      if(!info.joinFields.isEmpty()){
        mapJoins(obj);
      }
    }catch(AmazonClientException ex){
      throw new SienaException(ex);
    }
  }
View Full Code Here

TOP

Related Classes of siena.SienaException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.