Package siena

Examples of siena.ClassInfo


    }
  }
 
  protected <T> T mapOwned(T model) {
    Class<?> clazz = model.getClass();
    ClassInfo info = ClassInfo.getClassInfo(clazz);
   
    for(Field f: info.ownedFields){
      if(ClassInfo.isOne(f)){
        One4PM<?> lq = (One4PM<?>)Util.readField(model, f);
        // sets the sync flag to false to tell that it should be fetched when the listquery is accessed!
View Full Code Here


    return models;
  }
 
  protected <T> T mapAggregated(T model) {
    Class<?> clazz = model.getClass();
    ClassInfo info = ClassInfo.getClassInfo(clazz);
   
    //Map<Field, ClassInfo> modelMap = new HashMap<Field, ClassInfo>();
    //boolean hasOneMany = false;
   
    // we scan the aggregatedfields to find potential one/many
View Full Code Here

 
  protected <T> T map(Query<T> query, Entity entity) {
    Class<T> clazz = query.getQueriedClass();
    T result = GaeMappingUtils.mapEntity(entity, clazz);
    ClassInfo info = ClassInfo.getClassInfo(clazz);
   
    // maps model relations to be able to associate children to aggregators
    GaeMappingUtils.mapRelation(query, result, info);
   
    // related fields (Many<T> management mainly)
View Full Code Here

  }
 
  protected <T> List<T> map(Query<T> query, List<Entity> entities) {
    Class<T> clazz = query.getQueriedClass();
    List<T> results = GaeMappingUtils.mapEntities(entities, clazz);
    ClassInfo info = ClassInfo.getClassInfo(clazz);
   
    // maps model relations to be able to associate children to aggregators
    GaeMappingUtils.mapRelations(query, results, info);
   
    // related fields (Many<T> management mainly)
View Full Code Here

  }

  protected <T> List<T> mapKeysOnly(Query<T> query, List<Entity> entities) {
    Class<T> clazz = query.getQueriedClass();
    List<T> results = GaeMappingUtils.mapEntitiesKeysOnly(entities, clazz);
    ClassInfo info = ClassInfo.getClassInfo(clazz);
   
    // maps model relations to be able to associate children to aggregators
    GaeMappingUtils.mapRelations(query, results, info);
   
    // DOESN'T MANAGE OWNED/AGGREGATED/JOIN fields
View Full Code Here

  public <T> int delete(Query<T> query) {
    final ArrayList<Key> keys = new ArrayList<Key>();

    Class<?> clazz = query.getQueriedClass();
    ClassInfo info = ClassInfo.getClassInfo(clazz);
       
    if(!info.hasAggregatedFields){
      for (final Entity entity : prepareKeysOnly(query).asIterable(
          FetchOptions.Builder.withDefaults())) {
        keys.add(entity.getKey());
View Full Code Here

    return getByKeys(clazz, Arrays.asList(keys));   
  }

  public <T> List<T> getByKeys(Class<T> clazz, Iterable<?> keys) {
    List<Key> gaeKeys = new ArrayList<Key>();
    ClassInfo info = ClassInfo.getClassInfo(clazz);
   
    for(Object key:keys){
      gaeKeys.add(GaeMappingUtils.makeKeyFromId(clazz, key));
    }
   
View Full Code Here

    List<Object> entities2Insert = new ArrayList<Object>();
    List<Object> entities2Update = new ArrayList<Object>();

    for(Object obj:objects){
      Class<?> clazz = obj.getClass();
      ClassInfo info = ClassInfo.getClassInfo(clazz);
      Field idField = info.getIdField();
     
      Object idVal = Util.readField(obj, idField);
      // id with null value means insert
      if(idVal == null){
        entities2Insert.add(obj);
View Full Code Here

    return false;
  }
 
  public void insert(Object obj) {
    Class<?> clazz = obj.getClass();
    ClassInfo info = ClassInfo.getClassInfo(clazz);
   
    String domain = SdbMappingUtils.getDomainName(clazz, prefix);
   
    try {
      checkDomain(domain);
View Full Code Here

    return nb;
  }
 
  public void get(Object obj) {
    Class<?> clazz = obj.getClass();
    ClassInfo info = ClassInfo.getClassInfo(obj.getClass());
   
    String domain = SdbMappingUtils.getDomainName(clazz, prefix);
    try {
      checkDomain(domain);
      GetAttributesRequest req = SdbMappingUtils.createGetRequest(domain, clazz, obj);
View Full Code Here

TOP

Related Classes of siena.ClassInfo

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.