WriteResult wr;
if (mc.getFieldsAnnotatedWith(Version.class).isEmpty()) {
return null;
}
final MappedField mfVersion = mc.getFieldsAnnotatedWith(Version.class).get(0);
final String versionKeyName = mfVersion.getNameToStore();
Long oldVersion = (Long) mfVersion.getFieldValue(entity);
long newVersion = nextValue(oldVersion);
dbObj.put(versionKeyName, newVersion);
mfVersion.setFieldValue(entity, newVersion);
if (idValue != null && newVersion != 1) {
final UpdateResults res = update(find(dbColl.getName(), entity.getClass()).filter(Mapper.ID_KEY, idValue)
.filter(versionKeyName, oldVersion),
dbObj,