Package siena

Examples of siena.SienaException


        }
        else {
          setFromObject(obj, field, entity.getProperty(property));
        }
      } catch (Exception e) {
        throw new SienaException(e);
      }
    }
  }
View Full Code Here


  }
 
  public static void embed(ReplaceableItem item, String embeddingColumnName, Object embeddedObj){
    Class<?> clazz = embeddedObj.getClass();
    if(clazz.isArray() || Collection.class.isAssignableFrom(clazz)){
      throw new SienaException("can't serializer Array/Collection in native mode");
    }
   
    for (Field f : ClassInfo.getClassInfo(clazz).updateFields) {
      String propValue = SdbMappingUtils.objectFieldToString(embeddedObj, f);
      if(propValue != null){
View Full Code Here

  }
 
  public static <T> T unembed(
      Class<T> clazz, String embeddingFieldName, List<Attribute> attrs){
    if(clazz.isArray() || Collection.class.isAssignableFrom(clazz)){
      throw new SienaException("can't serializer Array/Collection in native mode");
    }

    T obj = Util.createObjectInstance(clazz);
    try {
      Attribute theAttr;
     
      for (Field f : ClassInfo.getClassInfo(clazz).updateFields) {
        if(!ClassInfo.isEmbeddedNative(f)){
          // doesn't try to analyze fields, just try to store it
          String attrName = getEmbeddedAttributeName(embeddingFieldName, f);     
         
          theAttr = null;
          // searches attribute and if found, removes it from the list to reduce number of attributes
          for(Attribute attr: attrs){
            if(attrName.equals(attr.getName())){
              theAttr = attr;
              attrs.remove(attr);
              break;
            }
          }
          if(theAttr != null){
            SdbMappingUtils.setFromString(obj, f, theAttr.getValue());
          }
        } else {
          Object value = SdbNativeSerializer.unembed(
              f.getType(), getEmbeddedAttributeName(embeddingFieldName, f),
              attrs);
          Util.setField(obj, f, value);
        }
      }
     
      return obj;
    }catch(Exception e){
      throw new SienaException(e);
    }
  }
View Full Code Here

        }*/
        else {
          setFromObject(obj, field, entity.getProperty(property));
        }
      } catch (Exception e) {
        throw new SienaException(e);
      }
    }
  }
View Full Code Here

      obj = Util.createObjectInstance(clazz);
      setIdFromKey(id, obj, entity.getKey());
    } catch (SienaException e) {
      throw e;
    } catch (Exception e) {
      throw new SienaException(e);
    }
 
    return obj;
  }
View Full Code Here

        list.add(obj);
        setIdFromKey(id, obj, entity.getKey());
      } catch (SienaException e) {
        throw e;
      } catch (Exception e) {
        throw new SienaException(e);
      }
    }
    return list;
  }
View Full Code Here

        list.add(obj);
        setIdFromKey(id, obj, entity.getKey());
      } catch (SienaException e) {
        throw e;
      } catch (Exception e) {
        throw new SienaException(e);
      }
    }
    return list;
  }
View Full Code Here

        setIdFromKey(id, obj, entity.getKey());
      }
    } catch (SienaException e) {
      throw e;
    } catch (Exception e) {
      throw new SienaException(e);
    }
 
    return obj;
  }
View Full Code Here

        list.add(obj);
        setIdFromKey(id, obj, entity.getKey());
      } catch (SienaException e) {
        throw e;
      } catch (Exception e) {
        throw new SienaException(e);
      }
    }
    return list;
  }
View Full Code Here

        list.add(obj);
        setIdFromKey(id, obj, entity.getKey());
      } catch (SienaException e) {
        throw e;
      } catch (Exception e) {
        throw new SienaException(e);
      }
    }
    return list;
  }
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.