From ccb259432f8b5c72937a895d1aefc502a2194261 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Thu, 4 May 2023 18:08:30 +0200 Subject: [PATCH] Added id as first member in serialization --- .../informationsystem/base/reference/IdentifiableElement.java | 2 +- .../base/reference/entities/EntityElement.java | 2 +- .../org/gcube/informationsystem/model/reference/ERElement.java | 2 +- .../informationsystem/model/reference/entities/Entity.java | 2 +- .../informationsystem/model/reference/entities/Resource.java | 2 +- .../informationsystem/model/reference/relations/Relation.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/gcube/informationsystem/base/reference/IdentifiableElement.java b/src/main/java/org/gcube/informationsystem/base/reference/IdentifiableElement.java index a2c65ff..422a717 100644 --- a/src/main/java/org/gcube/informationsystem/base/reference/IdentifiableElement.java +++ b/src/main/java/org/gcube/informationsystem/base/reference/IdentifiableElement.java @@ -12,7 +12,7 @@ import org.gcube.informationsystem.model.reference.properties.Metadata; * * @author Luca Frosini (ISTI - CNR) */ -@JsonPropertyOrder({ Element.TYPE_PROPERTY, Element.SUPERTYPES_PROPERTY, Element.EXPECTED_TYPE_PROPERTY, IdentifiableElement.ID_PROPERTY, IdentifiableElement.METADATA_PROPERTY }) +@JsonPropertyOrder({ IdentifiableElement.ID_PROPERTY, Element.TYPE_PROPERTY, Element.SUPERTYPES_PROPERTY, Element.EXPECTED_TYPE_PROPERTY, IdentifiableElement.METADATA_PROPERTY }) public interface IdentifiableElement extends Element { public static final String ID_PROPERTY = "id"; 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 27755c6..f293c4c 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 @@ -18,7 +18,7 @@ import org.gcube.informationsystem.utils.Version; */ @Abstract @JsonIgnoreProperties(ignoreUnknown=true) -@JsonPropertyOrder({ Element.TYPE_PROPERTY, Element.SUPERTYPES_PROPERTY, Element.EXPECTED_TYPE_PROPERTY, IdentifiableElement.ID_PROPERTY, IdentifiableElement.METADATA_PROPERTY }) +@JsonPropertyOrder({ IdentifiableElement.ID_PROPERTY, Element.TYPE_PROPERTY, Element.SUPERTYPES_PROPERTY, Element.EXPECTED_TYPE_PROPERTY, IdentifiableElement.METADATA_PROPERTY }) //@JsonDeserialize(as=EntityElementImpl.class) Do not uncomment to manage subclasses @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) diff --git a/src/main/java/org/gcube/informationsystem/model/reference/ERElement.java b/src/main/java/org/gcube/informationsystem/model/reference/ERElement.java index 09a0e50..3965179 100644 --- a/src/main/java/org/gcube/informationsystem/model/reference/ERElement.java +++ b/src/main/java/org/gcube/informationsystem/model/reference/ERElement.java @@ -16,7 +16,7 @@ import org.gcube.informationsystem.base.reference.IdentifiableElement; * * @author Luca Frosini (ISTI - CNR) */ -@JsonPropertyOrder({ Element.TYPE_PROPERTY, Element.SUPERTYPES_PROPERTY, Element.EXPECTED_TYPE_PROPERTY, IdentifiableElement.ID_PROPERTY, IdentifiableElement.METADATA_PROPERTY, ERElement.CONTEXTS_PROPERTY }) +@JsonPropertyOrder({ IdentifiableElement.ID_PROPERTY, Element.TYPE_PROPERTY, Element.SUPERTYPES_PROPERTY, Element.EXPECTED_TYPE_PROPERTY, IdentifiableElement.METADATA_PROPERTY, ERElement.CONTEXTS_PROPERTY }) public interface ERElement extends IdentifiableElement { /** diff --git a/src/main/java/org/gcube/informationsystem/model/reference/entities/Entity.java b/src/main/java/org/gcube/informationsystem/model/reference/entities/Entity.java index 66c7189..38ca262 100644 --- a/src/main/java/org/gcube/informationsystem/model/reference/entities/Entity.java +++ b/src/main/java/org/gcube/informationsystem/model/reference/entities/Entity.java @@ -19,7 +19,7 @@ import org.gcube.informationsystem.utils.Version; * @author Luca Frosini (ISTI - CNR) */ @Abstract -@JsonPropertyOrder({ Element.TYPE_PROPERTY, Element.SUPERTYPES_PROPERTY, Element.EXPECTED_TYPE_PROPERTY, IdentifiableElement.ID_PROPERTY, IdentifiableElement.METADATA_PROPERTY, ERElement.CONTEXTS_PROPERTY }) +@JsonPropertyOrder({ IdentifiableElement.ID_PROPERTY, Element.TYPE_PROPERTY, Element.SUPERTYPES_PROPERTY, Element.EXPECTED_TYPE_PROPERTY, IdentifiableElement.METADATA_PROPERTY, ERElement.CONTEXTS_PROPERTY }) //@JsonDeserialize(as=EntityImpl.class) Do not uncomment to manage subclasses @TypeMetadata(name = Entity.NAME, description = "This is the base type for any Entity", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION) diff --git a/src/main/java/org/gcube/informationsystem/model/reference/entities/Resource.java b/src/main/java/org/gcube/informationsystem/model/reference/entities/Resource.java index 7742dd8..babbdcc 100644 --- a/src/main/java/org/gcube/informationsystem/model/reference/entities/Resource.java +++ b/src/main/java/org/gcube/informationsystem/model/reference/entities/Resource.java @@ -29,7 +29,7 @@ import org.gcube.informationsystem.utils.Version; */ @Abstract @JsonIgnoreProperties(ignoreUnknown=true) -@JsonPropertyOrder({ Element.TYPE_PROPERTY, Element.SUPERTYPES_PROPERTY, Element.EXPECTED_TYPE_PROPERTY, IdentifiableElement.ID_PROPERTY, IdentifiableElement.METADATA_PROPERTY, ERElement.CONTEXTS_PROPERTY, Resource.CONSISTS_OF_PROPERTY, Resource.IS_RELATED_TO_PROPERTY }) +@JsonPropertyOrder({ IdentifiableElement.ID_PROPERTY, Element.TYPE_PROPERTY, Element.SUPERTYPES_PROPERTY, Element.EXPECTED_TYPE_PROPERTY, IdentifiableElement.METADATA_PROPERTY, ERElement.CONTEXTS_PROPERTY, Resource.CONSISTS_OF_PROPERTY, Resource.IS_RELATED_TO_PROPERTY }) // @JsonDeserialize(as=ResourceImpl.class) Do not uncomment to manage subclasses @ResourceSchema( facets={ diff --git a/src/main/java/org/gcube/informationsystem/model/reference/relations/Relation.java b/src/main/java/org/gcube/informationsystem/model/reference/relations/Relation.java index 8d6d494..8e0cee3 100644 --- a/src/main/java/org/gcube/informationsystem/model/reference/relations/Relation.java +++ b/src/main/java/org/gcube/informationsystem/model/reference/relations/Relation.java @@ -35,7 +35,7 @@ import org.gcube.informationsystem.utils.Version; * https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Relation */ @Abstract -@JsonPropertyOrder({ Element.TYPE_PROPERTY, Element.SUPERTYPES_PROPERTY, Element.EXPECTED_TYPE_PROPERTY, IdentifiableElement.ID_PROPERTY, IdentifiableElement.METADATA_PROPERTY, ERElement.CONTEXTS_PROPERTY, Relation.PROPAGATION_CONSTRAINT_PROPERTY }) +@JsonPropertyOrder({ IdentifiableElement.ID_PROPERTY, Element.TYPE_PROPERTY, Element.SUPERTYPES_PROPERTY, Element.EXPECTED_TYPE_PROPERTY, IdentifiableElement.METADATA_PROPERTY, ERElement.CONTEXTS_PROPERTY, Relation.PROPAGATION_CONSTRAINT_PROPERTY }) // @JsonDeserialize(as=RelationImpl.class) Do not uncomment to manage subclasses @TypeMetadata(name = Relation.NAME, description = "This is the base type for any Relation", version = Version.MINIMAL_VERSION_STRING) @Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)