[Fix] Fixed tx.addOrUpdate() when already in filter
This commit is contained in:
parent
647215f7a3
commit
a3f8c862c0
|
@ -974,8 +974,7 @@ public abstract class AbstractTransaction implements StrolchTransaction {
|
||||||
public void addOrUpdate(Resource resource) throws StrolchModelException {
|
public void addOrUpdate(Resource resource) throws StrolchModelException {
|
||||||
assertNotReadOnly();
|
assertNotReadOnly();
|
||||||
DBC.PRE.assertNotNull("resource must not be null", resource);
|
DBC.PRE.assertNotNull("resource must not be null", resource);
|
||||||
if (hasResource(resource.getType(), resource.getId()) && !getObjectFilter()
|
if (hasResource(resource.getType(), resource.getId()))
|
||||||
.hasElement(Tags.RESOURCE, resource.getLocator()))
|
|
||||||
getObjectFilter().update(Tags.RESOURCE, resource.getLocator(), resource);
|
getObjectFilter().update(Tags.RESOURCE, resource.getLocator(), resource);
|
||||||
else
|
else
|
||||||
getObjectFilter().add(Tags.RESOURCE, resource.getLocator(), resource);
|
getObjectFilter().add(Tags.RESOURCE, resource.getLocator(), resource);
|
||||||
|
@ -985,7 +984,7 @@ public abstract class AbstractTransaction implements StrolchTransaction {
|
||||||
public void addOrUpdate(Order order) throws StrolchModelException {
|
public void addOrUpdate(Order order) throws StrolchModelException {
|
||||||
assertNotReadOnly();
|
assertNotReadOnly();
|
||||||
DBC.PRE.assertNotNull("order must not be null", order);
|
DBC.PRE.assertNotNull("order must not be null", order);
|
||||||
if (hasOrder(order.getType(), order.getId()) && !getObjectFilter().hasElement(Tags.ORDER, order.getLocator()))
|
if (hasOrder(order.getType(), order.getId()))
|
||||||
getObjectFilter().update(Tags.ORDER, order.getLocator(), order);
|
getObjectFilter().update(Tags.ORDER, order.getLocator(), order);
|
||||||
else
|
else
|
||||||
getObjectFilter().add(Tags.ORDER, order.getLocator(), order);
|
getObjectFilter().add(Tags.ORDER, order.getLocator(), order);
|
||||||
|
@ -995,8 +994,7 @@ public abstract class AbstractTransaction implements StrolchTransaction {
|
||||||
public void addOrUpdate(Activity activity) throws StrolchModelException {
|
public void addOrUpdate(Activity activity) throws StrolchModelException {
|
||||||
assertNotReadOnly();
|
assertNotReadOnly();
|
||||||
DBC.PRE.assertNotNull("activity must not be null", activity);
|
DBC.PRE.assertNotNull("activity must not be null", activity);
|
||||||
if (hasActivity(activity.getType(), activity.getId()) && !getObjectFilter()
|
if (hasActivity(activity.getType(), activity.getId()))
|
||||||
.hasElement(Tags.ACTIVITY, activity.getLocator()))
|
|
||||||
getObjectFilter().update(Tags.ACTIVITY, activity.getLocator(), activity);
|
getObjectFilter().update(Tags.ACTIVITY, activity.getLocator(), activity);
|
||||||
else
|
else
|
||||||
getObjectFilter().add(Tags.ACTIVITY, activity.getLocator(), activity);
|
getObjectFilter().add(Tags.ACTIVITY, activity.getLocator(), activity);
|
||||||
|
|
Loading…
Reference in New Issue