propValue = new Text(s);
} else if (propValue instanceof byte[]) {
byte[] arr = (byte[]) propValue;
// GAE Blob doesn't accept more than 1MB
if (arr.length < 1000000)
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);
break;
case SERIALIZE_JAVA:
// this embedding mode doesn't manage @EmbedIgnores
try {
byte[] b = JavaSerializer.serialize(propValue);
// if length is less than 1Mb, can store in a blob else???
if(b.length <= 1000000){
propValue = new Blob(b);
}else{
throw new SienaException("object can be java serialized because it's too large >1mb");
}
}
catch(IOException ex) {