diff --git a/src/main/java/org/gcube/informationsystem/base/reference/Element.java b/src/main/java/org/gcube/informationsystem/base/reference/Element.java index bb04658..7b2c288 100644 --- a/src/main/java/org/gcube/informationsystem/base/reference/Element.java +++ b/src/main/java/org/gcube/informationsystem/base/reference/Element.java @@ -17,13 +17,13 @@ import org.gcube.informationsystem.utils.Version; @Abstract @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = Element.CLASS_PROPERTY) // @JsonTypeIdResolver(ElementTypeIdResolver.class) -@TypeMetadata(name = Element.NAME, description = "This is the base class for Element", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = Element.NAME, description = "This is the base type for Element", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) public interface Element extends Serializable { public static final String NAME = "Element"; //Element.class.getSimpleName(); - public static final String CLASS_PROPERTY = "@class"; + public static final String CLASS_PROPERTY = "type"; public static final String SUPERCLASSES_PROPERTY = "@superClasses"; diff --git a/src/main/java/org/gcube/informationsystem/base/reference/entities/EntityElement.java b/src/main/java/org/gcube/informationsystem/base/reference/entities/EntityElement.java index eb9e116..3baac7f 100644 --- a/src/main/java/org/gcube/informationsystem/base/reference/entities/EntityElement.java +++ b/src/main/java/org/gcube/informationsystem/base/reference/entities/EntityElement.java @@ -20,7 +20,7 @@ import org.gcube.informationsystem.utils.Version; @Abstract @JsonIgnoreProperties(ignoreUnknown=true) //@JsonDeserialize(as=EntityElementImpl.class) Do not uncomment to manage subclasses -@TypeMetadata(name = EntityElement.NAME, description = "This is the base class for any EntityElement", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = EntityElement.NAME, description = "This is the base type for any EntityElement", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) public interface EntityElement extends Element, IdentifiableElement { diff --git a/src/main/java/org/gcube/informationsystem/base/reference/properties/PropertyElement.java b/src/main/java/org/gcube/informationsystem/base/reference/properties/PropertyElement.java index 440dab7..d59e2de 100644 --- a/src/main/java/org/gcube/informationsystem/base/reference/properties/PropertyElement.java +++ b/src/main/java/org/gcube/informationsystem/base/reference/properties/PropertyElement.java @@ -14,7 +14,7 @@ import org.gcube.informationsystem.utils.Version; * @author Luca Frosini (ISTI - CNR) */ @JsonDeserialize(as=PropertyElementImpl.class) -@TypeMetadata(name = PropertyElement.NAME, description = "This is the base class for any PropertyElement", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = PropertyElement.NAME, description = "This is the base type for any PropertyElement", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) public interface PropertyElement extends Element { diff --git a/src/main/java/org/gcube/informationsystem/base/reference/relations/RelationElement.java b/src/main/java/org/gcube/informationsystem/base/reference/relations/RelationElement.java index a9872e7..04dcc86 100644 --- a/src/main/java/org/gcube/informationsystem/base/reference/relations/RelationElement.java +++ b/src/main/java/org/gcube/informationsystem/base/reference/relations/RelationElement.java @@ -20,7 +20,7 @@ import org.gcube.informationsystem.utils.Version; */ @Abstract //@JsonDeserialize(as=RelationElementImpl.class) Do not uncomment to manage subclasses -@TypeMetadata(name = RelationElement.NAME, description = "This is the base class for any RelationElement", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = RelationElement.NAME, description = "This is the base type for any RelationElement", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) public interface RelationElement extends Element, IdentifiableElement { diff --git a/src/main/java/org/gcube/informationsystem/contexts/reference/entities/Context.java b/src/main/java/org/gcube/informationsystem/contexts/reference/entities/Context.java index 8d45b89..8b24067 100644 --- a/src/main/java/org/gcube/informationsystem/contexts/reference/entities/Context.java +++ b/src/main/java/org/gcube/informationsystem/contexts/reference/entities/Context.java @@ -25,7 +25,7 @@ import org.gcube.informationsystem.utils.Version; * @author Luca Frosini (ISTI - CNR) */ @JsonDeserialize(as = ContextImpl.class) -@TypeMetadata(name = Context.NAME, description = "This class is the used to define a Context", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = Context.NAME, description = "This type is the used to define a Context", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) public interface Context extends EntityElement { diff --git a/src/main/java/org/gcube/informationsystem/contexts/reference/relations/IsParentOf.java b/src/main/java/org/gcube/informationsystem/contexts/reference/relations/IsParentOf.java index b66dcf4..a363617 100644 --- a/src/main/java/org/gcube/informationsystem/contexts/reference/relations/IsParentOf.java +++ b/src/main/java/org/gcube/informationsystem/contexts/reference/relations/IsParentOf.java @@ -20,7 +20,7 @@ import org.gcube.informationsystem.utils.Version; * @author Luca Frosini (ISTI - CNR) */ @JsonDeserialize(as = IsParentOfImpl.class) -@TypeMetadata(name = IsParentOf.NAME, description = "This class is the used to define parental relations between Context", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = IsParentOf.NAME, description = "This type is the used to define parental relations between Context", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) public interface IsParentOf extends RelationElement { diff --git a/src/main/java/org/gcube/informationsystem/model/impl/entities/DummyFacet.java b/src/main/java/org/gcube/informationsystem/model/impl/entities/DummyFacet.java index 20890ba..3d81059 100644 --- a/src/main/java/org/gcube/informationsystem/model/impl/entities/DummyFacet.java +++ b/src/main/java/org/gcube/informationsystem/model/impl/entities/DummyFacet.java @@ -14,7 +14,7 @@ import org.gcube.informationsystem.utils.Version; /** * @author Luca Frosini (ISTI - CNR) */ -@TypeMetadata(name = Facet.NAME, description = "This is a dummy class for Facet", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = Facet.NAME, description = "This is a dummy type for Facet", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) public class DummyFacet extends FacetImpl implements Facet { diff --git a/src/main/java/org/gcube/informationsystem/model/impl/entities/DummyResource.java b/src/main/java/org/gcube/informationsystem/model/impl/entities/DummyResource.java index 683bd41..98623e1 100644 --- a/src/main/java/org/gcube/informationsystem/model/impl/entities/DummyResource.java +++ b/src/main/java/org/gcube/informationsystem/model/impl/entities/DummyResource.java @@ -14,7 +14,7 @@ import org.gcube.informationsystem.utils.Version; /** * @author Luca Frosini (ISTI - CNR) */ -@TypeMetadata(name = Resource.NAME, description = "This is a dummy class for Resource", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = Resource.NAME, description = "This is a dummy type for Resource", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) public class DummyResource extends ResourceImpl implements Resource { diff --git a/src/main/java/org/gcube/informationsystem/model/impl/relations/DummyIsRelatedTo.java b/src/main/java/org/gcube/informationsystem/model/impl/relations/DummyIsRelatedTo.java index 7ddecb5..7f23913 100644 --- a/src/main/java/org/gcube/informationsystem/model/impl/relations/DummyIsRelatedTo.java +++ b/src/main/java/org/gcube/informationsystem/model/impl/relations/DummyIsRelatedTo.java @@ -13,7 +13,7 @@ import org.gcube.informationsystem.utils.Version; /** * @author Luca Frosini (ISTI - CNR) */ -@TypeMetadata(name = IsRelatedTo.NAME, description = "This is a dummy class for IsRelatedTo", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = IsRelatedTo.NAME, description = "This is a dummy type for IsRelatedTo", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) public class DummyIsRelatedTo extends IsRelatedToImpl implements IsRelatedTo{ diff --git a/src/main/java/org/gcube/informationsystem/types/impl/properties/PropertyDefinitionImpl.java b/src/main/java/org/gcube/informationsystem/types/impl/properties/PropertyDefinitionImpl.java index 19e43af..33d720e 100644 --- a/src/main/java/org/gcube/informationsystem/types/impl/properties/PropertyDefinitionImpl.java +++ b/src/main/java/org/gcube/informationsystem/types/impl/properties/PropertyDefinitionImpl.java @@ -156,12 +156,12 @@ public final class PropertyDefinitionImpl implements PropertyDefinition { } @Override - public String getType() { + public String getPropertyType() { return propertyTypeName.toString(); } - @JsonSetter(value = PropertyDefinition.TYPE_PROPERTY) - public void setType(String type) { + @JsonSetter(value = PropertyDefinition.PROPERTY_TYPE_PROPERTY) + public void setPropertyType(String type) { this.propertyTypeName = new PropertyTypeName(type); } diff --git a/src/main/java/org/gcube/informationsystem/types/reference/Type.java b/src/main/java/org/gcube/informationsystem/types/reference/Type.java index 09dab65..5b5ebf3 100644 --- a/src/main/java/org/gcube/informationsystem/types/reference/Type.java +++ b/src/main/java/org/gcube/informationsystem/types/reference/Type.java @@ -20,7 +20,7 @@ import org.gcube.informationsystem.utils.Version; */ @Abstract @JsonIgnoreProperties(ignoreUnknown=true) -@TypeMetadata(name = Type.NAME, description = "This is the base class to define any Type", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = Type.NAME, description = "This is the base type to define any Type", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) //@JsonDeserialize(as=TypeImpl.class) Do not uncomment to manage subclasses public interface Type extends IdentifiableElement { diff --git a/src/main/java/org/gcube/informationsystem/types/reference/entities/EntityType.java b/src/main/java/org/gcube/informationsystem/types/reference/entities/EntityType.java index 6a64b44..6692538 100644 --- a/src/main/java/org/gcube/informationsystem/types/reference/entities/EntityType.java +++ b/src/main/java/org/gcube/informationsystem/types/reference/entities/EntityType.java @@ -17,7 +17,7 @@ import org.gcube.informationsystem.utils.Version; */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonDeserialize(as = EntityTypeImpl.class) -@TypeMetadata(name = EntityType.NAME, description = "This class provides information for any EntityType", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = EntityType.NAME, description = "This type provides information for any EntityType", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) public interface EntityType extends Type, EntityElement { diff --git a/src/main/java/org/gcube/informationsystem/types/reference/entities/FacetType.java b/src/main/java/org/gcube/informationsystem/types/reference/entities/FacetType.java index 31bbd6d..d31396d 100644 --- a/src/main/java/org/gcube/informationsystem/types/reference/entities/FacetType.java +++ b/src/main/java/org/gcube/informationsystem/types/reference/entities/FacetType.java @@ -18,7 +18,7 @@ import org.gcube.informationsystem.utils.Version; */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonDeserialize(as = FacetTypeImpl.class) -@TypeMetadata(name = FacetType.NAME, description = "This class provides information for the definition of any FacetType", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = FacetType.NAME, description = "This type provides information for the definition of any FacetType", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) @Final public interface FacetType extends EntityType { diff --git a/src/main/java/org/gcube/informationsystem/types/reference/entities/ResourceType.java b/src/main/java/org/gcube/informationsystem/types/reference/entities/ResourceType.java index c0f56be..80284de 100644 --- a/src/main/java/org/gcube/informationsystem/types/reference/entities/ResourceType.java +++ b/src/main/java/org/gcube/informationsystem/types/reference/entities/ResourceType.java @@ -15,7 +15,7 @@ import org.gcube.informationsystem.utils.Version; * @author Luca Frosini (ISTI - CNR) */ @JsonDeserialize(as=ResourceTypeImpl.class) -@TypeMetadata(name = ResourceType.NAME, description = "This class provides information for the definition of any ResourceType", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = ResourceType.NAME, description = "This type provides information for the definition of any ResourceType", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) @Final public interface ResourceType extends EntityType { diff --git a/src/main/java/org/gcube/informationsystem/types/reference/properties/PropertyDefinition.java b/src/main/java/org/gcube/informationsystem/types/reference/properties/PropertyDefinition.java index 1e0e530..c203b95 100644 --- a/src/main/java/org/gcube/informationsystem/types/reference/properties/PropertyDefinition.java +++ b/src/main/java/org/gcube/informationsystem/types/reference/properties/PropertyDefinition.java @@ -15,7 +15,7 @@ import org.gcube.informationsystem.utils.Version; */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonDeserialize(as = PropertyDefinitionImpl.class) -@TypeMetadata(name = PropertyDefinition.NAME, description = "This class provides information for the definition of any properties", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = PropertyDefinition.NAME, description = "This type provides information for the definition of any properties", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) @Final public interface PropertyDefinition extends PropertyElement, Comparable { @@ -30,7 +30,7 @@ public interface PropertyDefinition extends PropertyElement, Comparable extends PropertyElement, Type { diff --git a/src/main/java/org/gcube/informationsystem/types/reference/relations/ConsistsOfType.java b/src/main/java/org/gcube/informationsystem/types/reference/relations/ConsistsOfType.java index ee02df4..440dd30 100644 --- a/src/main/java/org/gcube/informationsystem/types/reference/relations/ConsistsOfType.java +++ b/src/main/java/org/gcube/informationsystem/types/reference/relations/ConsistsOfType.java @@ -13,7 +13,7 @@ import org.gcube.informationsystem.utils.Version; * @author Luca Frosini (ISTI - CNR) */ @JsonDeserialize(as = ConsistsOfTypeImpl.class) -@TypeMetadata(name = ConsistsOfType.NAME, description = "This class provides information for any ConsistsOfType", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = ConsistsOfType.NAME, description = "This type provides information for any ConsistsOfType", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) @Final public interface ConsistsOfType extends RelationType { diff --git a/src/main/java/org/gcube/informationsystem/types/reference/relations/IsRelatedToType.java b/src/main/java/org/gcube/informationsystem/types/reference/relations/IsRelatedToType.java index b0cfc23..908e7b6 100644 --- a/src/main/java/org/gcube/informationsystem/types/reference/relations/IsRelatedToType.java +++ b/src/main/java/org/gcube/informationsystem/types/reference/relations/IsRelatedToType.java @@ -12,7 +12,7 @@ import org.gcube.informationsystem.utils.Version; * @author Luca Frosini (ISTI - CNR) */ @JsonDeserialize(as = IsRelatedToTypeImpl.class) -@TypeMetadata(name = IsRelatedToType.NAME, description = "This class provides information for any IsRelatedToType", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = IsRelatedToType.NAME, description = "This type provides information for any IsRelatedToType", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) @Final public interface IsRelatedToType extends RelationType { diff --git a/src/main/java/org/gcube/informationsystem/types/reference/relations/RelationType.java b/src/main/java/org/gcube/informationsystem/types/reference/relations/RelationType.java index b5ea814..7f8939e 100644 --- a/src/main/java/org/gcube/informationsystem/types/reference/relations/RelationType.java +++ b/src/main/java/org/gcube/informationsystem/types/reference/relations/RelationType.java @@ -19,7 +19,7 @@ import org.gcube.informationsystem.utils.Version; */ @JsonIgnoreProperties(ignoreUnknown = true) @JsonDeserialize(as = RelationTypeImpl.class) -@TypeMetadata(name = RelationType.NAME, description = "This class provides information for any RelationType", version = Version.MINIMAL_VERSION_STRING) +@TypeMetadata(name = RelationType.NAME, description = "This type provides information for any RelationType", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) public interface RelationType extends Type, RelationElement { diff --git a/src/test/java/org/gcube/informationsystem/discovery/DiscoveryTest.java b/src/test/java/org/gcube/informationsystem/discovery/DiscoveryTest.java index 2dbc402..8f0910a 100644 --- a/src/test/java/org/gcube/informationsystem/discovery/DiscoveryTest.java +++ b/src/test/java/org/gcube/informationsystem/discovery/DiscoveryTest.java @@ -82,7 +82,7 @@ public class DiscoveryTest { for(PropertyDefinition propertyDefinition : type.getProperties()) { if(propertyDefinition.getName().compareTo(PropertyType.PROPERTIES_PROPERTY)==0) { logger.debug("{}", propertyDefinition); - Assert.assertTrue(propertyDefinition.getType().compareTo("Set")==0); + Assert.assertTrue(propertyDefinition.getPropertyType().compareTo("Set")==0); } } String typeDefinitionJsonString = TypeMapper.serializeTypeDefinition(type); diff --git a/src/test/java/org/gcube/informationsystem/model/impl/properties/MetadataTest.java b/src/test/java/org/gcube/informationsystem/model/impl/properties/MetadataTest.java index 8b4349c..038ffb3 100644 --- a/src/test/java/org/gcube/informationsystem/model/impl/properties/MetadataTest.java +++ b/src/test/java/org/gcube/informationsystem/model/impl/properties/MetadataTest.java @@ -7,6 +7,7 @@ import java.util.Map; import org.gcube.com.fasterxml.jackson.core.JsonParseException; import org.gcube.com.fasterxml.jackson.databind.JsonMappingException; +import org.gcube.informationsystem.base.reference.Element; import org.gcube.informationsystem.model.reference.properties.Metadata; import org.gcube.informationsystem.model.reference.properties.Property; import org.gcube.informationsystem.serialization.ElementMapper; @@ -53,7 +54,7 @@ public class MetadataTest { String metadataJson = "{" - + "\"@class\":\"Metadata\"," + + "\"" + Element.CLASS_PROPERTY + "\":\"Metadata\"," + "\"createdBy\":\"UNKNOWN_USER\"," + "\"lastUpdateBy\":\"UNKNOWN_USER\"," + "\"creationTime\":\"2020-11-09 10:01:25.415 +0000\"," diff --git a/src/test/java/org/gcube/informationsystem/types/SerializationTest.java b/src/test/java/org/gcube/informationsystem/types/SerializationTest.java index 1c2f78f..893f8d1 100644 --- a/src/test/java/org/gcube/informationsystem/types/SerializationTest.java +++ b/src/test/java/org/gcube/informationsystem/types/SerializationTest.java @@ -1,6 +1,7 @@ package org.gcube.informationsystem.types; import org.gcube.informationsystem.base.reference.AccessType; +import org.gcube.informationsystem.base.reference.Element; import org.gcube.informationsystem.base.reference.entities.EntityElement; import org.gcube.informationsystem.base.reference.properties.PropertyElement; import org.gcube.informationsystem.contexts.reference.entities.Context; @@ -8,10 +9,10 @@ import org.gcube.informationsystem.contexts.reference.relations.IsParentOf; import org.gcube.informationsystem.model.reference.entities.Entity; import org.gcube.informationsystem.model.reference.entities.Facet; import org.gcube.informationsystem.model.reference.entities.Resource; +import org.gcube.informationsystem.model.reference.properties.Encrypted; import org.gcube.informationsystem.model.reference.properties.Metadata; import org.gcube.informationsystem.model.reference.properties.PropagationConstraint; import org.gcube.informationsystem.model.reference.properties.Property; -import org.gcube.informationsystem.model.reference.properties.Encrypted; import org.gcube.informationsystem.model.reference.relations.ConsistsOf; import org.gcube.informationsystem.model.reference.relations.IsRelatedTo; import org.gcube.informationsystem.model.reference.relations.Relation; @@ -206,7 +207,7 @@ public class SerializationTest { logger.debug("Version {}", typeVersion.toString()); logger.info(ElementMapper.marshal(propertyType)); - String json = "{\"@class\":\"PropertyType\",\"metadata\":null,\"name\":\"Metadata\",\"description\":\"This class provides metadata per every IdentifiableElement\",\"superClasses\":[\"Property\"],\"properties\":[{\"@class\":\"PropertyDefinition\",\"name\":\"creationTime\",\"description\":\"Creation time. It represents the difference, measured in milliseconds, between the creation time and midnight, January 1, 1970, UTC.\",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"Date\"},{\"@class\":\"PropertyDefinition\",\"name\":\"lastUpdateTime\",\"description\":\"Last Update time. At creation time it assumes the same value of creationTime. It represents the difference, measured in milliseconds, between the creation time and midnight, January 1, 1970, UTC.\",\"mandatory\":true,\"readonly\":false,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"Date\"},{\"@class\":\"PropertyDefinition\",\"name\":\"createdBy\",\"description\":\"The user that created the Entity or the Relation. It is initialized at creation time. \",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"String\"},{\"@class\":\"PropertyDefinition\",\"name\":\"uuid\",\"description\":\"This UUID is be used to identify the Entity or the Relation univocally.\",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":\"^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}){1}$\",\"type\":\"String\"},{\"@class\":\"PropertyDefinition\",\"name\":\"lastUpdateBy\",\"description\":\"The user that made the last update to the Entity or the Relation. At creation time, it assumes the same value of creator.\",\"mandatory\":true,\"readonly\":false,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"String\"}],\"accessType\":\"PROPERTY\",\"abstract\":false,\"version\":\"1.0.0\",\"changelog\":{\"1.0.0\":\"First Version\"}}"; + String json = "{\"" + Element.CLASS_PROPERTY + "\":\"PropertyType\",\"metadata\":null,\"name\":\"Metadata\",\"description\":\"This class provides metadata per every IdentifiableElement\",\"superClasses\":[\"Property\"],\"properties\":[{\"" + Element.CLASS_PROPERTY + "\":\"PropertyDefinition\",\"name\":\"creationTime\",\"description\":\"Creation time. It represents the difference, measured in milliseconds, between the creation time and midnight, January 1, 1970, UTC.\",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"propertyType\":\"Date\"},{\"" + Element.CLASS_PROPERTY + "\":\"PropertyDefinition\",\"name\":\"lastUpdateTime\",\"description\":\"Last Update time. At creation time it assumes the same value of creationTime. It represents the difference, measured in milliseconds, between the creation time and midnight, January 1, 1970, UTC.\",\"mandatory\":true,\"readonly\":false,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"propertyType\":\"Date\"},{\"" + Element.CLASS_PROPERTY + "\":\"PropertyDefinition\",\"name\":\"createdBy\",\"description\":\"The user that created the Entity or the Relation. It is initialized at creation time. \",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"propertyType\":\"String\"},{\"" + Element.CLASS_PROPERTY + "\":\"PropertyDefinition\",\"name\":\"uuid\",\"description\":\"This UUID is be used to identify the Entity or the Relation univocally.\",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":\"^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}){1}$\",\"propertyType\":\"String\"},{\"" + Element.CLASS_PROPERTY + "\":\"PropertyDefinition\",\"name\":\"lastUpdateBy\",\"description\":\"The user that made the last update to the Entity or the Relation. At creation time, it assumes the same value of creator.\",\"mandatory\":true,\"readonly\":false,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"propertyType\":\"String\"}],\"accessType\":\"PROPERTY\",\"abstract\":false,\"version\":\"1.0.0\",\"changelog\":{\"1.0.0\":\"First Version\"}}"; logger.info(json); @SuppressWarnings("unchecked") PropertyType metadataType = (PropertyType) TypeMapper.deserializeTypeDefinition(json); diff --git a/src/test/resources/queryTemplates/queryTemplate1.json b/src/test/resources/queryTemplates/queryTemplate1.json index e4759bf..0e718cf 100644 --- a/src/test/resources/queryTemplates/queryTemplate1.json +++ b/src/test/resources/queryTemplates/queryTemplate1.json @@ -1,20 +1,20 @@ { - "@class": "EService", + "type": "EService", "consistsOf": [ { - "@class": "ConsistsOf", + "type": "ConsistsOf", "propagationConstraint" : { "add": "propagate" }, "target": { - "@class": "StateFacet", + "type": "StateFacet", "value": "$state" } }, { - "@class": "IsIdentifiedBy", + "type": "IsIdentifiedBy", "target": { - "@class": "SoftwareFacet", + "type": "SoftwareFacet", "name": "$name", "group": "$group" }