public void execute(final PersistenceCommandContext context) {
final NoSqlCommandContext noSqlCommandContext = (NoSqlCommandContext) context;
final ObjectSpecification objectSpec = adapter.getSpecification();
//final String specName = objectSpec.getFullIdentifier();
final StateWriter writer = noSqlCommandContext.createStateWriter(objectSpec.getSpecId());
//final String key = keyCreator.key(adapter.getOid());
//writer.writeId(key);
final TypedOid typedOid = (TypedOid) adapter.getOid();
writer.writeOid(typedOid);
writeFields(writer, adapter);
final String user = getAuthenticationSession().getUserName();
final Version currentVersion = adapter.getVersion();
final Version newVersion = mode.isUpdate() ? versionCreator.nextVersion(currentVersion, user) : versionCreator.newVersion(user);
adapter.setVersion(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 (mode.isUpdate()) {
noSqlCommandContext.update(writer);
} else {