Changed PROPAGATION_CONSTRAINT in PROPAGATION_CONSTRAINT_PROPERTY due to

change in IS Model
This commit is contained in:
Luca Frosini 2021-01-13 21:53:51 +01:00
parent 0606d291a4
commit fe96b0811f
1 changed files with 11 additions and 11 deletions

View File

@ -215,9 +215,9 @@ public abstract class RelationManagement<T extends EntityManagement<? extends En
}
protected void checkPropagationConstraint() throws ResourceRegistryException {
Object object = getElement().getProperty(Relation.PROPAGATION_CONSTRAINT);
Object object = getElement().getProperty(Relation.PROPAGATION_CONSTRAINT_PROPERTY);
PropagationConstraintOrient pc = getPropagationConstraint((ODocument) object);
getElement().setProperty(Relation.PROPAGATION_CONSTRAINT, pc, OType.EMBEDDED);
getElement().setProperty(Relation.PROPAGATION_CONSTRAINT_PROPERTY, pc, OType.EMBEDDED);
}
@Override
@ -269,11 +269,11 @@ public abstract class RelationManagement<T extends EntityManagement<? extends En
try {
PropagationConstraint propagationConstraint = Utility.getPropertyDocument(PropagationConstraint.class, element,
Relation.PROPAGATION_CONSTRAINT);
Relation.PROPAGATION_CONSTRAINT_PROPERTY);
if(propagationConstraint.getAddConstraint() != null) {
addConstraint = propagationConstraint.getAddConstraint();
} else {
String error = String.format("%s.%s in %s is null. %s", Relation.PROPAGATION_CONSTRAINT,
String error = String.format("%s.%s in %s is null. %s", Relation.PROPAGATION_CONSTRAINT_PROPERTY,
PropagationConstraint.ADD_PROPERTY, Utility.toJsonString(element, true),
Utility.SHOULD_NOT_OCCUR_ERROR_MESSAGE);
logger.error(error);
@ -281,7 +281,7 @@ public abstract class RelationManagement<T extends EntityManagement<? extends En
}
} catch(Exception e) {
String error = String.format("Error while getting %s from %s while performing AddToContext. %s",
Relation.PROPAGATION_CONSTRAINT, Utility.toJsonString(element, true),
Relation.PROPAGATION_CONSTRAINT_PROPERTY, Utility.toJsonString(element, true),
Utility.SHOULD_NOT_OCCUR_ERROR_MESSAGE);
logger.warn(error);
throw new ResourceRegistryException(error, e);
@ -334,11 +334,11 @@ public abstract class RelationManagement<T extends EntityManagement<? extends En
try {
PropagationConstraint propagationConstraint = Utility.getPropertyDocument(PropagationConstraint.class, element,
Relation.PROPAGATION_CONSTRAINT);
Relation.PROPAGATION_CONSTRAINT_PROPERTY);
if(propagationConstraint.getRemoveConstraint() != null) {
removeConstraint = propagationConstraint.getRemoveConstraint();
} else {
String error = String.format("%s.%s in %s is null. %s", Relation.PROPAGATION_CONSTRAINT,
String error = String.format("%s.%s in %s is null. %s", Relation.PROPAGATION_CONSTRAINT_PROPERTY,
PropagationConstraint.REMOVE_PROPERTY, Utility.toJsonString(element, true),
Utility.SHOULD_NOT_OCCUR_ERROR_MESSAGE);
logger.error(error);
@ -346,7 +346,7 @@ public abstract class RelationManagement<T extends EntityManagement<? extends En
}
} catch(Exception e) {
String error = String.format("Error while getting %s from %s while performing RemoveFromContext. %s",
Relation.PROPAGATION_CONSTRAINT, Utility.toJsonString(element, true),
Relation.PROPAGATION_CONSTRAINT_PROPERTY, Utility.toJsonString(element, true),
Utility.SHOULD_NOT_OCCUR_ERROR_MESSAGE);
logger.error(error);
throw new ResourceRegistryException(error, e);
@ -415,18 +415,18 @@ public abstract class RelationManagement<T extends EntityManagement<? extends En
try {
PropagationConstraint propagationConstraint = Utility.getPropertyDocument(PropagationConstraint.class,
element, Relation.PROPAGATION_CONSTRAINT);
element, Relation.PROPAGATION_CONSTRAINT_PROPERTY);
if(propagationConstraint.getRemoveConstraint() != null) {
removeConstraint = propagationConstraint.getRemoveConstraint();
} else {
String error = String.format("%s.%s in %s is null. %s", Relation.PROPAGATION_CONSTRAINT,
String error = String.format("%s.%s in %s is null. %s", Relation.PROPAGATION_CONSTRAINT_PROPERTY,
PropagationConstraint.REMOVE_PROPERTY, Utility.toJsonString(element, true),
Utility.SHOULD_NOT_OCCUR_ERROR_MESSAGE);
logger.error(error);
throw new ResourceRegistryException(error);
}
} catch(Exception e) {
logger.warn("Error while getting {} from {}. Assuming {}. {}", Relation.PROPAGATION_CONSTRAINT,
logger.warn("Error while getting {} from {}. Assuming {}. {}", Relation.PROPAGATION_CONSTRAINT_PROPERTY,
Utility.toJsonString(element, true), removeConstraint, Utility.SHOULD_NOT_OCCUR_ERROR_MESSAGE);
}