final String key = keyCreator.key(object.getOid());
writer.writeId(key);
writeFields(writer, specName, object);
final String user = IsisContext.getAuthenticationSession().getUserName();
final Version currentVersion = object.getVersion();
final Version newVersion =
isUpdate ? versionCreator.nextVersion(currentVersion) : versionCreator.newVersion(user);
object.setOptimisticLock(newVersion);
if (newVersion != null) {
final String version = currentVersion == null ? null : versionCreator.versionString(currentVersion);
writer.writeVersion(version, versionCreator.versionString(newVersion));
writer.writeUser(newVersion.getUser());
writer.writeTime(versionCreator.timeString(newVersion));
writer.writeEncryptionType(dataEncrypter.getType());
}
if (isUpdate) {