Package siena.embed

Examples of siena.embed.Embedded


        return val.toString();
      } else if (type == byte[].class) {
        return Base64.encodeBytes((byte[]) val);
      }
      else if (ClassInfo.isEmbedded(field)) {
        Embedded embed = field.getAnnotation(Embedded.class);
        switch(embed.mode()){
        case SERIALIZE_JSON:
          return JsonSerializer.serialize(val).toString();
        case SERIALIZE_JAVA:
          // this embedding mode doesn't manage @EmbedIgnores
          try {
View Full Code Here


    }
    return false;
  }
 
  public static boolean isEmbeddedNative(Field field) {
    Embedded embed = field.getAnnotation(Embedded.class);
    if(embed != null && embed.mode() == Embedded.Mode.NATIVE){
      return true;
    }
    return false;
  }
View Full Code Here

      if(UUID.class == type) {
        return UUID.fromString((String)value);
      }
    }
   
    Embedded embed = field.getAnnotation(Embedded.class);
    if(embed != null) {
      switch(embed.mode()){
      case SERIALIZE_JSON:
        if(String.class.isAssignableFrom(value.getClass())) {
          Json data = Json.loads((String) value);
          return JsonSerializer.deserialize(field, data);
        }
View Full Code Here

              value = new Blob(arr);
            else
              value = new Blob(Arrays.copyOf(arr, 1000000));
          }
          else if (ClassInfo.isEmbedded(field)) {
            Embedded embed = field.getAnnotation(Embedded.class);
            switch(embed.mode()){
            case SERIALIZE_JSON:
              value = JsonSerializer.serialize(value).toString();
              String s = (String) value;
              if (s.length() > 500)
                value = new Text(s);
View Full Code Here

      else if(Blob.class.isAssignableFrom(value.getClass())) {
        if(f.getType() == byte[].class) {
          value = ((Blob) value).getBytes();
        }
        else {
          Embedded embed = f.getAnnotation(Embedded.class);
          if(embed != null) {
            switch(embed.mode()){
            case SERIALIZE_JSON:
              break;
            case SERIALIZE_JAVA:
              value = ((Blob) value).getBytes();
              break;
View Full Code Here

            propValue = new Blob(arr);
          else
            propValue = new Blob(Arrays.copyOf(arr, 1000000));
        }
        else if (ClassInfo.isEmbedded(f)) {
          Embedded embed = f.getAnnotation(Embedded.class);
          switch(embed.mode()){
          case SERIALIZE_JSON:
            propValue = JsonSerializer.serialize(propValue).toString();
            String s = (String) propValue;
            if (s.length() > 500)
              propValue = new Text(s);
View Full Code Here

          column.setSizeAndScale(19, 2);
        }
      }
    }
    else {
      Embedded embedded = field.getAnnotation(Embedded.class);
      if(embedded != null) {
        if("h2".equals(DB)){
          columnType = Types.CLOB;
        }
        else {
View Full Code Here

          return Types.DECIMAL;
        }
      }
    }
    else {
      Embedded embedded = field.getAnnotation(Embedded.class);
      if(embedded != null) {
        if("h2".equals(DB)){
          return Types.CLOB;
        }
        else {
View Full Code Here

          ps.setBigDecimal(index, (BigDecimal)value);
        }
      }
    }
    else {
      Embedded embedded = field.getAnnotation(Embedded.class);
      if(embedded != null) {
        if("h2".equals(DB)){
          StringReader reader = new StringReader((String)value);
          ps.setClob(index, reader);
        }
View Full Code Here

TOP

Related Classes of siena.embed.Embedded

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.