Objects: add putNew

to avoid searching for nonexistent objects
This commit is contained in:
2025-04-28 23:47:53 +02:00
parent 9ff914bdaa
commit bc5f0b816c
5 changed files with 24 additions and 1 deletions

View File

@@ -93,6 +93,11 @@ public class RemoteTransaction {
curTx.put(newData);
}
public <T extends JDataRemote> void putDataNew(T obj) {
curTx.putNew(new RemoteObjectMeta(obj, persistentPeerDataService.getSelfUuid()));
curTx.putNew(new RemoteObjectDataWrapper<>(obj));
}
public <T extends JDataRemote> void putData(T obj) {
var curMeta = getMeta(obj.key()).orElse(null);