2019-03-22 15:18:23 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
package org.gcube.informationsystem.model.impl.relations;
|
|
|
|
|
2020-07-07 17:04:25 +02:00
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonTypeName;
|
2020-10-14 16:23:23 +02:00
|
|
|
import org.gcube.informationsystem.model.impl.properties.PropagationConstraintImpl;
|
2019-03-22 15:18:23 +01:00
|
|
|
import org.gcube.informationsystem.model.reference.entities.Resource;
|
|
|
|
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint;
|
2020-10-14 16:23:23 +02:00
|
|
|
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint.AddConstraint;
|
2023-02-02 19:34:47 +01:00
|
|
|
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint.DeleteConstraint;
|
2020-10-14 16:23:23 +02:00
|
|
|
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint.RemoveConstraint;
|
2019-03-22 15:18:23 +01:00
|
|
|
import org.gcube.informationsystem.model.reference.relations.IsRelatedTo;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
|
|
*/
|
|
|
|
@JsonTypeName(value=IsRelatedTo.NAME)
|
2019-11-04 18:06:46 +01:00
|
|
|
public abstract class IsRelatedToImpl<S extends Resource, T extends Resource> extends
|
|
|
|
RelationImpl<S, T> implements IsRelatedTo<S, T> {
|
2019-03-22 15:18:23 +01:00
|
|
|
|
2019-10-23 16:55:48 +02:00
|
|
|
/**
|
|
|
|
* Generated Serial Version UID
|
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 5119376559964300102L;
|
|
|
|
|
2019-03-22 15:18:23 +01:00
|
|
|
protected IsRelatedToImpl(){
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
2020-10-14 16:23:23 +02:00
|
|
|
public IsRelatedToImpl(S source, T target) {
|
2023-02-02 19:34:47 +01:00
|
|
|
this(source, target, null);
|
2020-10-14 16:23:23 +02:00
|
|
|
}
|
|
|
|
|
2019-11-04 18:06:46 +01:00
|
|
|
public IsRelatedToImpl(S source, T target,
|
2019-03-22 15:18:23 +01:00
|
|
|
PropagationConstraint propagationConstraint) {
|
|
|
|
super(source, target, propagationConstraint);
|
2020-10-14 16:23:23 +02:00
|
|
|
if(this.propagationConstraint==null) {
|
|
|
|
this.propagationConstraint = new PropagationConstraintImpl();
|
|
|
|
this.propagationConstraint.setAddConstraint(AddConstraint.unpropagate);
|
|
|
|
this.propagationConstraint.setRemoveConstraint(RemoveConstraint.keep);
|
2023-02-02 19:34:47 +01:00
|
|
|
this.propagationConstraint.setDeleteConstraint(DeleteConstraint.keep);
|
2020-10-14 16:23:23 +02:00
|
|
|
}
|
2019-03-22 15:18:23 +01:00
|
|
|
}
|
2020-10-14 16:23:23 +02:00
|
|
|
|
2019-03-22 15:18:23 +01:00
|
|
|
}
|