Search in sources :

Example 1 with OBeforeSerialization

use of com.orientechnologies.orient.core.annotation.OBeforeSerialization in project orientdb by orientechnologies.

the class Account method toStream.

@OBeforeSerialization
public void toStream(final ODocument iDocument) {
    if (thumbnail != null) {
        // WRITE THE PHOTO IN AN EXTERNAL RECORD AS PURE BINARY
        OBlob externalPhoto = new ORecordBytes(thumbnail);
        iDocument.field("externalPhoto", externalPhoto);
    }
}
Also used : OBlob(com.orientechnologies.orient.core.record.impl.OBlob) ORecordBytes(com.orientechnologies.orient.core.record.impl.ORecordBytes) OBeforeSerialization(com.orientechnologies.orient.core.annotation.OBeforeSerialization)

Aggregations

OBeforeSerialization (com.orientechnologies.orient.core.annotation.OBeforeSerialization)1 OBlob (com.orientechnologies.orient.core.record.impl.OBlob)1 ORecordBytes (com.orientechnologies.orient.core.record.impl.ORecordBytes)1