Added convenient interface to identify Entity and Relation

This commit is contained in:
Luca Frosini 2021-02-05 11:30:47 +01:00
parent 15d8dce3e3
commit 2cac6ddc63
3 changed files with 17 additions and 2 deletions

View File

@ -0,0 +1,13 @@
package org.gcube.informationsystem.model.reference;
import org.gcube.informationsystem.base.reference.IdentifiableElement;
/**
* This interfaces is an helper to identify elements of the model
* i.e. REsource, Facet, IsRelatedTo, ConsistsOf
*
* @author Luca Frosini (ISTI - CNR)
*/
public interface ModelElement extends IdentifiableElement {
}

View File

@ -4,6 +4,7 @@
package org.gcube.informationsystem.model.reference.entities;
import org.gcube.informationsystem.base.reference.entities.EntityElement;
import org.gcube.informationsystem.model.reference.ModelElement;
import org.gcube.informationsystem.types.annotations.Abstract;
import org.gcube.informationsystem.types.reference.Change;
import org.gcube.informationsystem.types.reference.TypeMetadata;
@ -18,7 +19,7 @@ import org.gcube.informationsystem.utils.TypeVersion;
//@JsonDeserialize(as=EntityImpl.class) Do not uncomment to manage subclasses
@TypeMetadata(name = Entity.NAME, description = "This is the base class for Entities", version = TypeVersion.MINIMAL_VERSION_STRING)
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
public interface Entity extends EntityElement {
public interface Entity extends EntityElement, ModelElement {
public static final String NAME = "Entity"; //Entity.class.getSimpleName();

View File

@ -13,6 +13,7 @@ import org.gcube.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.gcube.informationsystem.base.reference.SchemaMixedElement;
import org.gcube.informationsystem.base.reference.relations.RelationElement;
import org.gcube.informationsystem.model.reference.ModelElement;
import org.gcube.informationsystem.model.reference.entities.Entity;
import org.gcube.informationsystem.model.reference.entities.Resource;
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint;
@ -32,7 +33,7 @@ import org.gcube.informationsystem.utils.TypeVersion;
// @JsonDeserialize(as=RelationImpl.class) Do not uncomment to manage subclasses
@TypeMetadata(name = Relation.NAME, description = "This is the base class for Relations", version = TypeVersion.MINIMAL_VERSION_STRING)
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
public interface Relation<S extends Resource, T extends Entity> extends RelationElement<S,T>, SchemaMixedElement {
public interface Relation<S extends Resource, T extends Entity> extends RelationElement<S,T>, SchemaMixedElement, ModelElement {
public static final String NAME = "Relation"; //Relation.class.getSimpleName();