[New] implemented a TransactionResult
This allows reflecting on actual changes performed by the transaction if this is needed by the caller. One use case would be to perform observer updates after a transaction was completed.
This commit is contained in:
parent
2665aa31b6
commit
23d8a1e0ce
|
@ -1,5 +1,6 @@
|
||||||
package ch.eitchnet.xmlpers.api;
|
package ch.eitchnet.xmlpers.api;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ModificationResult {
|
public class ModificationResult {
|
||||||
|
@ -9,6 +10,13 @@ public class ModificationResult {
|
||||||
private final List<?> updated;
|
private final List<?> updated;
|
||||||
private final List<?> deleted;
|
private final List<?> deleted;
|
||||||
|
|
||||||
|
public ModificationResult(String key) {
|
||||||
|
this.key = key;
|
||||||
|
this.created = new ArrayList<>();
|
||||||
|
this.updated = new ArrayList<>();
|
||||||
|
this.deleted = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
public ModificationResult(String key, List<?> created, List<?> updated, List<?> deleted) {
|
public ModificationResult(String key, List<?> created, List<?> updated, List<?> deleted) {
|
||||||
this.key = key;
|
this.key = key;
|
||||||
this.created = created;
|
this.created = created;
|
||||||
|
|
|
@ -108,13 +108,6 @@ public class TransactionResult {
|
||||||
this.closeDuration = closeDuration;
|
this.closeDuration = closeDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the modificationByKey
|
|
||||||
*/
|
|
||||||
public Map<String, ModificationResult> getModificationByKey() {
|
|
||||||
return this.modificationByKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param modificationByKey
|
* @param modificationByKey
|
||||||
* the modificationByKey to set
|
* the modificationByKey to set
|
||||||
|
|
Loading…
Reference in New Issue