Fixed - LiveObject field can't set to null value. #5847

pull/5875/head
Nikita Koksharov 11 months ago
parent b2e3bcad20
commit 02c40a96c4

@ -175,6 +175,14 @@ public class AccessorInterceptor {
} else {
liveMap.fastPut(fieldName, arg);
}
} else {
if (field.getAnnotation(RIndex.class) == null) {
if (commandExecutor instanceof CommandBatchService) {
liveMap.removeAsync(fieldName);
} else {
liveMap.remove(fieldName);
}
}
}
return me;
}

@ -653,6 +653,19 @@ public class RedissonLiveObjectServiceTest extends RedisDockerTest {
assertThat(objects6.iterator().next().getId()).isEqualTo("4");
}
@Test
public void testNullValue() {
TestClass ti = new TestClass("3");
TestClass liveObject = redisson.getLiveObjectService().merge(ti);
liveObject.setCode("test");
liveObject.setCode(null);
assertThat(liveObject.getCode()).isNull();
liveObject.setCode("123");
assertThat(liveObject.getCode()).isEqualTo("123");
}
@Test
public void testFindGt() {
RLiveObjectService s = redisson.getLiveObjectService();

Loading…
Cancel
Save