@Override
protected void writeFields(final ODocument document, final Asset entity) {
super.writeFields(document, entity);
EntityId componentId = entity.componentId();
document.field(P_COMPONENT, componentId != null ? componentEntityAdapter.recordIdentity(componentId) : null);
document.field(P_NAME, entity.name());
document.field(P_SIZE, entity.size());
document.field(P_CONTENT_TYPE, entity.contentType());
document.field(P_CREATED_BY, entity.createdBy());
document.field(P_CREATED_BY_IP, entity.createdByIp());
BlobRef blobRef = entity.blobRef();
document.field(P_BLOB_REF, blobRef != null ? blobRef.toString() : null);
DateTime lastDownloaded = entity.lastDownloaded();
document.field(P_LAST_DOWNLOADED, lastDownloaded != null ? lastDownloaded.toDate() : null);
DateTime blobCreated = entity.blobCreated();
document.field(P_BLOB_CREATED, blobCreated != null ? blobCreated.toDate() : null);
DateTime blobUpdated = entity.blobUpdated();
document.field(P_BLOB_UPDATED, blobUpdated != null ? blobUpdated.toDate() : null);
}