Redesigning E/R instance definition

This commit is contained in:
Luca Frosini 2023-04-20 11:09:22 +02:00
parent cba11607d0
commit a977dc0faf
4 changed files with 70 additions and 13 deletions

View File

@ -12,7 +12,6 @@ import org.gcube.informationsystem.base.reference.AccessType;
import org.gcube.informationsystem.base.reference.IdentifiableElement;
import org.gcube.informationsystem.model.reference.properties.Metadata;
import org.gcube.informationsystem.types.annotations.Abstract;
import org.gcube.informationsystem.types.annotations.ISProperty;
import org.gcube.informationsystem.types.reference.properties.PropertyDefinition;
import org.gcube.informationsystem.utils.Version;
@ -38,7 +37,6 @@ public interface Type extends IdentifiableElement {
public static final String PROPERTIES_PROPERTY = "properties";
@JsonGetter(value = UUID_PROPERTY)
@ISProperty(name = UUID_PROPERTY, description = "This UUID is be used to identify the instance univocally.", readonly = true, mandatory = true, nullable = false)
@Override
public UUID getUUID();
@ -47,7 +45,6 @@ public interface Type extends IdentifiableElement {
public void setUUID(UUID uuid);
@JsonGetter(value = METADATA_PROPERTY)
@ISProperty(name=METADATA_PROPERTY, mandatory=true, nullable=false, description="Metadata associated with the instance that is automatically created/updated by the system.")
@Override
public Metadata getMetadata();

View File

@ -1,10 +1,14 @@
package org.gcube.informationsystem.types.reference.entities;
import java.util.Set;
import java.util.UUID;
import org.gcube.com.fasterxml.jackson.annotation.JsonGetter;
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.gcube.com.fasterxml.jackson.annotation.JsonSetter;
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.gcube.informationsystem.base.reference.entities.EntityElement;
import org.gcube.informationsystem.model.reference.properties.Metadata;
import org.gcube.informationsystem.types.annotations.ISProperty;
import org.gcube.informationsystem.types.impl.entities.EntityTypeImpl;
import org.gcube.informationsystem.types.reference.Change;
@ -23,7 +27,25 @@ public interface EntityType extends Type, EntityElement {
public static final String NAME = "EntityType"; //EntityType.class.getSimpleName();
/* TypeDefinition is just a Java useful class. The type is not created in the IS. Hence the fields must be redefined */
/* Type is just a Java useful class. The type is not created in the IS. Hence the fields must be redefined */
@JsonGetter(value = UUID_PROPERTY)
@ISProperty(name = UUID_PROPERTY, description = "This UUID is be used to identify the instance univocally.", readonly = true, mandatory = true, nullable = false)
@Override
public UUID getUUID();
@JsonSetter(value = UUID_PROPERTY)
@Override
public void setUUID(UUID uuid);
@JsonGetter(value = METADATA_PROPERTY)
@ISProperty(name=METADATA_PROPERTY, mandatory=true, nullable=false, description="Metadata associated with the instance that is automatically created/updated by the system.")
@Override
public Metadata getMetadata();
@JsonSetter(value = METADATA_PROPERTY)
@Override
public void setMetadata(Metadata metadata);
@Override
@ISProperty(name = Type.NAME_PROPERTY, readonly = true, mandatory = true, nullable = false)
@ -41,6 +63,6 @@ public interface EntityType extends Type, EntityElement {
@ISProperty(name = Type.TYPE_SUPERCLASSES_PROPERTY, readonly = true, mandatory = true, nullable = false)
public Set<String> getSuperClasses();
/* {@link Type} is just a Java useful class. The type is not created in the IS. Hence the fields must be redefined */
/* Type is just a Java useful class. The type is not created in the IS. Hence the fields must be redefined */
}

View File

@ -1,10 +1,12 @@
package org.gcube.informationsystem.types.reference.properties;
import java.util.Set;
import java.util.UUID;
import org.gcube.com.fasterxml.jackson.annotation.JsonGetter;
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.gcube.com.fasterxml.jackson.annotation.JsonSetter;
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.gcube.informationsystem.base.reference.IdentifiableElement;
import org.gcube.informationsystem.base.reference.properties.PropertyElement;
import org.gcube.informationsystem.model.reference.properties.Metadata;
import org.gcube.informationsystem.types.annotations.Final;
@ -25,15 +27,28 @@ import org.gcube.informationsystem.utils.Version;
@Final
public interface PropertyType<P extends PropertyElement> extends PropertyElement, Type {
public static final String NAME = "PropertyType"; // PropertyTypeDefinition.class.getSimpleName();
public static final String NAME = "PropertyType"; // PropertyType.class.getSimpleName();
@ISProperty(name=IdentifiableElement.METADATA_PROPERTY, mandatory=true, nullable=false)
/* Type is just a Java useful class. The type is not created in the IS. Hence the fields must be redefined */
@JsonGetter(value = UUID_PROPERTY)
@ISProperty(name = UUID_PROPERTY, description = "This UUID is be used to identify the instance univocally.", readonly = true, mandatory = true, nullable = false)
@Override
public UUID getUUID();
@JsonSetter(value = UUID_PROPERTY)
@Override
public void setUUID(UUID uuid);
@JsonGetter(value = METADATA_PROPERTY)
@ISProperty(name=METADATA_PROPERTY, mandatory=true, nullable=false, description="Metadata associated with the instance that is automatically created/updated by the system.")
@Override
public Metadata getMetadata();
@JsonSetter(value = METADATA_PROPERTY)
@Override
public void setMetadata(Metadata metadata);
/* TypeDefinition is just a Java useful class. The type is not created in the IS. Hence the fields must be redefined */
@Override
@ISProperty(name = Type.NAME_PROPERTY, readonly = true, mandatory = true, nullable = false)
public String getName();
@ -53,6 +68,6 @@ public interface PropertyType<P extends PropertyElement> extends PropertyElement
@ISProperty(name = Type.PROPERTIES_PROPERTY, readonly = false, mandatory = true, nullable = false)
public Set<PropertyDefinition> getProperties();
/* TypeDefinition is just a Java useful class. The type is not created in the IS. Hence the fields must be redefined */
/*Type is just a Java useful class. The type is not created in the IS. Hence the fields must be redefined */
}

View File

@ -1,10 +1,14 @@
package org.gcube.informationsystem.types.reference.relations;
import java.util.Set;
import java.util.UUID;
import org.gcube.com.fasterxml.jackson.annotation.JsonGetter;
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.gcube.com.fasterxml.jackson.annotation.JsonSetter;
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.gcube.informationsystem.base.reference.relations.RelationElement;
import org.gcube.informationsystem.model.reference.properties.Metadata;
import org.gcube.informationsystem.types.annotations.ISProperty;
import org.gcube.informationsystem.types.impl.relations.RelationTypeImpl;
import org.gcube.informationsystem.types.reference.Change;
@ -26,7 +30,25 @@ public interface RelationType<S extends EntityType, T extends EntityType>
public static final String NAME = "RelationType"; // RelationType.class.getSimpleName();
/* TypeDefinition is just a Java useful class. The type is not created in the IS. Hence the fields must be redefined */
/* Type is just a Java useful class. The type is not created in the IS. Hence the fields must be redefined */
@JsonGetter(value = UUID_PROPERTY)
@ISProperty(name = UUID_PROPERTY, description = "This UUID is be used to identify the instance univocally.", readonly = true, mandatory = true, nullable = false)
@Override
public UUID getUUID();
@JsonSetter(value = UUID_PROPERTY)
@Override
public void setUUID(UUID uuid);
@JsonGetter(value = METADATA_PROPERTY)
@ISProperty(name=METADATA_PROPERTY, mandatory=true, nullable=false, description="Metadata associated with the instance that is automatically created/updated by the system.")
@Override
public Metadata getMetadata();
@JsonSetter(value = METADATA_PROPERTY)
@Override
public void setMetadata(Metadata metadata);
@Override
@ISProperty(name = Type.NAME_PROPERTY, readonly = true, mandatory = true, nullable = false)
@ -54,7 +76,8 @@ public interface RelationType<S extends EntityType, T extends EntityType>
@Override
public T getTarget();
/* TypeDefinition is just a Java useful class. The type is not created in the IS. Hence the fields must be redefined */
/* Type is just a Java useful class. The type is not created in the IS. Hence the fields must be redefined */
/*@JsonGetter(value=SOURCE_PROPERTY)
public String getSourceType();