|
|
@ -175,6 +175,14 @@ public class RedissonLiveObjectService implements RLiveObjectService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public <T> List<T> persist(T... detachedObjects) {
|
|
|
|
public <T> List<T> persist(T... detachedObjects) {
|
|
|
|
|
|
|
|
return persist(RCascadeType.PERSIST, detachedObjects);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public <T> List<T> merge(T... detachedObjects) {
|
|
|
|
|
|
|
|
return persist(RCascadeType.MERGE, detachedObjects);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public <T> List<T> persist(RCascadeType type, T... detachedObjects) {
|
|
|
|
CommandBatchService batchService = new CommandBatchService(commandExecutor);
|
|
|
|
CommandBatchService batchService = new CommandBatchService(commandExecutor);
|
|
|
|
|
|
|
|
|
|
|
|
Map<Class<?>, Class<?>> classCache = new HashMap<>();
|
|
|
|
Map<Class<?>, Class<?>> classCache = new HashMap<>();
|
|
|
@ -191,6 +199,7 @@ public class RedissonLiveObjectService implements RLiveObjectService {
|
|
|
|
name2id.put(liveMap.getName(), id);
|
|
|
|
name2id.put(liveMap.getName(), id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (type == RCascadeType.PERSIST) {
|
|
|
|
CommandBatchService checkExecutor = new CommandBatchService(batchService);
|
|
|
|
CommandBatchService checkExecutor = new CommandBatchService(batchService);
|
|
|
|
for (Entry<String, Object> entry : name2id.entrySet()) {
|
|
|
|
for (Entry<String, Object> entry : name2id.entrySet()) {
|
|
|
|
RMap<String, Object> map = new RedissonMap<>(checkExecutor, entry.getKey(), null, null, null);
|
|
|
|
RMap<String, Object> map = new RedissonMap<>(checkExecutor, entry.getKey(), null, null, null);
|
|
|
@ -206,6 +215,7 @@ public class RedissonLiveObjectService implements RLiveObjectService {
|
|
|
|
throw new IllegalArgumentException("Object with id=" + id + " already exists.");
|
|
|
|
throw new IllegalArgumentException("Object with id=" + id + " already exists.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (Entry<T, Object> entry : detached2Attached.entrySet()) {
|
|
|
|
for (Entry<T, Object> entry : detached2Attached.entrySet()) {
|
|
|
|
T detachedObject = entry.getKey();
|
|
|
|
T detachedObject = entry.getKey();
|
|
|
|