2019-03-22 15:18:23 +01:00
/ * *
*
* /
package org.gcube.informationsystem.model.reference.properties ;
2020-07-07 17:04:25 +02:00
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize ;
2019-03-22 15:18:23 +01:00
import org.gcube.informationsystem.model.impl.properties.PropagationConstraintImpl ;
import org.gcube.informationsystem.types.annotations.ISProperty ;
2020-12-15 11:28:34 +01:00
import org.gcube.informationsystem.types.reference.Change ;
import org.gcube.informationsystem.types.reference.TypeMetadata ;
import org.gcube.informationsystem.utils.TypeVersion ;
2019-03-22 15:18:23 +01:00
/ * *
* @author Luca Frosini ( ISTI - CNR )
* https : //wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Propagation_Constraint
* /
@JsonDeserialize ( as = PropagationConstraintImpl . class )
2020-12-15 11:28:34 +01:00
@TypeMetadata ( name = PropagationConstraint . NAME , description = " This class provides propation constraint for Relation " , version = TypeVersion . MINIMAL_VERSION_STRING )
@Change ( version = TypeVersion . MINIMAL_VERSION_STRING , description = TypeVersion . MINIMAL_VERSION_DESCRIPTION )
2019-03-22 15:18:23 +01:00
public interface PropagationConstraint extends Property {
2020-02-03 11:24:55 +01:00
public static final String NAME = " PropagationConstraint " ; // PropagationConstraint.class.getSimpleName();
2019-03-22 15:18:23 +01:00
public static final String REMOVE_PROPERTY = " remove " ;
public static final String ADD_PROPERTY = " add " ;
public enum RemoveConstraint {
/ * *
* When the source Entity is removed also the target
* Entity is removed but if and only if the latter has no other
* incoming Relation .
* /
cascadeWhenOrphan ,
/ * *
* When the source Entity is removed also the target
* Entity is removed .
* /
cascade ,
/ * *
* When the source Entity is removed the target Entity
* is keep .
* /
keep
}
public enum AddConstraint {
propagate ,
unpropagate
}
@ISProperty ( name = REMOVE_PROPERTY )
public RemoveConstraint getRemoveConstraint ( ) ;
public void setRemoveConstraint ( RemoveConstraint removeConstraint ) ;
@ISProperty ( name = ADD_PROPERTY )
public AddConstraint getAddConstraint ( ) ;
public void setAddConstraint ( AddConstraint addConstraint ) ;
}