[Minor] Fixed logging in CachedElementMap
This commit is contained in:
parent
875c9dd27f
commit
6328827f9e
|
@ -163,7 +163,16 @@ public abstract class CachedElementMap<T extends StrolchRootElement> implements
|
||||||
String type = refP.getUom();
|
String type = refP.getUom();
|
||||||
List<String> ids = refP.getValue();
|
List<String> ids = refP.getValue();
|
||||||
|
|
||||||
return ids.stream().map(id -> getBy(tx, type, id, assertExists)).filter(Objects::nonNull)
|
return ids.stream() //
|
||||||
|
.map(id -> {
|
||||||
|
T t = getBy(tx, type, id, false);
|
||||||
|
if (assertExists && t == null) {
|
||||||
|
String msg = "The element with type {0} and id {1} does not exist for param {2}"; //$NON-NLS-1$
|
||||||
|
throw new StrolchException(MessageFormat.format(msg, type, id, refP.getLocator()));
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
}) //
|
||||||
|
.filter(Objects::nonNull) //
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,7 +379,7 @@ public abstract class CachedElementMap<T extends StrolchRootElement> implements
|
||||||
@Override
|
@Override
|
||||||
public T revertToVersion(StrolchTransaction tx, String type, String id, int version) throws StrolchException {
|
public T revertToVersion(StrolchTransaction tx, String type, String id, int version) throws StrolchException {
|
||||||
if (!this.realm.isVersioningEnabled()) {
|
if (!this.realm.isVersioningEnabled()) {
|
||||||
throw new StrolchPersistenceException("Can not und a version if versioning is not enabled!");
|
throw new StrolchPersistenceException("Can not undo a version if versioning is not enabled!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the current and specified version
|
// get the current and specified version
|
||||||
|
@ -393,7 +402,7 @@ public abstract class CachedElementMap<T extends StrolchRootElement> implements
|
||||||
@Override
|
@Override
|
||||||
public void undoVersion(StrolchTransaction tx, T element) throws StrolchException {
|
public void undoVersion(StrolchTransaction tx, T element) throws StrolchException {
|
||||||
if (!this.realm.isVersioningEnabled()) {
|
if (!this.realm.isVersioningEnabled()) {
|
||||||
throw new StrolchPersistenceException("Can not und a version if versioning is not enabled!");
|
throw new StrolchPersistenceException("Can not undo a version if versioning is not enabled!");
|
||||||
}
|
}
|
||||||
|
|
||||||
String type = element.getType();
|
String type = element.getType();
|
||||||
|
|
Loading…
Reference in New Issue