From 656761907782aca7219ecc680bc101f87bed51c4 Mon Sep 17 00:00:00 2001 From: "Aggarwal Sahil (BCI/ESW17)" Date: Wed, 9 Aug 2023 12:42:01 +0200 Subject: [PATCH 1/4] refactored models for changes required --- .../registry/mapper/ShellMapper.java | 15 - .../registry/mapper/SubmodelMapper.java | 24 - .../semantics/registry/model/Shell.java | 12 - .../registry/model/ShellExtension.java | 70 - .../ShellExtensionRefersToReference.java | 54 - .../ShellExtensionRefersToReferenceKey.java | 53 - ...ShellExtensionRefersToReferenceParent.java | 50 - .../ShellExtensionSemanticIdReference.java | 54 - .../ShellExtensionSemanticIdReferenceKey.java | 53 - ...ellExtensionSemanticIdReferenceParent.java | 50 - ...llExtensionSupplemSemanticIdReference.java | 52 - ...xtensionSupplemSemanticIdReferenceKey.java | 54 - ...nsionSupplemSemanticIdReferenceParent.java | 50 - ...ellIdentifierExternalSubjectReference.java | 4 - ...IdentifierExternalSubjectReferenceKey.java | 5 - ...ntifierExternalSubjectReferenceParent.java | 50 - .../ShellIdentifierSemanticReference.java | 4 - .../ShellIdentifierSemanticReferenceKey.java | 4 - ...hellIdentifierSemanticReferenceParent.java | 50 - ...ellIdentifierSupplemSemanticReference.java | 4 - ...IdentifierSupplemSemanticReferenceKey.java | 4 - ...ntifierSupplemSemanticReferenceParent.java | 50 - .../semantics/registry/model/Submodel.java | 12 - .../registry/model/SubmodelExtension.java | 66 - .../SubmodelExtensionRefersToReference.java | 58 - ...SubmodelExtensionRefersToReferenceKey.java | 54 - ...modelExtensionRefersToReferenceParent.java | 53 - .../SubmodelExtensionSemanticIdReference.java | 58 - ...bmodelExtensionSemanticIdReferenceKey.java | 54 - ...delExtensionSemanticIdReferenceParent.java | 52 - ...elExtensionSupplemSemanticIdReference.java | 58 - ...xtensionSupplemSemanticIdReferenceKey.java | 54 - ...nsionSupplemSemanticIdReferenceParent.java | 52 - .../model/SubmodelSemanticIdReference.java | 5 - .../model/SubmodelSemanticIdReferenceKey.java | 5 - .../SubmodelSemanticIdReferenceParent.java | 55 - .../SubmodelSupplemSemanticIdReference.java | 7 +- ...SubmodelSupplemSemanticIdReferenceKey.java | 5 - ...modelSupplemSemanticIdReferenceParent.java | 55 - .../registry/service/ShellService.java | 97 -- .../db/changelog/db.changelog-master.yaml | 3 - .../db/changelog/db.changelog-v2.yaml | 355 +++-- .../db/changelog/db.changelog-v3.yaml | 1236 ----------------- .../tractusx/semantics/registry/TestUtil.java | 131 +- .../registry/mapper/ShellMapperTest.java | 203 +-- 45 files changed, 261 insertions(+), 3233 deletions(-) delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtension.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionRefersToReference.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionRefersToReferenceKey.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionRefersToReferenceParent.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSemanticIdReference.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSemanticIdReferenceKey.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSemanticIdReferenceParent.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSupplemSemanticIdReference.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSupplemSemanticIdReferenceKey.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSupplemSemanticIdReferenceParent.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierExternalSubjectReferenceParent.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSemanticReferenceParent.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSupplemSemanticReferenceParent.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtension.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionRefersToReference.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionRefersToReferenceKey.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionRefersToReferenceParent.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSemanticIdReference.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSemanticIdReferenceKey.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSemanticIdReferenceParent.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSupplemSemanticIdReference.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSupplemSemanticIdReferenceKey.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSupplemSemanticIdReferenceParent.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSemanticIdReferenceParent.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSupplemSemanticIdReferenceParent.java delete mode 100644 backend/src/main/resources/db/changelog/db.changelog-v3.yaml diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/mapper/ShellMapper.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/mapper/ShellMapper.java index edc78e5e..59828766 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/mapper/ShellMapper.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/mapper/ShellMapper.java @@ -45,7 +45,6 @@ public interface ShellMapper { @Mapping(target = "shellKind", source = "assetKind"), @Mapping(target = "id", ignore = true), @Mapping(target = "displayNames", source = "displayName"), - @Mapping(target = "shellExtensions", source = "extensions"), }) Shell fromApiDto(AssetAdministrationShellDescriptor apiDto); @@ -67,19 +66,6 @@ public interface ShellMapper { ShellIdentifierExternalSubjectReference maptoShellIdentifierExternalSubjectReference ( Reference externalSubjectId ); - @Mappings({ - @Mapping(target = "supplementalSemanticIds", source = "supplementalSemanticIds"), - @Mapping(target = "semanticId", source = "semanticId"), - @Mapping(target = "refersTo", source = "refersTo"), - }) - ShellExtension fromApiDto( Extension apiDto); - - ShellExtensionSupplemSemanticIdReference maptoShellExtensionSupplemSemanticReference ( Reference supplementalSemanticId ); - - ShellExtensionSemanticIdReference maptoShellExtensionSemanticReference ( Reference semanticId ); - - ShellExtensionRefersToReference maptoShellExtensionRefersToReference ( Reference refersTo ); - Set fromApiDto(List apiDto); @Mappings({ @@ -93,7 +79,6 @@ public interface ShellMapper { @Mapping(source = "descriptions", target = "description"), @Mapping(source = "submodels", target = "submodelDescriptors"), @Mapping(source = "displayNames", target = "displayName"), - @Mapping(source = "shellExtensions", target = "extensions"), }) @InheritInverseConfiguration AssetAdministrationShellDescriptor toApiDto(Shell shell); diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/mapper/SubmodelMapper.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/mapper/SubmodelMapper.java index 2c638a74..8881532a 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/mapper/SubmodelMapper.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/mapper/SubmodelMapper.java @@ -43,23 +43,12 @@ public interface SubmodelMapper { @Mapping(target="semanticId", source = "semanticId"), @Mapping(target = "id", ignore = true), @Mapping(target = "displayNames", source = "displayName"), - @Mapping(target = "submodelExtensions", source = "extensions"), @Mapping(target = "submodelSupplemSemanticIds", source = "supplementalSemanticId") }) Submodel fromApiDto(SubmodelDescriptor apiDto); SubmodelDescription mapShellDescription (LangStringTextType description); - @Mappings({ - @Mapping(target="submodSemanticId", source = "semanticId"), - @Mapping(target="submodSupplementalIds", source = "supplementalSemanticIds"), - @Mapping(target="name", source = "name"), - @Mapping(target="valueType", source = "valueType"), - @Mapping(target="value", source = "value"), - @Mapping(target="refersTo", source = "refersTo") - }) - SubmodelExtension mapSubmodelExtension (Extension submodelExtensions); - @Mappings({ @Mapping(target="interfaceName", source = "interface"), @Mapping(target="endpointAddress", source = "protocolInformation.href"), @@ -103,19 +92,6 @@ default List protocolVersionDescriptor(String version){ LangStringTextType mapSubModelDescription (SubmodelDescription description); - @Mappings({ - @Mapping(source = "submodelExtensions", target = "extensions"), - }) @InheritInverseConfiguration List toApiDto( Set submodels ); - - @Mappings({ - @Mapping(source="submodSemanticId", target = "semanticId"), - @Mapping(source="submodSupplementalIds", target = "supplementalSemanticIds"), - @Mapping(source="name", target = "name"), - @Mapping(source="valueType", target = "valueType"), - @Mapping(source="value", target = "value"), - @Mapping(source="refersTo", target = "refersTo") - }) - Extension mapExtension (SubmodelExtension submodelExtension); } diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/Shell.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/Shell.java index b6f16fe5..2c10f0dc 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/Shell.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/Shell.java @@ -79,18 +79,6 @@ public class Shell { private ShellKind shellKind; private String shellType; - @JsonManagedReference - @OneToMany(cascade = CascadeType.ALL, mappedBy = "shellId") - Set shellExtensions= new HashSet<>(); - - public void setShellExtensions(Set shellExtensions) { - if(shellExtensions==null) {shellExtensions = new HashSet<>();} - this.shellExtensions = shellExtensions; - for(ShellExtension s : shellExtensions) { - s.setShellId(this); - } - } - public void setDisplayNames(Set displayNames) { if(displayNames==null) {displayNames = new HashSet<>();} this.displayNames = displayNames; diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtension.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtension.java deleted file mode 100644 index d8f8f0b1..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtension.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; - -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonIdentityInfo; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import com.fasterxml.jackson.annotation.ObjectIdGenerators; - -import jakarta.persistence.*; -import lombok.*; - - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -@JsonIdentityInfo( - generator = ObjectIdGenerators.PropertyGenerator.class, - property = "id") -public class ShellExtension { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - UUID id; - String name; - @Column(name = "shell_ext_value") - String value; - DataTypeXsd valueType; - - @JsonManagedReference - @OneToOne(cascade = CascadeType.ALL, mappedBy = "shellExtension") - ShellExtensionSemanticIdReference semanticId; - - @JsonManagedReference - @OneToMany(cascade = CascadeType.ALL, mappedBy = "shellExtension") - Set supplementalSemanticIds; - - @JsonManagedReference - @OneToMany(cascade = CascadeType.ALL, mappedBy = "shellExtension") - Set refersTo; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_shell_id") - private Shell shellId; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionRefersToReference.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionRefersToReference.java deleted file mode 100644 index 4ec7edea..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionRefersToReference.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class ShellExtensionRefersToReference { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - UUID id; - ReferenceType type; - - @JsonManagedReference - @OneToMany(cascade = CascadeType.ALL, mappedBy = "shellExtensionRefersToReference") - Set keys; - - @JsonManagedReference - @OneToOne(cascade = CascadeType.ALL, mappedBy = "shellExtensionRefersToReference") - ShellExtensionRefersToReferenceParent referredSemanticId; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_shell_ext_refers_id") - private ShellExtension shellExtension; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionRefersToReferenceKey.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionRefersToReferenceKey.java deleted file mode 100644 index b4b37e2f..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionRefersToReferenceKey.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class ShellExtensionRefersToReferenceKey { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - UUID id; - ReferenceKeyType type; - @Column(name = "ref_key_value") - String value; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_shell_extension_refers_reference_id") - private ShellExtensionRefersToReference shellExtensionRefersToReference; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_reference_parent_id") - private ShellExtensionRefersToReferenceParent shellExtensionRefersToReferenceParent; -} - - diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionRefersToReferenceParent.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionRefersToReferenceParent.java deleted file mode 100644 index 0f538f40..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionRefersToReferenceParent.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class ShellExtensionRefersToReferenceParent { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - UUID id; - ReferenceType type; - - @JsonManagedReference - @OneToMany(cascade = CascadeType.ALL, mappedBy = "shellExtensionRefersToReferenceParent") - Set keys; - - @JsonBackReference - @OneToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_shell_extension_refers_referred_id") - private ShellExtensionRefersToReference shellExtensionRefersToReference; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSemanticIdReference.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSemanticIdReference.java deleted file mode 100644 index 3e4f345d..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSemanticIdReference.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class ShellExtensionSemanticIdReference { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - UUID id; - private ReferenceType type; - - @JsonManagedReference - @OneToMany(cascade = CascadeType.ALL, mappedBy = "shellExtensionSemanticIdReference") - private Set keys; - - @JsonManagedReference - @OneToOne(cascade = CascadeType.ALL, mappedBy = "shellExtensionSemanticIdReference") - private ShellExtensionSemanticIdReferenceParent referredSemanticId; - - @JsonBackReference - @OneToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_shell_ext_semantic_id") - private ShellExtension shellExtension; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSemanticIdReferenceKey.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSemanticIdReferenceKey.java deleted file mode 100644 index 6ea75aa3..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSemanticIdReferenceKey.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class ShellExtensionSemanticIdReferenceKey { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - UUID id; - private ReferenceKeyType type; - @Column(name = "ref_key_value") - private String value; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_shell_extension_semantic_reference_id") - private ShellExtensionSemanticIdReference shellExtensionSemanticIdReference; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_reference_parent_id") - private ShellExtensionSemanticIdReferenceParent shellExtensionSemanticIdReferenceParent; -} - - diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSemanticIdReferenceParent.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSemanticIdReferenceParent.java deleted file mode 100644 index 599dbec9..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSemanticIdReferenceParent.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class ShellExtensionSemanticIdReferenceParent { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - UUID id; - private ReferenceType type; - - @JsonManagedReference - @OneToMany(cascade = CascadeType.ALL, mappedBy = "shellExtensionSemanticIdReferenceParent") - private Set keys; - - @JsonBackReference - @OneToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "fk_shell_extension_semantic_referred_id") - private ShellExtensionSemanticIdReference shellExtensionSemanticIdReference; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSupplemSemanticIdReference.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSupplemSemanticIdReference.java deleted file mode 100644 index 5618d398..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSupplemSemanticIdReference.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class ShellExtensionSupplemSemanticIdReference { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - UUID id; - ReferenceType type; - @JsonManagedReference - @OneToMany(cascade = CascadeType.ALL, mappedBy = "shellExtensionSupplemSemanticIdReference") - Set keys; - - @OneToOne(cascade = CascadeType.ALL, mappedBy = "shellExtensionSupplemSemanticIdReference") - ShellExtensionSupplemSemanticIdReferenceParent referredSemanticId; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_shell_ext_supplemental_id") - private ShellExtension shellExtension; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSupplemSemanticIdReferenceKey.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSupplemSemanticIdReferenceKey.java deleted file mode 100644 index 621b1659..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSupplemSemanticIdReferenceKey.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.UUID; - -import com.fasterxml.jackson.annotation.JsonBackReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class ShellExtensionSupplemSemanticIdReferenceKey { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - UUID id; - ReferenceKeyType type; - @Column(name="ref_key_value") - String value; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_shell_extension_supplem_semantic_reference_id") - private ShellExtensionSupplemSemanticIdReference shellExtensionSupplemSemanticIdReference; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_reference_parent_id") - private ShellExtensionSupplemSemanticIdReferenceParent shellExtensionSupplemSemanticIdReferenceParent; -} - - diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSupplemSemanticIdReferenceParent.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSupplemSemanticIdReferenceParent.java deleted file mode 100644 index 0e0ac2f5..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellExtensionSupplemSemanticIdReferenceParent.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; - -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class ShellExtensionSupplemSemanticIdReferenceParent { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - UUID id; - ReferenceType type; - @JsonManagedReference - @OneToMany(cascade = CascadeType.ALL, mappedBy = "shellExtensionSupplemSemanticIdReferenceParent") - Set keys; - - @JsonBackReference - @OneToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_shell_extension_supplem_semantic_referred_id") - private ShellExtensionSupplemSemanticIdReference shellExtensionSupplemSemanticIdReference; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierExternalSubjectReference.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierExternalSubjectReference.java index d5e723a1..a8c6b7b3 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierExternalSubjectReference.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierExternalSubjectReference.java @@ -43,10 +43,6 @@ public class ShellIdentifierExternalSubjectReference { @OneToMany(cascade = CascadeType.ALL, mappedBy = "shellIdentifierExternalSubjectReference") private Set keys; - @JsonManagedReference - @OneToOne(cascade = CascadeType.ALL, mappedBy = "shellIdentifierExternalSubjectReference") - private ShellIdentifierExternalSubjectReferenceParent referredSemanticId; - @JsonBackReference @OneToOne(fetch = FetchType.LAZY, optional = false) @JoinColumn(name = "fk_shell_identifier_external_subject_id") diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierExternalSubjectReferenceKey.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierExternalSubjectReferenceKey.java index 56f21516..18a835e4 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierExternalSubjectReferenceKey.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierExternalSubjectReferenceKey.java @@ -43,11 +43,6 @@ public class ShellIdentifierExternalSubjectReferenceKey { @ManyToOne(fetch = FetchType.LAZY, optional = false) @JoinColumn(name = "fk_si_external_subject_reference_id") private ShellIdentifierExternalSubjectReference shellIdentifierExternalSubjectReference; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY, optional = false) - @JoinColumn(name = "fk_reference_parent_id") - private ShellIdentifierExternalSubjectReferenceParent shellIdentifierExternalSubjectReferenceParent; } diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierExternalSubjectReferenceParent.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierExternalSubjectReferenceParent.java deleted file mode 100644 index 7a94bbe8..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierExternalSubjectReferenceParent.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class ShellIdentifierExternalSubjectReferenceParent { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - UUID id; - ReferenceType type; - - @JsonManagedReference - @OneToMany(cascade = CascadeType.ALL, mappedBy = "shellIdentifierExternalSubjectReferenceParent") - Set keys; - - @JsonBackReference - @OneToOne(fetch = FetchType.LAZY, optional = false) - @JoinColumn(name = "fk_si_external_subject_referred_semantic_id") - private ShellIdentifierExternalSubjectReference shellIdentifierExternalSubjectReference; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSemanticReference.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSemanticReference.java index 29a5d8c6..46d4aac5 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSemanticReference.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSemanticReference.java @@ -43,10 +43,6 @@ public class ShellIdentifierSemanticReference { @OneToMany(cascade = CascadeType.ALL, mappedBy = "shellIdentifierSemanticReference") Set keys; - @JsonManagedReference - @OneToOne(cascade = CascadeType.ALL, mappedBy = "shellIdentifierSemanticReference") - ShellIdentifierSemanticReferenceParent referredSemanticId; - @JsonBackReference @OneToOne(fetch = FetchType.LAZY, optional = false) @JoinColumn(name = "fk_shell_identifier_semantic_id") diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSemanticReferenceKey.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSemanticReferenceKey.java index 2767cfc5..0c3b7a1d 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSemanticReferenceKey.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSemanticReferenceKey.java @@ -45,10 +45,6 @@ public class ShellIdentifierSemanticReferenceKey { @JoinColumn(name = "fk_sis_reference_id") private ShellIdentifierSemanticReference shellIdentifierSemanticReference; - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY, optional = false) - @JoinColumn(name = "fk_reference_parent_id") - private ShellIdentifierSemanticReferenceParent shellIdentifierSemanticReferenceParent; } diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSemanticReferenceParent.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSemanticReferenceParent.java deleted file mode 100644 index d4805013..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSemanticReferenceParent.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class ShellIdentifierSemanticReferenceParent { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name="id") - UUID id; - ReferenceType type; - @JsonManagedReference - @OneToMany(cascade = CascadeType.ALL, mappedBy = "shellIdentifierSemanticReferenceParent") - Set keys; - - @JsonBackReference - @OneToOne(fetch = FetchType.LAZY, optional = false) - @JoinColumn(name = "fk_sis_referred_semantic_id") - private ShellIdentifierSemanticReference shellIdentifierSemanticReference; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSupplemSemanticReference.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSupplemSemanticReference.java index 6cef40ad..1cbd550d 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSupplemSemanticReference.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSupplemSemanticReference.java @@ -42,10 +42,6 @@ public class ShellIdentifierSupplemSemanticReference { @OneToMany(cascade = CascadeType.ALL, mappedBy = "shellIdentifierSupplemSemanticReference") Set keys; - @JsonManagedReference - @OneToOne(cascade = CascadeType.ALL, mappedBy = "shellIdentifierSupplemSemanticReference") - ShellIdentifierSupplemSemanticReferenceParent referredSemanticId; - @JsonBackReference @ManyToOne(fetch = FetchType.LAZY, optional = false) @JoinColumn(name = "fk_shell_identifier_supplem_semantic_id") diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSupplemSemanticReferenceKey.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSupplemSemanticReferenceKey.java index 1d7a14bf..294667ec 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSupplemSemanticReferenceKey.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSupplemSemanticReferenceKey.java @@ -44,10 +44,6 @@ public class ShellIdentifierSupplemSemanticReferenceKey { @JoinColumn(name = "fk_reference_id") private ShellIdentifierSupplemSemanticReference shellIdentifierSupplemSemanticReference; - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY, optional = false) - @JoinColumn(name = "fk_reference_parent_id") - private ShellIdentifierSupplemSemanticReferenceParent shellIdentifierSupplemSemanticReferenceParent; } diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSupplemSemanticReferenceParent.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSupplemSemanticReferenceParent.java deleted file mode 100644 index 8817979d..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/ShellIdentifierSupplemSemanticReferenceParent.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class ShellIdentifierSupplemSemanticReferenceParent { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - UUID id; - ReferenceType type; - - @JsonManagedReference - @OneToMany(cascade = CascadeType.ALL, mappedBy = "shellIdentifierSupplemSemanticReferenceParent") - Set keys; - - @JsonBackReference - @OneToOne(fetch = FetchType.LAZY, optional = false) - @JoinColumn(name = "fk_referred_semantic_id") - private ShellIdentifierSupplemSemanticReference shellIdentifierSupplemSemanticReference; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/Submodel.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/Submodel.java index 47fa14c2..73ead12e 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/Submodel.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/Submodel.java @@ -97,11 +97,6 @@ public class Submodel { @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true,mappedBy = "submodel") private Set displayNames= new HashSet<>(); - @JsonManagedReference - @JsonIgnore - @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true,mappedBy = "submodel") - Set submodelExtensions= new HashSet<>(); - @JsonManagedReference @JsonIgnore @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true,mappedBy = "submodel") @@ -114,13 +109,6 @@ public void setDisplayNames(Set displayNames) { s.setSubmodel(this); } } - public void setSubmodelExtensions(Set submodelExtensions) { - if(submodelExtensions==null) {submodelExtensions = new HashSet<>();} - this.submodelExtensions = submodelExtensions; - for(SubmodelExtension s : submodelExtensions) { - s.setSubmodel(this); - } - } public void setDescriptions(Set descriptions) { if(descriptions==null) {descriptions = new HashSet<>();} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtension.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtension.java deleted file mode 100644 index b7b80348..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtension.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class SubmodelExtension { - @GeneratedValue( strategy = GenerationType.IDENTITY ) - @Id - @Column( name = "id" ) - UUID id; - - @JsonManagedReference - @JsonIgnore - @OneToOne(cascade = CascadeType.ALL, orphanRemoval=true,mappedBy = "submodelExtension") - SubmodelExtensionSemanticIdReference submodSemanticId; - - @JsonManagedReference - @JsonIgnore - @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true,mappedBy = "submodelExtension") - Set submodSupplementalIds; - String name; - DataTypeXsd valueType; - @Column(name = "submod_ext_value") - String value; - - @JsonManagedReference - @JsonIgnore - @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true,mappedBy = "submodelExtension") - Set refersTo; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_submodel_id") - private Submodel submodel; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionRefersToReference.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionRefersToReference.java deleted file mode 100644 index b8b4091d..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionRefersToReference.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class SubmodelExtensionRefersToReference { - @GeneratedValue( strategy = GenerationType.IDENTITY ) - @Id - @Column( name = "id" ) - UUID id; - ReferenceType type; - - @JsonManagedReference - @JsonIgnore - @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true,mappedBy = "submodelExtensionRefersToReference") - Set keys; - - @JsonManagedReference - @JsonIgnore - @OneToOne(cascade = CascadeType.ALL, orphanRemoval=true,mappedBy = "submodelExtensionRefersToReference") - SubmodelExtensionRefersToReferenceParent referredSemanticId; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_submod_ext_refers_id") - private SubmodelExtension submodelExtension; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionRefersToReferenceKey.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionRefersToReferenceKey.java deleted file mode 100644 index c23a2f0f..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionRefersToReferenceKey.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class SubmodelExtensionRefersToReferenceKey { - @GeneratedValue( strategy = GenerationType.IDENTITY ) - @Id - @Column( name = "id" ) - UUID id; - ReferenceKeyType type; - @Column(name = "ref_key_value") - String value; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_reference_parent_id") - private SubmodelExtensionRefersToReferenceParent submodelExtensionRefersToReferenceParent; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_submodel_extension_refers_reference_id") - private SubmodelExtensionRefersToReference submodelExtensionRefersToReference; -} - - diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionRefersToReferenceParent.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionRefersToReferenceParent.java deleted file mode 100644 index 901cc6c3..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionRefersToReferenceParent.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class SubmodelExtensionRefersToReferenceParent { - @GeneratedValue( strategy = GenerationType.IDENTITY ) - @Id - @Column( name = "id" ) - UUID id; - ReferenceType type; - - @JsonManagedReference - @JsonIgnore - @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true,mappedBy = "submodelExtensionRefersToReferenceParent") - Set keys; - - @JsonBackReference - @OneToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_submodel_extension_refers_referred_id") - private SubmodelExtensionRefersToReference submodelExtensionRefersToReference; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSemanticIdReference.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSemanticIdReference.java deleted file mode 100644 index 39566f95..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSemanticIdReference.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class SubmodelExtensionSemanticIdReference { - @GeneratedValue( strategy = GenerationType.IDENTITY ) - @Id - @Column( name = "id" ) - UUID id; - ReferenceType type; - - @JsonManagedReference - @JsonIgnore - @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true,mappedBy = "submodelExtensionSemanticIdReference") - Set keys; - - @JsonManagedReference - @JsonIgnore - @OneToOne(cascade = CascadeType.ALL, orphanRemoval=true,mappedBy = "submodelExtensionSemanticIdReference") - SubmodelExtensionSemanticIdReferenceParent referredSemanticId; - - @JsonBackReference - @OneToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_submod_ext_semantic_id") - private SubmodelExtension submodelExtension; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSemanticIdReferenceKey.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSemanticIdReferenceKey.java deleted file mode 100644 index 54d09806..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSemanticIdReferenceKey.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class SubmodelExtensionSemanticIdReferenceKey { - @GeneratedValue( strategy = GenerationType.IDENTITY ) - @Id - @Column( name = "id" ) - UUID id; - ReferenceKeyType type; - @Column(name = "ref_key_value") - String value; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_submodel_extension_semantic_reference_id") - private SubmodelExtensionSemanticIdReference submodelExtensionSemanticIdReference; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_reference_parent_id") - private SubmodelExtensionSemanticIdReferenceParent submodelExtensionSemanticIdReferenceParent; -} - - diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSemanticIdReferenceParent.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSemanticIdReferenceParent.java deleted file mode 100644 index abf6cc67..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSemanticIdReferenceParent.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class SubmodelExtensionSemanticIdReferenceParent { - @GeneratedValue( strategy = GenerationType.IDENTITY ) - @Id - @Column( name = "id" ) - UUID id; - ReferenceType type; - @JsonManagedReference - @JsonIgnore - @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true,mappedBy = "submodelExtensionSemanticIdReferenceParent") - Set keys; - - @JsonBackReference - @OneToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_submodel_extension_semantic_referred_id") - private SubmodelExtensionSemanticIdReference submodelExtensionSemanticIdReference; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSupplemSemanticIdReference.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSupplemSemanticIdReference.java deleted file mode 100644 index c26bf505..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSupplemSemanticIdReference.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class SubmodelExtensionSupplemSemanticIdReference { - @GeneratedValue( strategy = GenerationType.IDENTITY ) - @Id - @Column( name = "id" ) - UUID id; - ReferenceType type; - - @JsonManagedReference - @JsonIgnore - @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true,mappedBy = "submodelExtensionSupplemSemanticIdReference") - Set keys; - - @JsonManagedReference - @JsonIgnore - @OneToOne(cascade = CascadeType.ALL, orphanRemoval=true,mappedBy = "submodelExtensionSupplemSemanticIdReference") - SubmodelExtensionSupplemSemanticIdReferenceParent referredSemanticId; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_submod_ext_supplemental_id") - private SubmodelExtension submodelExtension; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSupplemSemanticIdReferenceKey.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSupplemSemanticIdReferenceKey.java deleted file mode 100644 index 47db15e3..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSupplemSemanticIdReferenceKey.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class SubmodelExtensionSupplemSemanticIdReferenceKey { - @GeneratedValue( strategy = GenerationType.IDENTITY ) - @Id - @Column( name = "id" ) - UUID id; - ReferenceKeyType type; - @Column(name = "ref_key_value") - String value; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_submodel_extension_supplem_semantic_reference_id") - private SubmodelExtensionSupplemSemanticIdReference submodelExtensionSupplemSemanticIdReference; - - @JsonBackReference - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_reference_parent_id") - private SubmodelExtensionSupplemSemanticIdReferenceParent submodelExtensionSupplemSemanticIdReferenceParent; -} - - diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSupplemSemanticIdReferenceParent.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSupplemSemanticIdReferenceParent.java deleted file mode 100644 index e2feb1af..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelExtensionSupplemSemanticIdReferenceParent.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -public class SubmodelExtensionSupplemSemanticIdReferenceParent { - @GeneratedValue( strategy = GenerationType.IDENTITY ) - @Id - @Column( name = "id" ) - UUID id; - private ReferenceType type; - @JsonManagedReference - @JsonIgnore - @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true,mappedBy = "submodelExtensionSupplemSemanticIdReferenceParent") - private Set keys; - - @JsonBackReference - @OneToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "fk_submodel_extension_supplem_semantic_referred_id") - private SubmodelExtensionSupplemSemanticIdReference submodelExtensionSupplemSemanticIdReference; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSemanticIdReference.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSemanticIdReference.java index dac7ab4e..ce413e77 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSemanticIdReference.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSemanticIdReference.java @@ -49,11 +49,6 @@ public class SubmodelSemanticIdReference { @OneToMany(cascade = CascadeType.ALL,orphanRemoval=true, mappedBy = "submodelSemanticIdReference") private Set keys; - @JsonManagedReference - @JsonIgnore - @OneToOne(cascade = CascadeType.ALL,orphanRemoval=true, mappedBy = "submodelSemanticIdReference") - private SubmodelSemanticIdReferenceParent referredSemanticId; - @JsonBackReference @OneToOne( fetch = FetchType.LAZY, optional = false,cascade = {CascadeType.MERGE} ) @JoinColumn( name = "fk_submodel_id" ) diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSemanticIdReferenceKey.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSemanticIdReferenceKey.java index 0ac42ad3..2a2e0c1a 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSemanticIdReferenceKey.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSemanticIdReferenceKey.java @@ -47,11 +47,6 @@ public class SubmodelSemanticIdReferenceKey { @ManyToOne( fetch = FetchType.LAZY, optional = false,cascade = { CascadeType.MERGE} ) @JoinColumn( name = "fk_submodel_semantic_id_reference_id" ) private SubmodelSemanticIdReference submodelSemanticIdReference; - - @JsonBackReference - @ManyToOne( fetch = FetchType.LAZY, optional = false,cascade = { CascadeType.MERGE} ) - @JoinColumn( name = "fk_reference_parent_id" ) - private SubmodelSemanticIdReferenceParent submodelSemanticIdReferenceParent; } diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSemanticIdReferenceParent.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSemanticIdReferenceParent.java deleted file mode 100644 index 7730ab9e..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSemanticIdReferenceParent.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonIdentityInfo; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import com.fasterxml.jackson.annotation.ObjectIdGenerators; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -@JsonIdentityInfo( generator = ObjectIdGenerators.PropertyGenerator.class, property = "id") -public class SubmodelSemanticIdReferenceParent { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name="id") - UUID id; - ReferenceType type; - @JsonManagedReference - @JsonIgnore - @OneToMany(cascade = CascadeType.ALL,orphanRemoval=true, mappedBy = "submodelSemanticIdReferenceParent") - Set keys; - - @JsonBackReference - @OneToOne( fetch = FetchType.LAZY, optional = false,cascade = { CascadeType.MERGE} ) - @JoinColumn( name = "fk_submodel_semantic_id_referred_id" ) - private SubmodelSemanticIdReference submodelSemanticIdReference; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSupplemSemanticIdReference.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSupplemSemanticIdReference.java index a413c329..05df4e32 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSupplemSemanticIdReference.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSupplemSemanticIdReference.java @@ -42,17 +42,14 @@ public class SubmodelSupplemSemanticIdReference { @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name="id") UUID id; + ReferenceType type; + @JsonManagedReference @JsonIgnore @OneToMany(cascade = CascadeType.ALL,orphanRemoval=true, mappedBy = "submodelSupplemSemanticIdReference") Set keys; - @JsonManagedReference - @JsonIgnore - @OneToOne(cascade = CascadeType.ALL,orphanRemoval=true, mappedBy = "submodelSupplemSemanticIdReference") - SubmodelSupplemSemanticIdReferenceParent referredSemanticId; - @JsonBackReference @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "fk_submodel_id") diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSupplemSemanticIdReferenceKey.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSupplemSemanticIdReferenceKey.java index 170a4f07..234d7380 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSupplemSemanticIdReferenceKey.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSupplemSemanticIdReferenceKey.java @@ -47,11 +47,6 @@ public class SubmodelSupplemSemanticIdReferenceKey { @ManyToOne( fetch = FetchType.LAZY, optional = false,cascade = { CascadeType.MERGE} ) @JoinColumn( name = "fk_submodel_supplem_semantic_id_reference_id" ) private SubmodelSupplemSemanticIdReference submodelSupplemSemanticIdReference; - - @JsonBackReference - @ManyToOne( fetch = FetchType.LAZY, optional = false,cascade = { CascadeType.MERGE} ) - @JoinColumn( name = "fk_reference_parent_id" ) - private SubmodelSupplemSemanticIdReferenceParent submodelSupplemSemanticIdReferenceParent; } diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSupplemSemanticIdReferenceParent.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSupplemSemanticIdReferenceParent.java deleted file mode 100644 index 2c63793a..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/model/SubmodelSupplemSemanticIdReferenceParent.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.registry.model; - -import java.util.Set; -import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonIdentityInfo; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonManagedReference; -import com.fasterxml.jackson.annotation.ObjectIdGenerators; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@Table -@NoArgsConstructor -@AllArgsConstructor -@With -@JsonIdentityInfo( generator = ObjectIdGenerators.PropertyGenerator.class, property = "id") -public class SubmodelSupplemSemanticIdReferenceParent { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name="id") - UUID id; - private ReferenceType type; - @JsonManagedReference - @JsonIgnore - @OneToMany(cascade = CascadeType.ALL,orphanRemoval=true, mappedBy = "submodelSupplemSemanticIdReferenceParent") - private Set keys; - - @JsonBackReference - @OneToOne( fetch = FetchType.LAZY, optional = false,cascade = { CascadeType.MERGE} ) - @JoinColumn( name = "fk_submodel_supplem_semantic_id_referred_id" ) - private SubmodelSupplemSemanticIdReference submodelSupplemSemanticIdReference; -} diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/service/ShellService.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/service/ShellService.java index 115f65f5..01da79c8 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/service/ShellService.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/service/ShellService.java @@ -89,105 +89,23 @@ public void mapShellCollection(Shell shell){ shell.getSubmodels().forEach( submodel -> submodel.setShellId( shell ) ); shell.getDescriptions().forEach( description -> description.setShellId( shell ) ); shell.getDisplayNames().forEach( description -> description.setShellId( shell ) ); - shell.setShellExtensions(shell.getShellExtensions()); - mapShellExtension( shell ); mapShellIdentifier( shell.getIdentifiers().stream() ); } - private void mapShellExtension( Shell shell ) { - shell.getShellExtensions().stream().forEach( shellExtension -> { - if(shellExtension.getRefersTo() != null){ - shellExtension.getRefersTo().stream().filter( Objects::nonNull ).forEach( refers -> { - refers.getKeys().forEach( refersParent -> refersParent.setShellExtensionRefersToReference(refers )); - if(refers.getReferredSemanticId() != null){ - refers.getReferredSemanticId().setShellExtensionRefersToReference(refers ); - refers.getReferredSemanticId().getKeys().stream().filter( Objects::nonNull ).forEach( key -> key.setShellExtensionRefersToReferenceParent( refers.getReferredSemanticId() )); - } - refers.setShellExtension( shellExtension );} ); - } - - if(shellExtension.getSupplementalSemanticIds() != null ) { - shellExtension.getSupplementalSemanticIds().forEach( supplemental -> { - supplemental.getKeys().forEach( key -> key.setShellExtensionSupplemSemanticIdReference( supplemental ) ); - if(supplemental.getReferredSemanticId() != null){ - supplemental.getReferredSemanticId().setShellExtensionSupplemSemanticIdReference( supplemental ); - supplemental.getReferredSemanticId().getKeys() - .forEach( key -> key.setShellExtensionSupplemSemanticIdReferenceParent( supplemental.getReferredSemanticId() ) ); - } - supplemental.setShellExtension( shellExtension ); - } ); - } - if(shellExtension.getSemanticId() != null) { - shellExtension.getSemanticId().getKeys().forEach( key -> { - key.setShellExtensionSemanticIdReference( shellExtension.getSemanticId() ); - } ); - if(shellExtension.getSemanticId().getReferredSemanticId() != null) { - shellExtension.getSemanticId().getReferredSemanticId().setShellExtensionSemanticIdReference( shellExtension.getSemanticId() ); - shellExtension.getSemanticId().getReferredSemanticId().getKeys() - .forEach( key -> key.setShellExtensionSemanticIdReferenceParent( shellExtension.getSemanticId() - .getReferredSemanticId() ) ); - } - shellExtension.getSemanticId().setShellExtension( shellExtension ); - } - }); - } - public void mapSubmodel(Set submodels){ submodels.forEach( submodel -> submodel.getEndpoints().forEach( submodelEndpoint -> submodelEndpoint.getSubmodelSecurityAttribute().forEach(submodelSecurityAttribute -> { submodelSecurityAttribute.setSubmodelEndpoint(submodelEndpoint );}) ) ); - submodels.forEach(submodel -> submodel.getSubmodelExtensions().forEach( submodelExtension -> { - if(submodelExtension.getRefersTo() != null){ - submodelExtension.getRefersTo().forEach( refers -> { - refers.getKeys().forEach( refersParent -> refersParent.setSubmodelExtensionRefersToReference(refers )); - if(refers.getReferredSemanticId() != null){ - refers.getReferredSemanticId().setSubmodelExtensionRefersToReference(refers ); - refers.getReferredSemanticId().getKeys().forEach( key -> key.setSubmodelExtensionRefersToReferenceParent( refers.getReferredSemanticId() )); - } - refers.setSubmodelExtension( submodelExtension );} ); - } - - if(submodelExtension.getSubmodSupplementalIds() != null){ - submodelExtension.getSubmodSupplementalIds().forEach( supplemental ->{ - supplemental.getKeys().forEach( key -> key.setSubmodelExtensionSupplemSemanticIdReference( supplemental ) ); - if(supplemental.getReferredSemanticId() != null){ - supplemental.getReferredSemanticId().setSubmodelExtensionSupplemSemanticIdReference(supplemental ); - supplemental.getReferredSemanticId().getKeys().forEach( key -> key.setSubmodelExtensionSupplemSemanticIdReferenceParent( supplemental.getReferredSemanticId() )); - } - supplemental.setSubmodelExtension( submodelExtension );} ); - } - - if(submodelExtension.getSubmodSemanticId() != null){ - submodelExtension.getSubmodSemanticId().getKeys().forEach( key -> {key.setSubmodelExtensionSemanticIdReference( submodelExtension.getSubmodSemanticId() );} ); - if(submodelExtension.getSubmodSemanticId().getReferredSemanticId() != null){ - submodelExtension.getSubmodSemanticId().getReferredSemanticId().setSubmodelExtensionSemanticIdReference( submodelExtension.getSubmodSemanticId()); - submodelExtension.getSubmodSemanticId().getKeys().forEach( key -> key.setSubmodelExtensionSemanticIdReferenceParent(submodelExtension.getSubmodSemanticId().getReferredSemanticId() ) ); - } - submodelExtension.getSubmodSemanticId().setSubmodelExtension( submodelExtension ); - } - } )); - - submodels.forEach( submodel -> { if ( submodel.getSemanticId() != null ) { submodel.getSemanticId().getKeys().stream().filter( Objects::nonNull ).forEach( key -> { key.setSubmodelSemanticIdReference( submodel.getSemanticId() ); } ); - if(submodel.getSemanticId().getReferredSemanticId() != null){ - submodel.getSemanticId().getReferredSemanticId().setSubmodelSemanticIdReference( submodel.getSemanticId() ); - submodel.getSemanticId().getReferredSemanticId().getKeys().forEach( key -> - key.setSubmodelSemanticIdReferenceParent( submodel.getSemanticId().getReferredSemanticId() ) ); - } submodel.getSemanticId().setSubmodel( submodel ); }}); submodels.forEach(submodel -> {if(submodel.getSubmodelSupplemSemanticIds()!= null){ submodel.getSubmodelSupplemSemanticIds().stream().filter( Objects::nonNull ).forEach( supplemental ->{ supplemental.getKeys().forEach( key -> key.setSubmodelSupplemSemanticIdReference( supplemental ) ); - if(supplemental.getReferredSemanticId() != null) { - supplemental.getReferredSemanticId().setSubmodelSupplemSemanticIdReference( supplemental ); - supplemental.getReferredSemanticId().getKeys() - .forEach( key -> key.setSubmodelSupplemSemanticIdReferenceParent( supplemental.getReferredSemanticId() ) ); - } supplemental.setSubmodel( submodel ); }); } @@ -372,22 +290,12 @@ private static void mapShellIdentifier( Stream identifiersToUpd identifier -> { if ( identifier.getSemanticId() != null ) { identifier.getSemanticId().getKeys().forEach( key -> key.setShellIdentifierSemanticReference( identifier.getSemanticId() ) ); - if ( identifier.getSemanticId().getReferredSemanticId() != null ) { - identifier.getSemanticId().getReferredSemanticId().setShellIdentifierSemanticReference( identifier.getSemanticId() ); - identifier.getSemanticId().getReferredSemanticId().getKeys() - .forEach( key -> key.setShellIdentifierSemanticReferenceParent( identifier.getSemanticId().getReferredSemanticId() ) ); - } identifier.getSemanticId().setShellIdentifier( identifier ); } if ( identifier.getSupplementalSemanticIds() != null ) { identifier.getSupplementalSemanticIds().stream().filter( Objects::nonNull ).forEach( supplementalID -> { supplementalID.getKeys().forEach( key -> key.setShellIdentifierSupplemSemanticReference( supplementalID ) ); - if ( supplementalID.getReferredSemanticId() != null ) { - supplementalID.getReferredSemanticId().setShellIdentifierSupplemSemanticReference( supplementalID ); - supplementalID.getReferredSemanticId().getKeys() - .forEach( key -> key.setShellIdentifierSupplemSemanticReferenceParent( supplementalID.getReferredSemanticId() ) ); - } supplementalID.setShellIdentifier( identifier ); } ); } @@ -396,11 +304,6 @@ private static void mapShellIdentifier( Stream identifiersToUpd identifier.getExternalSubjectId().getKeys().stream().filter( Objects::nonNull ).forEach( key -> { key.setShellIdentifierExternalSubjectReference( identifier.getExternalSubjectId() ); } ); - if ( identifier.getExternalSubjectId().getReferredSemanticId() != null ) { - identifier.getExternalSubjectId().getReferredSemanticId().setShellIdentifierExternalSubjectReference( identifier.getExternalSubjectId() ); - identifier.getExternalSubjectId().getReferredSemanticId().getKeys().forEach( key -> - key.setShellIdentifierExternalSubjectReferenceParent( identifier.getExternalSubjectId().getReferredSemanticId() ) ); - } identifier.getExternalSubjectId().setShellIdentifier( identifier ); } } ); diff --git a/backend/src/main/resources/db/changelog/db.changelog-master.yaml b/backend/src/main/resources/db/changelog/db.changelog-master.yaml index 7a13f6fb..512b24e9 100644 --- a/backend/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/backend/src/main/resources/db/changelog/db.changelog-master.yaml @@ -41,6 +41,3 @@ databaseChangeLog: - include: file: db.changelog-v2.yaml relativeToChangelogFile: true - - include: - file: db.changelog-v3.yaml - relativeToChangelogFile: true diff --git a/backend/src/main/resources/db/changelog/db.changelog-v2.yaml b/backend/src/main/resources/db/changelog/db.changelog-v2.yaml index 4957e670..c5313e32 100644 --- a/backend/src/main/resources/db/changelog/db.changelog-v2.yaml +++ b/backend/src/main/resources/db/changelog/db.changelog-v2.yaml @@ -119,11 +119,35 @@ databaseChangeLog: referencedTableName: SUBMODEL validate: true - changeSet: - id: 05072023-03 + id: 14072023-01 + author: slindner + changes: + - dropNotNullConstraint: + tableName: SHELL + columnName: ID_SHORT + - dropIndex: + tableName: SHELL_IDENTIFIER + indexName: SHELL_IDENTIFIER_IX01 + - createIndex: + tableName: SHELL_IDENTIFIER + indexName: SHELL_IDENTIFIER_IX01 + columns: + - column: + name: NAMESPACE + - column: + name: IDENTIFIER + - dropColumn: + tableName: SHELL_IDENTIFIER + columns: + - column: + name: EXTERNAL_SUBJECT_ID + type: nvarchar(30) + - changeSet: + id: 17072023-01 author: slindner changes: - createTable: - tableName: SHELL_EXTENSION + tableName: SUBMODEL_SECURITY_ATTRIBUTE columns: - column: name: ID @@ -133,36 +157,40 @@ databaseChangeLog: primaryKey: true nullable: false - column: - name: NAME - type: nvarchar(255) + name: TYPE + type: nvarchar(30) constraints: nullable: false - column: - name: VALUE_TYPE + name: ATTRIBUTE_KEY type: nvarchar(255) constraints: - nullable: true + nullable: false - column: - name: SHELL_EXT_VALUE + name: ATTRIBUTE_VALUE type: nvarchar(255) constraints: - nullable: true + nullable: false - column: - name: FK_SHELL_ID + name: FK_SUBMODEL_ENDPOINT_ID type: ${uuid_type} constraints: - nullable: true + nullable: false - addForeignKeyConstraint: - baseTableName: SHELL_EXTENSION - baseColumnNames: FK_SHELL_ID - constraintName: SHELL_EXTENSION_FK_SHELL + baseTableName: SUBMODEL_SECURITY_ATTRIBUTE + baseColumnNames: FK_SUBMODEL_ENDPOINT_ID + constraintName: REF_FK_FK_SUBMODEL_ENDPOINT_ID onDelete: CASCADE onUpdate: RESTRICT referencedColumnNames: ID - referencedTableName: SHELL + referencedTableName: SUBMODEL_ENDPOINT validate: true + - changeSet: + id: 17072023-02 + author: slindner + changes: - createTable: - tableName: SUBMODEL_EXTENSION + tableName: SHELL_IDENTIFIER_SEMANTIC_REFERENCE columns: - column: name: ID @@ -172,40 +200,62 @@ databaseChangeLog: primaryKey: true nullable: false - column: - name: NAME - type: nvarchar(255) + name: TYPE + type: nvarchar(2000) constraints: nullable: false - column: - name: VALUE_TYPE - type: nvarchar(255) + name: FK_SHELL_IDENTIFIER_SEMANTIC_ID + type: ${uuid_type} constraints: nullable: true + - addForeignKeyConstraint: + baseTableName: SHELL_IDENTIFIER_SEMANTIC_REFERENCE + baseColumnNames: FK_SHELL_IDENTIFIER_SEMANTIC_ID + constraintName: REF_FK_SHELL_IDENTIFIER_SEMANTIC_ID_REF + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: ID + referencedTableName: SHELL_IDENTIFIER + validate: true + + - createTable: + tableName: SHELL_IDENTIFIER_SEMANTIC_REFERENCE_KEY + columns: - column: - name: SUBMOD_EXT_VALUE - type: nvarchar(255) + name: ID + type: ${uuid_type} + defaultValueComputed: ${uuid_function} constraints: - nullable: true + primaryKey: true + nullable: false - column: - name: FK_SUBMODEL_ID - type: ${uuid_type} + name: TYPE + type: nvarchar(2000) + constraints: + nullable: false + - column: + name: REF_KEY_VALUE + type: nvarchar(2000) constraints: nullable: false + - column: + name: FK_SIS_REFERENCE_ID + type: ${uuid_type} + constraints: + nullable: true - addForeignKeyConstraint: - baseTableName: SUBMODEL_EXTENSION - baseColumnNames: FK_SUBMODEL_ID - constraintName: SUBMODEL_EXTENSION_FK_SHELL + baseTableName: SHELL_IDENTIFIER_SEMANTIC_REFERENCE_KEY + baseColumnNames: FK_SIS_REFERENCE_ID + constraintName: REF_FK_SI_SEMANTIC_REFERENCE_ID onDelete: CASCADE onUpdate: RESTRICT referencedColumnNames: ID - referencedTableName: SUBMODEL + referencedTableName: SHELL_IDENTIFIER_SEMANTIC_REFERENCE validate: true - - changeSet: - id: 04072023-03 - author: slindner - changes: + - createTable: - tableName: REFERENCE + tableName: SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE columns: - column: name: ID @@ -220,49 +270,131 @@ databaseChangeLog: constraints: nullable: false - column: - name: FK_SUBMOD_EXT_SEMANTIC_ID + name: FK_SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_ID type: ${uuid_type} constraints: nullable: true + - addForeignKeyConstraint: + baseTableName: SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE + baseColumnNames: FK_SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_ID + constraintName: REF_FK_SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_ID_REF + onDelete: CASCADE + onUpdate: RESTRICT + referencedColumnNames: ID + referencedTableName: SHELL_IDENTIFIER + validate: true + - createTable: + tableName: SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE_KEY + columns: - column: - name: FK_SUBMOD_EXT_SUPPLEMENTAL_ID + name: ID type: ${uuid_type} + defaultValueComputed: ${uuid_function} constraints: - nullable: true + primaryKey: true + nullable: false + - column: + name: TYPE + type: nvarchar(2000) + constraints: + nullable: false + - column: + name: REF_KEY_VALUE + type: nvarchar(2000) + constraints: + nullable: false - column: - name: FK_SUBMOD_EXT_REFERS_ID + name: FK_REFERENCE_ID type: ${uuid_type} constraints: nullable: true - addForeignKeyConstraint: - baseTableName: REFERENCE - baseColumnNames: FK_SUBMOD_EXT_SEMANTIC_ID - constraintName: REF_FK_SUBMOD_EXT_SEMANTIC_ID + baseTableName: SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE_KEY + baseColumnNames: FK_REFERENCE_ID + constraintName: REF_FK_SI_SUPPLEM_SEMANTIC_REFERENCE_ID onDelete: CASCADE onUpdate: RESTRICT referencedColumnNames: ID - referencedTableName: SUBMODEL_EXTENSION + referencedTableName: SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE validate: true + + - createTable: + tableName: SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE + columns: + - column: + name: ID + type: ${uuid_type} + defaultValueComputed: ${uuid_function} + constraints: + primaryKey: true + nullable: false + - column: + name: TYPE + type: nvarchar(2000) + constraints: + nullable: false + - column: + name: FK_SHELL_IDENTIFIER_EXTERNAL_SUBJECT_ID + type: ${uuid_type} + constraints: + nullable: true - addForeignKeyConstraint: - baseTableName: REFERENCE - baseColumnNames: FK_SUBMOD_EXT_SUPPLEMENTAL_ID - constraintName: REF_FK_SUBMOD_EXT_SUPPLEMENTAL_ID + baseTableName: SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE + baseColumnNames: FK_SHELL_IDENTIFIER_EXTERNAL_SUBJECT_ID + constraintName: REF_FK_SHELL_IDENTIFIER_EXTERNAL_SUBJECT_ID_REF onDelete: CASCADE onUpdate: RESTRICT referencedColumnNames: ID - referencedTableName: SUBMODEL_EXTENSION + referencedTableName: SHELL_IDENTIFIER validate: true + + - createTable: + tableName: SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE_KEY + columns: + - column: + name: ID + type: ${uuid_type} + defaultValueComputed: ${uuid_function} + constraints: + primaryKey: true + nullable: false + - column: + name: TYPE + type: nvarchar(2000) + constraints: + nullable: false + - column: + name: REF_KEY_VALUE + type: nvarchar(2000) + constraints: + nullable: false + - column: + name: FK_SI_EXTERNAL_SUBJECT_REFERENCE_ID + type: ${uuid_type} + constraints: + nullable: true - addForeignKeyConstraint: - baseTableName: REFERENCE - baseColumnNames: FK_SUBMOD_EXT_REFERS_ID - constraintName: REF_FK_SUBMOD_EXT_FK_SUBMOD_EXT_REFERS_ID + baseTableName: SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE_KEY + baseColumnNames: FK_SI_EXTERNAL_SUBJECT_REFERENCE_ID + constraintName: REF_FK_SI_EXTERNAL_SUBJECT_REFERENCE_ID onDelete: CASCADE onUpdate: RESTRICT referencedColumnNames: ID - referencedTableName: SUBMODEL_EXTENSION + referencedTableName: SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE validate: true + + - changeSet: + id: 18072023-01 + author: slindner + changes: + - dropColumn: + tableName: SUBMODEL + columns: + - column: + name: SEMANTIC_ID + type: nvarchar(200) - createTable: - tableName: REFERENCE_PARENT + tableName: SUBMODEL_SEMANTIC_ID_REFERENCE columns: - column: name: ID @@ -277,21 +409,22 @@ databaseChangeLog: constraints: nullable: false - column: - name: FK_REFERRED_SEMANTIC_ID + name: FK_SUBMODEL_ID type: ${uuid_type} constraints: nullable: true - addForeignKeyConstraint: - baseTableName: REFERENCE_PARENT - baseColumnNames: FK_REFERRED_SEMANTIC_ID - constraintName: REF_FK_REFERRED_SEMANTIC_ID + baseTableName: SUBMODEL_SEMANTIC_ID_REFERENCE + baseColumnNames: FK_SUBMODEL_ID + constraintName: REF_FK_SUBMODEL_SEMANTIC_ID_REF onDelete: CASCADE onUpdate: RESTRICT referencedColumnNames: ID - referencedTableName: REFERENCE + referencedTableName: SUBMODEL validate: true + - createTable: - tableName: REFERENCE_KEY + tableName: SUBMODEL_SEMANTIC_ID_REFERENCE_KEY columns: - column: name: ID @@ -311,67 +444,51 @@ databaseChangeLog: constraints: nullable: false - column: - name: FK_REFERENCE_ID - type: ${uuid_type} - constraints: - nullable: true - - column: - name: FK_REFERENCE_PARENT_ID + name: FK_SUBMODEL_SEMANTIC_ID_REFERENCE_ID type: ${uuid_type} constraints: nullable: true - addForeignKeyConstraint: - baseTableName: REFERENCE_KEY - baseColumnNames: FK_REFERENCE_PARENT_ID - constraintName: REF_FK_REFERENCE_PARENT_ID + baseTableName: SUBMODEL_SEMANTIC_ID_REFERENCE_KEY + baseColumnNames: FK_SUBMODEL_SEMANTIC_ID_REFERENCE_ID + constraintName: REF_FK_SUBMODEL_SEMANTIC_ID_REFERENCE_KEY onDelete: CASCADE onUpdate: RESTRICT referencedColumnNames: ID - referencedTableName: REFERENCE_PARENT + referencedTableName: SUBMODEL_SEMANTIC_ID_REFERENCE validate: true + + - createTable: + tableName: SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE + columns: + - column: + name: ID + type: ${uuid_type} + defaultValueComputed: ${uuid_function} + constraints: + primaryKey: true + nullable: false + - column: + name: TYPE + type: nvarchar(2000) + constraints: + nullable: false + - column: + name: FK_SUBMODEL_ID + type: ${uuid_type} + constraints: + nullable: true - addForeignKeyConstraint: - baseTableName: REFERENCE_KEY - baseColumnNames: FK_REFERENCE_ID - constraintName: REF_FK_REFERENCE_ID + baseTableName: SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE + baseColumnNames: FK_SUBMODEL_ID + constraintName: REF_FK_SUBMODEL_SUPPLEM_SEMANTIC_ID onDelete: CASCADE onUpdate: RESTRICT referencedColumnNames: ID - referencedTableName: REFERENCE + referencedTableName: SUBMODEL validate: true - - changeSet: - id: 11072023-01 - author: slindner - changes: - - dropNotNullConstraint: - tableName: SHELL - columnName: ID_SHORT - - changeSet: - id: 14072023-01 - author: slindner - changes: - - dropIndex: - tableName: SHELL_IDENTIFIER - indexName: SHELL_IDENTIFIER_IX01 - - createIndex: - tableName: SHELL_IDENTIFIER - indexName: SHELL_IDENTIFIER_IX01 - columns: - - column: - name: NAMESPACE - - column: - name: IDENTIFIER - - dropColumn: - tableName: SHELL_IDENTIFIER - columns: - - column: - name: EXTERNAL_SUBJECT_ID - type: nvarchar(30) - - changeSet: - id: 17072023-01 - author: slindner - changes: - createTable: - tableName: SUBMODEL_SECURITY_ATTRIBUTE + tableName: SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE_KEY columns: - column: name: ID @@ -382,30 +499,32 @@ databaseChangeLog: nullable: false - column: name: TYPE - type: nvarchar(30) - constraints: - nullable: false - - column: - name: ATTRIBUTE_KEY - type: nvarchar(255) + type: nvarchar(2000) constraints: nullable: false - column: - name: ATTRIBUTE_VALUE - type: nvarchar(255) + name: REF_KEY_VALUE + type: nvarchar(2000) constraints: nullable: false - column: - name: FK_SUBMODEL_ENDPOINT_ID + name: FK_SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE_ID type: ${uuid_type} constraints: - nullable: false + nullable: true - addForeignKeyConstraint: - baseTableName: SUBMODEL_SECURITY_ATTRIBUTE - baseColumnNames: FK_SUBMODEL_ENDPOINT_ID - constraintName: REF_FK_FK_SUBMODEL_ENDPOINT_ID + baseTableName: SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE_KEY + baseColumnNames: FK_SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE_ID + constraintName: REF_FK_SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE_KEY onDelete: CASCADE onUpdate: RESTRICT referencedColumnNames: ID - referencedTableName: SUBMODEL_ENDPOINT - validate: true \ No newline at end of file + referencedTableName: SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE + validate: true + - changeSet: + id: 20072023-01 + author: slindner + changes: + - dropNotNullConstraint: + tableName: SUBMODEL + columnName: ID_SHORT diff --git a/backend/src/main/resources/db/changelog/db.changelog-v3.yaml b/backend/src/main/resources/db/changelog/db.changelog-v3.yaml deleted file mode 100644 index 5a313c34..00000000 --- a/backend/src/main/resources/db/changelog/db.changelog-v3.yaml +++ /dev/null @@ -1,1236 +0,0 @@ -############################################################### -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# Copyright (c) 2023 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -############################################################### -databaseChangeLog: - - changeSet: - id: 17072023-01 - author: slindner - changes: - - createTable: - tableName: SHELL_IDENTIFIER_SEMANTIC_REFERENCE - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SHELL_IDENTIFIER_SEMANTIC_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_IDENTIFIER_SEMANTIC_REFERENCE - baseColumnNames: FK_SHELL_IDENTIFIER_SEMANTIC_ID - constraintName: REF_FK_SHELL_IDENTIFIER_SEMANTIC_ID_REF - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_IDENTIFIER - validate: true - - createTable: - tableName: SHELL_IDENTIFIER_SEMANTIC_REFERENCE_PARENT - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SIS_REFERRED_SEMANTIC_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_IDENTIFIER_SEMANTIC_REFERENCE_PARENT - baseColumnNames: FK_SIS_REFERRED_SEMANTIC_ID - constraintName: REF_FK_SHELL_IDENTIFIER_SEMANTIC_REFERENCE_PARENT - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_IDENTIFIER_SEMANTIC_REFERENCE - validate: true - - - createTable: - tableName: SHELL_IDENTIFIER_SEMANTIC_REFERENCE_KEY - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: REF_KEY_VALUE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SIS_REFERENCE_ID - type: ${uuid_type} - constraints: - nullable: true - - column: - name: FK_REFERENCE_PARENT_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_IDENTIFIER_SEMANTIC_REFERENCE_KEY - baseColumnNames: FK_REFERENCE_PARENT_ID - constraintName: REF_FK_SI_SEMANTIC_REFERENCE_PARENT_ID - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_IDENTIFIER_SEMANTIC_REFERENCE_PARENT - validate: true - - addForeignKeyConstraint: - baseTableName: SHELL_IDENTIFIER_SEMANTIC_REFERENCE_KEY - baseColumnNames: FK_SIS_REFERENCE_ID - constraintName: REF_FK_SI_SEMANTIC_REFERENCE_ID - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_IDENTIFIER_SEMANTIC_REFERENCE - validate: true - - - createTable: - tableName: SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE - baseColumnNames: FK_SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_ID - constraintName: REF_FK_SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_ID_REF - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_IDENTIFIER - validate: true - - - createTable: - tableName: SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE_PARENT - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_REFERRED_SEMANTIC_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE_PARENT - baseColumnNames: FK_REFERRED_SEMANTIC_ID - constraintName: REF_FK_SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE_PARENT - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE - validate: true - - createTable: - tableName: SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE_KEY - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: REF_KEY_VALUE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_REFERENCE_ID - type: ${uuid_type} - constraints: - nullable: true - - column: - name: FK_REFERENCE_PARENT_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE_KEY - baseColumnNames: FK_REFERENCE_PARENT_ID - constraintName: REF_FK_SI_SUPPLEM_SEMANTIC_REFERENCE_PARENT_ID - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE_PARENT - validate: true - - addForeignKeyConstraint: - baseTableName: SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE_KEY - baseColumnNames: FK_REFERENCE_ID - constraintName: REF_FK_SI_SUPPLEM_SEMANTIC_REFERENCE_ID - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_IDENTIFIER_SUPPLEM_SEMANTIC_REFERENCE - validate: true - - - createTable: - tableName: SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SHELL_IDENTIFIER_EXTERNAL_SUBJECT_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE - baseColumnNames: FK_SHELL_IDENTIFIER_EXTERNAL_SUBJECT_ID - constraintName: REF_FK_SHELL_IDENTIFIER_EXTERNAL_SUBJECT_ID_REF - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_IDENTIFIER - validate: true - - - createTable: - tableName: SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE_PARENT - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SI_EXTERNAL_SUBJECT_REFERRED_SEMANTIC_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE_PARENT - baseColumnNames: FK_SI_EXTERNAL_SUBJECT_REFERRED_SEMANTIC_ID - constraintName: REF_FK_SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE_PARENT - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE - validate: true - - - createTable: - tableName: SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE_KEY - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: REF_KEY_VALUE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SI_EXTERNAL_SUBJECT_REFERENCE_ID - type: ${uuid_type} - constraints: - nullable: true - - column: - name: FK_REFERENCE_PARENT_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE_KEY - baseColumnNames: FK_REFERENCE_PARENT_ID - constraintName: REF_FK_SI_EXTERNAL_SUBJECT_REFERENCE_PARENT_ID - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE_PARENT - validate: true - - addForeignKeyConstraint: - baseTableName: SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE_KEY - baseColumnNames: FK_SI_EXTERNAL_SUBJECT_REFERENCE_ID - constraintName: REF_FK_SI_EXTERNAL_SUBJECT_REFERENCE_ID - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_IDENTIFIER_EXTERNAL_SUBJECT_REFERENCE - validate: true - - - createTable: - tableName: SHELL_EXTENSION_SEMANTIC_ID_REFERENCE - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SHELL_EXT_SEMANTIC_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_EXTENSION_SEMANTIC_ID_REFERENCE - baseColumnNames: FK_SHELL_EXT_SEMANTIC_ID - constraintName: REF_FK_SHELL_EXT_SEMANTIC_REF - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_EXTENSION - validate: true - - - createTable: - tableName: SHELL_EXTENSION_SEMANTIC_ID_REFERENCE_PARENT - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SHELL_EXTENSION_SEMANTIC_REFERRED_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_EXTENSION_SEMANTIC_ID_REFERENCE_PARENT - baseColumnNames: FK_SHELL_EXTENSION_SEMANTIC_REFERRED_ID - constraintName: REF_FKSHELL_EXTENSION_SEMANTIC_REFERENCE_PARENT - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_EXTENSION_SEMANTIC_ID_REFERENCE - validate: true - - - createTable: - tableName: SHELL_EXTENSION_SEMANTIC_ID_REFERENCE_KEY - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: REF_KEY_VALUE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SHELL_EXTENSION_SEMANTIC_REFERENCE_ID - type: ${uuid_type} - constraints: - nullable: true - - column: - name: FK_REFERENCE_PARENT_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_EXTENSION_SEMANTIC_ID_REFERENCE_KEY - baseColumnNames: FK_REFERENCE_PARENT_ID - constraintName: REF_FK_SHELL_EXTENSION_SEMANTIC_PARENT_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_EXTENSION_SEMANTIC_ID_REFERENCE_PARENT - validate: true - - addForeignKeyConstraint: - baseTableName: SHELL_EXTENSION_SEMANTIC_ID_REFERENCE_KEY - baseColumnNames: FK_SHELL_EXTENSION_SEMANTIC_REFERENCE_ID - constraintName: REF_FK_SHELL_EXTENSION_SEMANTIC_ID_REFERENCE_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_EXTENSION_SEMANTIC_ID_REFERENCE - validate: true - - - createTable: - tableName: SHELL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SHELL_EXT_SUPPLEMENTAL_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE - baseColumnNames: FK_SHELL_EXT_SUPPLEMENTAL_ID - constraintName: REF_FK_SHELL_EXT_SUPPLEMENTAL_ID_REF - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_EXTENSION - validate: true - - - createTable: - tableName: SHELL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE_PARENT - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SHELL_EXTENSION_SUPPLEM_SEMANTIC_REFERRED_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE_PARENT - baseColumnNames: FK_SHELL_EXTENSION_SUPPLEM_SEMANTIC_REFERRED_ID - constraintName: REF_FK_SHELL_EXTENSION_SUPPLEM_SEMANTIC_REFERENCE_PARENT - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE - validate: true - - - createTable: - tableName: SHELL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE_KEY - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: REF_KEY_VALUE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SHELL_EXTENSION_SUPPLEM_SEMANTIC_REFERENCE_ID - type: ${uuid_type} - constraints: - nullable: true - - column: - name: FK_REFERENCE_PARENT_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE_KEY - baseColumnNames: FK_REFERENCE_PARENT_ID - constraintName: REF_FK_SHELL_EXTENSION_SUPPLEM_SEMANTIC_ID_PARENT_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE_PARENT - validate: true - - addForeignKeyConstraint: - baseTableName: SHELL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE_KEY - baseColumnNames: FK_SHELL_EXTENSION_SUPPLEM_SEMANTIC_REFERENCE_ID - constraintName: REF_FK_SHELL_EXTENSION_SUPPLEM_SEMANTIC_REFERENCE_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE - validate: true - - - createTable: - tableName: SHELL_EXTENSION_REFERS_TO_REFERENCE - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SHELL_EXT_REFERS_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_EXTENSION_REFERS_TO_REFERENCE - baseColumnNames: FK_SHELL_EXT_REFERS_ID - constraintName: REF_FK_SHELL_EXT_REFERS_ID_REF - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_EXTENSION - validate: true - - - createTable: - tableName: SHELL_EXTENSION_REFERS_TO_REFERENCE_PARENT - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SHELL_EXTENSION_REFERS_REFERRED_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_EXTENSION_REFERS_TO_REFERENCE_PARENT - baseColumnNames: FK_SHELL_EXTENSION_REFERS_REFERRED_ID - constraintName: REF_FK_SHELL_EXTENSION_REFERS_REFERENCE_PARENT - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_EXTENSION_REFERS_TO_REFERENCE - validate: true - - - createTable: - tableName: SHELL_EXTENSION_REFERS_TO_REFERENCE_KEY - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: REF_KEY_VALUE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SHELL_EXTENSION_REFERS_REFERENCE_ID - type: ${uuid_type} - constraints: - nullable: true - - column: - name: FK_REFERENCE_PARENT_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SHELL_EXTENSION_REFERS_TO_REFERENCE_KEY - baseColumnNames: FK_REFERENCE_PARENT_ID - constraintName: REF_FK_SHELL_EXTENSION_REFERS_PARENT_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_EXTENSION_REFERS_TO_REFERENCE_PARENT - validate: true - - addForeignKeyConstraint: - baseTableName: SHELL_EXTENSION_REFERS_TO_REFERENCE_KEY - baseColumnNames: FK_SHELL_EXTENSION_REFERS_REFERENCE_ID - constraintName: REF_FK_SHELL_EXTENSION_REFERS_REFERENCE_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SHELL_EXTENSION_REFERS_TO_REFERENCE - validate: true - - - createTable: - tableName: SUBMODEL_EXTENSION_SEMANTIC_ID_REFERENCE - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SUBMOD_EXT_SEMANTIC_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_EXTENSION_SEMANTIC_ID_REFERENCE - baseColumnNames: FK_SUBMOD_EXT_SEMANTIC_ID - constraintName: REF_FK_SUBMODEL_EXT_SEMANTIC_REF - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_EXTENSION - validate: true - - - createTable: - tableName: SUBMODEL_EXTENSION_SEMANTIC_ID_REFERENCE_PARENT - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SUBMODEL_EXTENSION_SEMANTIC_REFERRED_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_EXTENSION_SEMANTIC_ID_REFERENCE_PARENT - baseColumnNames: FK_SUBMODEL_EXTENSION_SEMANTIC_REFERRED_ID - constraintName: REF_FK_SUBMODEL_EXTENSION_SEMANTIC_REFERENCE_PARENT - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_EXTENSION_SEMANTIC_ID_REFERENCE - validate: true - - - createTable: - tableName: SUBMODEL_EXTENSION_SEMANTIC_ID_REFERENCE_KEY - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: REF_KEY_VALUE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SUBMODEL_EXTENSION_SEMANTIC_REFERENCE_ID - type: ${uuid_type} - constraints: - nullable: true - - column: - name: FK_REFERENCE_PARENT_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_EXTENSION_SEMANTIC_ID_REFERENCE_KEY - baseColumnNames: FK_REFERENCE_PARENT_ID - constraintName: REF_FK_SUBMODEL_EXTENSION_SEMANTIC_PARENT_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_EXTENSION_SEMANTIC_ID_REFERENCE_PARENT - validate: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_EXTENSION_SEMANTIC_ID_REFERENCE_KEY - baseColumnNames: FK_SUBMODEL_EXTENSION_SEMANTIC_REFERENCE_ID - constraintName: REF_FK_SUBMODEL_EXTENSION_SEMANTIC_ID_REFERENCE_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_EXTENSION_SEMANTIC_ID_REFERENCE - validate: true - - - createTable: - tableName: SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SUBMOD_EXT_SUPPLEMENTAL_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE - baseColumnNames: FK_SUBMOD_EXT_SUPPLEMENTAL_ID - constraintName: REF_FK_SUBMODEL_EXT_SUPPLEMENTAL_ID_REF - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_EXTENSION - validate: true - - - createTable: - tableName: SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE_PARENT - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_REFERRED_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE_PARENT - baseColumnNames: FK_SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_REFERRED_ID - constraintName: REF_FK_SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_REFERENCE_PARENT - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE - validate: true - - - createTable: - tableName: SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE_KEY - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: REF_KEY_VALUE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_REFERENCE_ID - type: ${uuid_type} - constraints: - nullable: true - - column: - name: FK_REFERENCE_PARENT_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE_KEY - baseColumnNames: FK_REFERENCE_PARENT_ID - constraintName: REF_FK_SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_ID_PARENT_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE_PARENT - validate: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE_KEY - baseColumnNames: FK_SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_REFERENCE_ID - constraintName: REF_FK_SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_REFERENCE_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_EXTENSION_SUPPLEM_SEMANTIC_ID_REFERENCE - validate: true - - - createTable: - tableName: SUBMODEL_EXTENSION_REFERS_TO_REFERENCE - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SUBMOD_EXT_REFERS_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_EXTENSION_REFERS_TO_REFERENCE - baseColumnNames: FK_SUBMOD_EXT_REFERS_ID - constraintName: REF_FK_SUBMODEL_EXT_REFERS_ID_REF - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_EXTENSION - validate: true - - - createTable: - tableName: SUBMODEL_EXTENSION_REFERS_TO_REFERENCE_PARENT - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SUBMODEL_EXTENSION_REFERS_REFERRED_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_EXTENSION_REFERS_TO_REFERENCE_PARENT - baseColumnNames: FK_SUBMODEL_EXTENSION_REFERS_REFERRED_ID - constraintName: REF_FK_SUBMODEL_EXTENSION_REFERS_REFERENCE_PARENT - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_EXTENSION_REFERS_TO_REFERENCE - validate: true - - - createTable: - tableName: SUBMODEL_EXTENSION_REFERS_TO_REFERENCE_KEY - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: REF_KEY_VALUE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SUBMODEL_EXTENSION_REFERS_REFERENCE_ID - type: ${uuid_type} - constraints: - nullable: true - - column: - name: FK_REFERENCE_PARENT_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_EXTENSION_REFERS_TO_REFERENCE_KEY - baseColumnNames: FK_REFERENCE_PARENT_ID - constraintName: REF_FK_SUBMODEL_EXTENSION_REFERS_PARENT_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_EXTENSION_REFERS_TO_REFERENCE_PARENT - validate: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_EXTENSION_REFERS_TO_REFERENCE_KEY - baseColumnNames: FK_SUBMODEL_EXTENSION_REFERS_REFERENCE_ID - constraintName: REF_FK_SUBMODEL_EXTENSION_REFERS_REFERENCE_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_EXTENSION_REFERS_TO_REFERENCE - validate: true - - changeSet: - id: 18072023-01 - author: slindner - changes: - - dropColumn: - tableName: SUBMODEL - columns: - - column: - name: SEMANTIC_ID - type: nvarchar(200) - - createTable: - tableName: SUBMODEL_SEMANTIC_ID_REFERENCE - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SUBMODEL_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_SEMANTIC_ID_REFERENCE - baseColumnNames: FK_SUBMODEL_ID - constraintName: REF_FK_SUBMODEL_SEMANTIC_ID_REF - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL - validate: true - - - createTable: - tableName: SUBMODEL_SEMANTIC_ID_REFERENCE_PARENT - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SUBMODEL_SEMANTIC_ID_REFERRED_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_SEMANTIC_ID_REFERENCE_PARENT - baseColumnNames: FK_SUBMODEL_SEMANTIC_ID_REFERRED_ID - constraintName: REF_FK_SUBMODEL_SEMANTIC_ID_REFERENCE_PARENT - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_SEMANTIC_ID_REFERENCE - validate: true - - - createTable: - tableName: SUBMODEL_SEMANTIC_ID_REFERENCE_KEY - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: REF_KEY_VALUE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SUBMODEL_SEMANTIC_ID_REFERENCE_ID - type: ${uuid_type} - constraints: - nullable: true - - column: - name: FK_REFERENCE_PARENT_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_SEMANTIC_ID_REFERENCE_KEY - baseColumnNames: FK_REFERENCE_PARENT_ID - constraintName: REF_FK_SUBMODEL_SEMANTIC_ID_PARENT_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_SEMANTIC_ID_REFERENCE_PARENT - validate: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_SEMANTIC_ID_REFERENCE_KEY - baseColumnNames: FK_SUBMODEL_SEMANTIC_ID_REFERENCE_ID - constraintName: REF_FK_SUBMODEL_SEMANTIC_ID_REFERENCE_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_SEMANTIC_ID_REFERENCE - validate: true - - - createTable: - tableName: SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SUBMODEL_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE - baseColumnNames: FK_SUBMODEL_ID - constraintName: REF_FK_SUBMODEL_SUPPLEM_SEMANTIC_ID - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL - validate: true - - - createTable: - tableName: SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE_PARENT - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERRED_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE_PARENT - baseColumnNames: FK_SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERRED_ID - constraintName: REF_FK_SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE_PARENT - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE - validate: true - - - createTable: - tableName: SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE_KEY - columns: - - column: - name: ID - type: ${uuid_type} - defaultValueComputed: ${uuid_function} - constraints: - primaryKey: true - nullable: false - - column: - name: TYPE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: REF_KEY_VALUE - type: nvarchar(2000) - constraints: - nullable: false - - column: - name: FK_SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE_ID - type: ${uuid_type} - constraints: - nullable: true - - column: - name: FK_REFERENCE_PARENT_ID - type: ${uuid_type} - constraints: - nullable: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE_KEY - baseColumnNames: FK_REFERENCE_PARENT_ID - constraintName: REF_FK_SUBMODEL_SUPPLEM_SEMANTIC_ID_PARENT_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE_PARENT - validate: true - - addForeignKeyConstraint: - baseTableName: SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE_KEY - baseColumnNames: FK_SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE_ID - constraintName: REF_FK_SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE_KEY - onDelete: CASCADE - onUpdate: RESTRICT - referencedColumnNames: ID - referencedTableName: SUBMODEL_SUPPLEM_SEMANTIC_ID_REFERENCE - validate: true - - changeSet: - id: 20072023-01 - author: slindner - changes: - - dropNotNullConstraint: - tableName: SUBMODEL - columnName: ID_SHORT diff --git a/backend/src/test/java/org/eclipse/tractusx/semantics/registry/TestUtil.java b/backend/src/test/java/org/eclipse/tractusx/semantics/registry/TestUtil.java index facce726..9ee5874e 100644 --- a/backend/src/test/java/org/eclipse/tractusx/semantics/registry/TestUtil.java +++ b/backend/src/test/java/org/eclipse/tractusx/semantics/registry/TestUtil.java @@ -38,12 +38,6 @@ public static AssetAdministrationShellDescriptor createCompleteAasDescriptor() { assetAdministrationShellDescriptor.setId("fb7ebcc2-5731-4948-aeaa-c9e9692decf5"); assetAdministrationShellDescriptor.setIdShort("idShortExample"); - ReferenceParent specificAssetIdRefParent = new ReferenceParent(); - specificAssetIdRefParent.setType( ReferenceTypes.EXTERNALREFERENCE ); - Key specificAssetIdParentKey = new Key(); - specificAssetIdParentKey.setValue( "specificAssetId ReferenceParent key" ); - specificAssetIdParentKey.setType( KeyTypes.ASSETADMINISTRATIONSHELL ); - specificAssetIdRefParent.setKeys( List.of(specificAssetIdParentKey) ); Reference specificAssetIdReference = new Reference(); specificAssetIdReference.setType( ReferenceTypes.MODELREFERENCE ); @@ -51,7 +45,6 @@ public static AssetAdministrationShellDescriptor createCompleteAasDescriptor() { specificAssetIdKey.setType( KeyTypes.ASSETADMINISTRATIONSHELL ); specificAssetIdKey.setValue( "specificAssetIdReference key" ); specificAssetIdReference.setKeys( List.of(specificAssetIdKey) ); - specificAssetIdReference.setReferredSemanticId( specificAssetIdRefParent ); Reference externalSubjectIdReference = new Reference(); externalSubjectIdReference.setType( ReferenceTypes.EXTERNALREFERENCE ); @@ -59,20 +52,15 @@ public static AssetAdministrationShellDescriptor createCompleteAasDescriptor() { subjectIdKey.setType( KeyTypes.ASSETADMINISTRATIONSHELL ); subjectIdKey.setValue( "ExternalSubject key value" ); externalSubjectIdReference.setKeys( List.of(subjectIdKey) ); - externalSubjectIdReference.setReferredSemanticId( specificAssetIdRefParent ); Key assetIdKey = new Key(); assetIdKey.setType( KeyTypes.BASICEVENTELEMENT ); assetIdKey.setValue( "assetIdKey value" ); - ReferenceParent assetIdParent = new ReferenceParent(); - assetIdParent.setType( ReferenceTypes.EXTERNALREFERENCE ); - assetIdParent.setKeys( List.of(assetIdKey) ); Reference assetIdReference = new Reference(); assetIdReference.setType( ReferenceTypes.EXTERNALREFERENCE ); assetIdReference.setKeys( List.of(assetIdKey) ); - assetIdReference.setReferredSemanticId( assetIdParent ); SpecificAssetId specificAssetId1 = new SpecificAssetId(); specificAssetId1.setName("identifier1KeyExample"); @@ -98,38 +86,6 @@ public static AssetAdministrationShellDescriptor createCompleteAasDescriptor() { assetAdministrationShellDescriptor.setDescription(List.of(description1, description2)); assetAdministrationShellDescriptor.setDescription(List.of(description1, description2)); - ReferenceParent aasReferenceParent = new ReferenceParent(); - aasReferenceParent.setType( ReferenceTypes.EXTERNALREFERENCE ); - Key parentKey = new Key(); - parentKey.setValue( "AAS RefernParent key" ); - parentKey.setType( KeyTypes.ASSETADMINISTRATIONSHELL ); - aasReferenceParent.setKeys( List.of(parentKey) ); - - Reference aasReference = new Reference(); - aasReference.setType( ReferenceTypes.MODELREFERENCE ); - Key aasKey = new Key(); - aasKey.setType( KeyTypes.ASSETADMINISTRATIONSHELL ); - aasKey.setValue( "AAS extension key" ); - aasReference.setKeys( List.of(aasKey) ); - aasReference.setReferredSemanticId( aasReferenceParent ); - - Reference aasReference2 = new Reference(); - aasReference2.setType( ReferenceTypes.EXTERNALREFERENCE ); - Key aasKey2 = new Key(); - aasKey2.setType( KeyTypes.ASSETADMINISTRATIONSHELL ); - aasKey2.setValue( "AAS extension key" ); - aasReference2.setKeys( List.of(aasKey2) ); - aasReference2.setReferredSemanticId( aasReferenceParent ); - - Extension aasExtension = new Extension(); - aasExtension.setSemanticId( aasReference ); - aasExtension.setSupplementalSemanticIds( List.of(aasReference) ); - aasExtension.setValue( "AAS extension value" ); - aasExtension.setName( "AAS extension name" ); - aasExtension.setValueType( DataTypeDefXsd.ANYURI ); - aasExtension.setRefersTo( List.of(aasReference2) ); - assetAdministrationShellDescriptor.setExtensions( List.of(aasExtension) ); - ProtocolInformation protocolInformation = new ProtocolInformation(); protocolInformation.setEndpointProtocol("endpointProtocolExample"); protocolInformation.setHref("endpointAddressExample"); @@ -153,46 +109,16 @@ public static AssetAdministrationShellDescriptor createCompleteAasDescriptor() { key.setType(KeyTypes.SUBMODEL); key.setValue("semanticIdExample"); submodelSemanticReference.setKeys(List.of(key)); - - ReferenceParent semanticReferenceParent = new ReferenceParent(); - semanticReferenceParent.setKeys( List.of(key) ); - semanticReferenceParent.setType( ReferenceTypes.MODELREFERENCE ); - submodelSemanticReference.setKeys( List.of(key) ); - submodelSemanticReference.setReferredSemanticId( semanticReferenceParent ); + Reference submodelSupplemSemanticIdReference = new Reference(); submodelSupplemSemanticIdReference.setType( ReferenceTypes.EXTERNALREFERENCE ); Key submodelSupplemSemanticIdkey = new Key(); submodelSupplemSemanticIdkey.setType( KeyTypes.SUBMODEL ); submodelSupplemSemanticIdkey.setValue( "supplementalsemanticIdExample value" ); - - ReferenceParent submodelSupplemSemanticIdReferenceParent = new ReferenceParent(); - submodelSupplemSemanticIdReferenceParent.setKeys( List.of(submodelSupplemSemanticIdkey) ); - submodelSupplemSemanticIdReferenceParent.setType( ReferenceTypes.MODELREFERENCE ); submodelSupplemSemanticIdReference.setKeys( List.of(submodelSupplemSemanticIdkey) ); - submodelSupplemSemanticIdReference.setReferredSemanticId( submodelSupplemSemanticIdReferenceParent ); - Key submodelExtensionKey = new Key(); - submodelExtensionKey.setType( KeyTypes.SUBMODEL ); - submodelExtensionKey.setValue( "submodelExtensionIdExample" ); - - ReferenceParent sumodelExtensionParent = new ReferenceParent(); - sumodelExtensionParent.setType( ReferenceTypes.MODELREFERENCE ); - sumodelExtensionParent.setKeys( List.of(submodelExtensionKey) ); - - Reference submodelExtensionRef = new Reference(); - submodelExtensionRef.setType( ReferenceTypes.MODELREFERENCE ); - submodelExtensionRef.setReferredSemanticId( sumodelExtensionParent ); - submodelExtensionRef.setKeys( List.of(submodelExtensionKey) ); - - Extension submodelExtension = new Extension(); - submodelExtension.setRefersTo( List.of(submodelExtensionRef) ); - submodelExtension.setSupplementalSemanticIds( List.of(submodelExtensionRef) ); - submodelExtension.setName( "Submodel Extension name" ); - submodelExtension.setValue( "Submodel Extension value" ); - submodelExtension.setValueType( DataTypeDefXsd.STRING ); - submodelExtension.setSemanticId( submodelExtensionRef ); SubmodelDescriptor submodelDescriptor = new SubmodelDescriptor(); submodelDescriptor.setId(UUID.randomUUID().toString()); @@ -202,7 +128,6 @@ public static AssetAdministrationShellDescriptor createCompleteAasDescriptor() { submodelDescriptor.setSupplementalSemanticId( List.of(submodelSupplemSemanticIdReference) ); submodelDescriptor.setDescription(List.of(description1, description2)); submodelDescriptor.setEndpoints(List.of(endpoint)); - submodelDescriptor.setExtensions( List.of(submodelExtension) ); assetAdministrationShellDescriptor.setSubmodelDescriptors(List.of(submodelDescriptor)); return assetAdministrationShellDescriptor; } @@ -219,12 +144,7 @@ public static SubmodelDescriptor createSubmodel(){ key.setValue("semanticIdExample"); submodelSemanticReference.setKeys(List.of(key)); - ReferenceParent semanticReferenceParent = new ReferenceParent(); - semanticReferenceParent.setKeys( List.of(key) ); - semanticReferenceParent.setType( ReferenceTypes.MODELREFERENCE ); - submodelSemanticReference.setKeys( List.of(key) ); - submodelSemanticReference.setReferredSemanticId( semanticReferenceParent ); submodelDescriptor.setSemanticId(submodelSemanticReference); LangStringTextType description1 = new LangStringTextType(); @@ -256,38 +176,13 @@ public static SubmodelDescriptor createSubmodel(){ endpoint.setInterface("interfaceNameExample"); endpoint.setProtocolInformation(protocolInformation); - Key submodelExtensionKey = new Key(); - submodelExtensionKey.setType( KeyTypes.SUBMODEL ); - submodelExtensionKey.setValue( "submodelExtensionIdExample" ); - - ReferenceParent sumodelExtensionParent = new ReferenceParent(); - sumodelExtensionParent.setType( ReferenceTypes.MODELREFERENCE ); - sumodelExtensionParent.setKeys( List.of(submodelExtensionKey) ); - - Reference submodelExtensionRef = new Reference(); - submodelExtensionRef.setType( ReferenceTypes.MODELREFERENCE ); - submodelExtensionRef.setReferredSemanticId( sumodelExtensionParent ); - submodelExtensionRef.setKeys( List.of(submodelExtensionKey) ); - Reference submodelSupplemSemanticIdReference = new Reference(); submodelSupplemSemanticIdReference.setType( ReferenceTypes.EXTERNALREFERENCE ); Key submodelSupplemSemanticIdkey = new Key(); submodelSupplemSemanticIdkey.setType( KeyTypes.SUBMODEL ); submodelSupplemSemanticIdkey.setValue( "supplementalsemanticIdExample value" ); - ReferenceParent submodelSupplemSemanticIdReferenceParent = new ReferenceParent(); - submodelSupplemSemanticIdReferenceParent.setKeys( List.of(submodelSupplemSemanticIdkey) ); - submodelSupplemSemanticIdReferenceParent.setType( ReferenceTypes.MODELREFERENCE ); submodelSupplemSemanticIdReference.setKeys( List.of(submodelSupplemSemanticIdkey) ); - submodelSupplemSemanticIdReference.setReferredSemanticId( submodelSupplemSemanticIdReferenceParent ); - - Extension submodelExtension = new Extension(); - submodelExtension.setRefersTo( List.of(submodelExtensionRef) ); - submodelExtension.setSupplementalSemanticIds( List.of(submodelExtensionRef) ); - submodelExtension.setName( "Submodel Extension name" ); - submodelExtension.setValue( "Submodel Extension value" ); - submodelExtension.setValueType( DataTypeDefXsd.STRING ); - submodelExtension.setSemanticId( submodelExtensionRef ); - submodelDescriptor.setExtensions( List.of(submodelExtension) ); + submodelDescriptor.setSupplementalSemanticId( List.of(submodelSupplemSemanticIdReference) ); submodelDescriptor.setDescription(List.of(description1, description2)); submodelDescriptor.setDisplayName( List.of(displayName) ); @@ -300,21 +195,12 @@ public static SpecificAssetId createSpecificAssetId(){ specificAssetId1.setName("identifier1KeyExample"); specificAssetId1.setValue("identifier1ValueExample"); - Key assetIdKey = new Key(); - assetIdKey.setType( KeyTypes.BASICEVENTELEMENT ); - assetIdKey.setValue( "assetIdKey value" ); - - ReferenceParent assetIdParent = new ReferenceParent(); - assetIdParent.setType( ReferenceTypes.EXTERNALREFERENCE ); - assetIdParent.setKeys( List.of(assetIdKey) ); - Reference reference = new Reference(); reference.setType(ReferenceTypes.EXTERNALREFERENCE); Key key = new Key(); key.setType(KeyTypes.SUBMODEL); key.setValue("key"); reference.setKeys(List.of(key)); - reference.setReferredSemanticId( assetIdParent ); specificAssetId1.setSupplementalSemanticIds(List.of(reference)); specificAssetId1.setExternalSubjectId(reference ); @@ -333,14 +219,6 @@ public static SpecificAssetId createSpecificAssetId(String name, String value, S key.setType(KeyTypes.SUBMODEL); key.setValue(externalSubjectId); reference.setKeys(List.of(key)); - - ReferenceParent specificAssetIdRefParent = new ReferenceParent(); - specificAssetIdRefParent.setType( ReferenceTypes.EXTERNALREFERENCE ); - Key specificAssetIdParentKey = new Key(); - specificAssetIdParentKey.setValue( "specificAssetId ReferenceParent key" ); - specificAssetIdParentKey.setType( KeyTypes.ASSETADMINISTRATIONSHELL ); - specificAssetIdRefParent.setKeys( List.of(specificAssetIdParentKey) ); - reference.setReferredSemanticId( specificAssetIdRefParent ); specificAssetId1.setExternalSubjectId(reference); } @@ -348,14 +226,9 @@ public static SpecificAssetId createSpecificAssetId(String name, String value, S assetIdKey.setType( KeyTypes.BASICEVENTELEMENT ); assetIdKey.setValue( "assetIdKey value" ); - ReferenceParent assetIdParent = new ReferenceParent(); - assetIdParent.setType( ReferenceTypes.EXTERNALREFERENCE ); - assetIdParent.setKeys( List.of(assetIdKey) ); - Reference assetIdReference = new Reference(); assetIdReference.setType( ReferenceTypes.EXTERNALREFERENCE ); assetIdReference.setKeys( List.of(assetIdKey) ); - assetIdReference.setReferredSemanticId( assetIdParent ); specificAssetId1.setSemanticId( assetIdReference); specificAssetId1.setSupplementalSemanticIds( List.of(assetIdReference) ); return specificAssetId1; diff --git a/backend/src/test/java/org/eclipse/tractusx/semantics/registry/mapper/ShellMapperTest.java b/backend/src/test/java/org/eclipse/tractusx/semantics/registry/mapper/ShellMapperTest.java index 7a7319ba..ea619623 100644 --- a/backend/src/test/java/org/eclipse/tractusx/semantics/registry/mapper/ShellMapperTest.java +++ b/backend/src/test/java/org/eclipse/tractusx/semantics/registry/mapper/ShellMapperTest.java @@ -78,16 +78,6 @@ public void testMapFromApiExpectSuccess() { assertThat(submodel.getDisplayNames().stream().findFirst().get().getLanguage()) .isEqualTo( submodelDescriptor.getDisplayName().stream().findFirst().get().getLanguage() ); - assertThat( submodel.getSubmodelExtensions()).hasSize( 1 ); - SubmodelExtension submodelExtension = submodel.getSubmodelExtensions().stream().findFirst().get(); - assertThat(submodelExtension.getName() ).isEqualTo( submodelDescriptor.getExtensions().get( 0 ).getName() ); - assertThat(submodelExtension.getValue() ).isEqualTo( submodelDescriptor.getExtensions().get( 0 ).getValue() ); - assertThat(submodelExtension.getValueType().toString()).isEqualTo( submodelDescriptor.getExtensions().get(0).getValueType().toString() ); - assertThat( submodelExtension.getSubmodSemanticId().getType().toString() ) - .isEqualTo( submodelDescriptor.getExtensions().get( 0 ).getSemanticId().getType().toString() ); - assertThat( submodelExtension.getRefersTo() ).hasSize( 1 ); - assertThat( submodelExtension.getSubmodSupplementalIds() ).hasSize( 1 ); - assertThat( submodel.getSemanticId().getReferredSemanticId().getType().toString()).isEqualTo( "ModelReference" ); assertThat( submodel.getSemanticId().getKeys() ).hasSize( 1 ); assertThat(submodel.getSemanticId().getType().toString()).isEqualTo( "ExternalReference" ); assertThat(submodel.getSubmodelSupplemSemanticIds()).hasSize( 1 ); @@ -100,15 +90,8 @@ public void testMapFromApiExpectSuccess() { assertThat( shell.getShellKind().getValue() ).isEqualTo( aas.getAssetKind().getValue() ); assertThat(shell.getShellType()).isEqualTo( aas.getAssetType() ); assertThat(shell.getDisplayNames().stream().findFirst().get().getLanguage()).isEqualTo( aas.getDisplayName().stream().findFirst().get().getLanguage() ); - assertThat( shell.getShellExtensions() ).hasSize( 1 ); - ShellExtension shellExtension = shell.getShellExtensions().stream().findFirst().get(); - Extension aasExtension = aas.getExtensions().stream().findFirst().get(); - assertThat(shell.getShellExtensions()).hasSize( 1 ); - assertThat( shellExtension.getName() ).isEqualTo(aasExtension.getName() ); - assertThat( shellExtension.getRefersTo() ).hasSize( 1 ); - assertThat( shellExtension.getSupplementalSemanticIds() ).hasSize( 1 ); - assertThat(shellExtension.getSupplementalSemanticIds().stream().findFirst().get().getType()).isEqualTo( ReferenceType.EXTERNALREFERENCE ); - assertThat( shell.getIdentifiers() ).hasSize( 3 ); + + assertThat( shell.getIdentifiers() ).hasSize( 3 ); ShellIdentifier shellIdentifier = shell.getIdentifiers().stream().filter( shellIdentifier1 -> shellIdentifier1.getSemanticId() != null ).findFirst().get(); assertThat( shellIdentifier.getSemanticId().getType().getValue() ) .isEqualTo( aas.getSpecificAssetIds().get( 0 ).getSemanticId().getType().getValue() ); @@ -160,19 +143,11 @@ public void testMapToApiExpectSuccess() { .isEqualTo( apiSubmodelDescriptor.getDisplayName().stream().findFirst().get().getLanguage() ); assertThat( submodel.getDisplayNames().stream().findFirst().get().getText() ) .isEqualTo( apiSubmodelDescriptor.getDisplayName().stream().findFirst().get().getText() ); - assertThat( apiSubmodelDescriptor.getSemanticId().getReferredSemanticId().getKeys() ).hasSize( 1 ); assertThat(apiSubmodelDescriptor.getSemanticId().getKeys().get( 0 ).getValue()).isEqualTo( "submodelSemanticIdReferenceKey value" ); assertThat(apiSubmodelDescriptor.getSemanticId().getType().toString()).isEqualTo( submodel.getSemanticId().getType().toString() ); assertThat(apiSubmodelDescriptor.getSupplementalSemanticId()).hasSize( 1 ); assertThat(apiSubmodelDescriptor.getSupplementalSemanticId().get( 0 ).getType().toString()) .isEqualTo(submodel.getSubmodelSupplemSemanticIds().stream().findFirst().get().getType().toString()); - Extension submodelDescriptorExtension = apiSubmodelDescriptor.getExtensions().get( 0 ); - SubmodelExtension submodelExtension = submodel.getSubmodelExtensions().stream().findFirst().get(); - assertThat( apiSubmodelDescriptor.getExtensions() ).hasSize( 1 ); - assertThat(submodelDescriptorExtension.getName()).isEqualTo(submodelExtension.getName()); - assertThat( submodelDescriptorExtension.getValueType().toString() ).isEqualTo( submodelExtension.getValueType().toString() ); - assertThat( submodelDescriptorExtension.getRefersTo() ).hasSize( 1 ); - assertThat( submodelDescriptorExtension.getSupplementalSemanticIds() ).hasSize( 1 ); assertThat( aas.getAssetKind().equals( shell.getShellKind() ) ); assertThat( aas.getAssetType().equals( shell.getShellType() ) ); assertThat( aas.getDisplayName()).hasSize( 1 ); @@ -183,55 +158,39 @@ public void testMapToApiExpectSuccess() { .isEqualTo( shell.getIdentifiers().stream().findFirst().get().getSemanticId().getType().getValue() ); assertThat(aas.getSpecificAssetIds().get( 0 ).getExternalSubjectId() ).isNotNull(); assertThat(aas.getSpecificAssetIds().get( 0 ).getExternalSubjectId().getKeys().get( 0 ).getValue() ).isEqualTo( "specificExternalSubjectId" ); - assertThat( aas.getExtensions() ).hasSize( 1 ); - Extension aasExtension = aas.getExtensions().stream().findFirst().get(); - assertThat( aasExtension.getName() ).isEqualTo( shell.getShellExtensions().stream().findFirst().get().getName() ); - assertThat( aasExtension.getRefersTo() ).hasSize( 1 ); - assertThat( aasExtension.getSupplementalSemanticIds() ).hasSize( 1 ); - assertThat( aasExtension.getSupplementalSemanticIds().get( 0 ).getType() ).isEqualTo( ReferenceTypes.EXTERNALREFERENCE ); } private Shell createCompleteShell() { //ShellIdentifierExternalSubjectReference -> ExternalSubjectID ShellIdentifierExternalSubjectReferenceKey externalSubjectReferenceKey = - new ShellIdentifierExternalSubjectReferenceKey(UUID.randomUUID(),ReferenceKeyType.ASSETADMINISTRATIONSHELL, "specificExternalSubjectId",null,null ); - - ShellIdentifierExternalSubjectReferenceParent externalSubjectReferenceParent = - new ShellIdentifierExternalSubjectReferenceParent( UUID.randomUUID(),ReferenceType.MODELREFERENCE, Set.of(externalSubjectReferenceKey),null ); + new ShellIdentifierExternalSubjectReferenceKey(UUID.randomUUID(),ReferenceKeyType.ASSETADMINISTRATIONSHELL, "specificExternalSubjectId",null ); ShellIdentifierExternalSubjectReference externalSubjectReference = new ShellIdentifierExternalSubjectReference(UUID.randomUUID(), ReferenceType.MODELREFERENCE, Set.of(externalSubjectReferenceKey), - externalSubjectReferenceParent,null); + null); ShellIdentifierSemanticReferenceKey identifierSemanticReferenceKey = - new ShellIdentifierSemanticReferenceKey(UUID.randomUUID(), ReferenceKeyType.SUBMODEL, "semanticReferenceId",null,null); - - ShellIdentifierSemanticReferenceParent identifierSemanticReferenceParent = - new ShellIdentifierSemanticReferenceParent(UUID.randomUUID(),ReferenceType.MODELREFERENCE, Set.of(identifierSemanticReferenceKey),null); + new ShellIdentifierSemanticReferenceKey(UUID.randomUUID(), ReferenceKeyType.SUBMODEL, "semanticReferenceId",null); ShellIdentifierSemanticReference identifierSemanticReference = new ShellIdentifierSemanticReference( UUID.randomUUID(), ReferenceType.MODELREFERENCE, Set.of(identifierSemanticReferenceKey), - identifierSemanticReferenceParent,null + null ); ShellIdentifierSupplemSemanticReferenceKey shellIdentifierSupplemSemanticReferenceKey = new ShellIdentifierSupplemSemanticReferenceKey(UUID.randomUUID(), ReferenceKeyType.ASSETADMINISTRATIONSHELL, - "supplemental semantic reference key",null,null); - ShellIdentifierSupplemSemanticReferenceParent shellIdentifierSupplemSemanticReferenceParent = - new ShellIdentifierSupplemSemanticReferenceParent( - UUID.randomUUID(), - ReferenceType.MODELREFERENCE, - Set.of(shellIdentifierSupplemSemanticReferenceKey),null ); + "supplemental semantic reference key",null); + ShellIdentifierSupplemSemanticReference shellIdentifierSupplemSemanticReference = new ShellIdentifierSupplemSemanticReference( UUID.randomUUID(), ReferenceType.EXTERNALREFERENCE, Set.of(shellIdentifierSupplemSemanticReferenceKey), - shellIdentifierSupplemSemanticReferenceParent,null ); + null ); ShellIdentifier shellIdentifier1 = new ShellIdentifier( UUID.randomUUID(), "key1", "value1", externalSubjectReference, null, identifierSemanticReference , Set.of(shellIdentifierSupplemSemanticReference)); ShellIdentifier shellIdentifier2 = new ShellIdentifier( UUID.randomUUID(), "key1", "value2", externalSubjectReference, null, identifierSemanticReference , Set.of(shellIdentifierSupplemSemanticReference)); @@ -245,71 +204,20 @@ private Shell createCompleteShell() { Set shellDescriptions = Set.of(shellDescription1, shellDescription2); - SubmodelExtensionRefersToReferenceKey submodelExtensionRefersToReferenceKey = new SubmodelExtensionRefersToReferenceKey( - UUID.randomUUID(), - ReferenceKeyType.ANNOTATEDRELATIONSHIPELEMENT, - "submodelExtensionRefersToReferenceKey value",null,null ); - - SubmodelExtensionRefersToReferenceParent submodelExtensionRefersToReferenceParent = new SubmodelExtensionRefersToReferenceParent( - UUID.randomUUID(), - ReferenceType.EXTERNALREFERENCE, - Set.of(submodelExtensionRefersToReferenceKey),null ); - - SubmodelExtensionRefersToReference submodelExtensionRefersToReference = new SubmodelExtensionRefersToReference( - UUID.randomUUID(),ReferenceType.EXTERNALREFERENCE, - Set.of(submodelExtensionRefersToReferenceKey), - submodelExtensionRefersToReferenceParent,null ); - - SubmodelExtensionSupplemSemanticIdReferenceKey submodelExtensionSupplemSemanticIdReferenceKey = new SubmodelExtensionSupplemSemanticIdReferenceKey( - UUID.randomUUID(), - ReferenceKeyType.ANNOTATEDRELATIONSHIPELEMENT, - "SubmodelExtensionSupplemSemanticIdReferenceKey value",null,null ); - - SubmodelExtensionSupplemSemanticIdReferenceParent submodelExtensionSupplemSemanticIdReferenceParent = new SubmodelExtensionSupplemSemanticIdReferenceParent( - UUID.randomUUID(), - ReferenceType.EXTERNALREFERENCE, - Set.of(submodelExtensionSupplemSemanticIdReferenceKey),null ); - - SubmodelExtensionSupplemSemanticIdReference submodelExtensionSupplemSemanticIdReference = new SubmodelExtensionSupplemSemanticIdReference( - UUID.randomUUID(),ReferenceType.EXTERNALREFERENCE, - Set.of(submodelExtensionSupplemSemanticIdReferenceKey), - submodelExtensionSupplemSemanticIdReferenceParent,null ); - - SubmodelExtensionSemanticIdReferenceKey submodelExtensionSemanticIdReferenceKey = new SubmodelExtensionSemanticIdReferenceKey( - UUID.randomUUID(), - ReferenceKeyType.ANNOTATEDRELATIONSHIPELEMENT, - "SubmodelExtensionSemanticIdReferenceKey value",null,null ); - - SubmodelExtensionSemanticIdReferenceParent submodelExtensionSemanticIdReferenceParent = new SubmodelExtensionSemanticIdReferenceParent( - UUID.randomUUID(), - ReferenceType.EXTERNALREFERENCE, - Set.of(submodelExtensionSemanticIdReferenceKey),null ); - - SubmodelExtensionSemanticIdReference submodelExtensionSemanticIdReference = new SubmodelExtensionSemanticIdReference( - UUID.randomUUID(),ReferenceType.EXTERNALREFERENCE, - Set.of(submodelExtensionSemanticIdReferenceKey), - submodelExtensionSemanticIdReferenceParent,null ); - SubmodelExtension submodelExtension = new SubmodelExtension( UUID.randomUUID(),submodelExtensionSemanticIdReference, Set.of(submodelExtensionSupplemSemanticIdReference), - "SubmodelExtension", DataTypeXsd.STRING,"SubmodelExtension value", Set.of(submodelExtensionRefersToReference),null ); - SubmodelDisplayName submodelDisplayName = new SubmodelDisplayName( UUID.randomUUID(), "de", "Submodel display name",null ); SubmodelSecurityAttribute submodelSecurityAttribute = new SubmodelSecurityAttribute( UUID.randomUUID(), SubmodelSecurityType.W3C_DID, "submodel security attribute key", "submodel security attribute value",null ); SubmodelSemanticIdReferenceKey submodelSemanticIdReferenceKey = - new SubmodelSemanticIdReferenceKey(UUID.randomUUID(),ReferenceKeyType.SUBMODEL,"submodelSemanticIdReferenceKey value",null,null ); + new SubmodelSemanticIdReferenceKey(UUID.randomUUID(),ReferenceKeyType.SUBMODEL,"submodelSemanticIdReferenceKey value",null ); - SubmodelSemanticIdReferenceParent submodelSemanticIdReferenceParent = - new SubmodelSemanticIdReferenceParent(UUID.randomUUID(), ReferenceType.EXTERNALREFERENCE, Set.of(submodelSemanticIdReferenceKey),null); - SubmodelSemanticIdReference submodelSemanticIdReference = new SubmodelSemanticIdReference( UUID.randomUUID(), ReferenceType.EXTERNALREFERENCE, Set.of(submodelSemanticIdReferenceKey), submodelSemanticIdReferenceParent,null); + SubmodelSemanticIdReference submodelSemanticIdReference = new SubmodelSemanticIdReference( UUID.randomUUID(), ReferenceType.EXTERNALREFERENCE, Set.of(submodelSemanticIdReferenceKey), null); SubmodelSupplemSemanticIdReferenceKey submodelSupplemSemanticIdReferenceKey = - new SubmodelSupplemSemanticIdReferenceKey(UUID.randomUUID(),ReferenceKeyType.SUBMODEL,"SubmodelSupplemSemanticIdReferenceKey value",null,null ); + new SubmodelSupplemSemanticIdReferenceKey(UUID.randomUUID(),ReferenceKeyType.SUBMODEL,"SubmodelSupplemSemanticIdReferenceKey value",null ); - SubmodelSupplemSemanticIdReferenceParent submodelSupplemSemanticIdReferenceParent = - new SubmodelSupplemSemanticIdReferenceParent(UUID.randomUUID(), ReferenceType.EXTERNALREFERENCE, Set.of(submodelSupplemSemanticIdReferenceKey),null); SubmodelSupplemSemanticIdReference submodelSupplemSemanticIdReference = new SubmodelSupplemSemanticIdReference( UUID.randomUUID(), ReferenceType.EXTERNALREFERENCE, Set.of(submodelSupplemSemanticIdReferenceKey), - submodelSupplemSemanticIdReferenceParent,null); + null); Submodel submodel = new Submodel(UUID.randomUUID(), "submodelIdExternal", "submodelIdShort", submodelSemanticIdReference, Set.of(new SubmodelDescription(UUID.randomUUID(), "en", "example submodel description",null)), Set.of(new SubmodelEndpoint(UUID.randomUUID(), "interfaceExample", @@ -317,32 +225,12 @@ private Shell createCompleteShell() { "endpointProtocolVersionExample", "subProtocolExample" , "subProtocolBodyExample", "subProtocolEncodingExample", Set.of(submodelSecurityAttribute),null - )), null, Set.of(submodelDisplayName), Set.of(submodelExtension), Set.of(submodelSupplemSemanticIdReference) ); + )), null, Set.of(submodelDisplayName), Set.of(submodelSupplemSemanticIdReference) ); ShellDisplayName shellDisplayName = new ShellDisplayName( UUID.randomUUID(), "de", "Display name",null ); - ShellExtensionRefersToReferenceKey refersToReferenceKey = - new ShellExtensionRefersToReferenceKey(UUID.randomUUID(), ReferenceKeyType.BLOB, "refersToReferenceKey value",null,null); - ShellExtensionRefersToReferenceParent refersToReferenceParent = - new ShellExtensionRefersToReferenceParent(UUID.randomUUID(), ReferenceType.EXTERNALREFERENCE, Set.of(refersToReferenceKey),null); - ShellExtensionRefersToReference refersToReference = - new ShellExtensionRefersToReference(UUID.randomUUID(), ReferenceType.EXTERNALREFERENCE, Set.of(refersToReferenceKey), refersToReferenceParent,null); - ShellExtensionSupplemSemanticIdReferenceKey supplemSemanticIdReferenceKey = - new ShellExtensionSupplemSemanticIdReferenceKey(UUID.randomUUID(), ReferenceKeyType.BLOB, "supplem SemanticIdReferenceKey value",null,null); - ShellExtensionSupplemSemanticIdReferenceParent supplemSemanticIdReferenceParent = - new ShellExtensionSupplemSemanticIdReferenceParent(UUID.randomUUID(), ReferenceType.EXTERNALREFERENCE, Set.of(supplemSemanticIdReferenceKey),null); - ShellExtensionSupplemSemanticIdReference supplemSemanticIdReference = - new ShellExtensionSupplemSemanticIdReference(UUID.randomUUID(), ReferenceType.EXTERNALREFERENCE, Set.of(supplemSemanticIdReferenceKey), supplemSemanticIdReferenceParent,null); - ShellExtensionSemanticIdReferenceKey semanticIdReferenceKey = - new ShellExtensionSemanticIdReferenceKey(UUID.randomUUID(), ReferenceKeyType.BLOB, "SemanticIdReferenceKey value",null,null); - ShellExtensionSemanticIdReferenceParent semanticIdReferenceParent = - new ShellExtensionSemanticIdReferenceParent(UUID.randomUUID(), ReferenceType.EXTERNALREFERENCE, Set.of(semanticIdReferenceKey),null); - ShellExtensionSemanticIdReference semanticIdReference = - new ShellExtensionSemanticIdReference(UUID.randomUUID(), ReferenceType.EXTERNALREFERENCE, Set.of(semanticIdReferenceKey), semanticIdReferenceParent,null); - - ShellExtension shellExtension = new ShellExtension( UUID.randomUUID(), "shell extension", "shell extension value", DataTypeXsd.BOOLEAN, semanticIdReference, Set.of(supplemSemanticIdReference), Set.of(refersToReference),null ); - return new Shell(UUID.randomUUID(), "idExternalExample", "idShortExample", - shellIdentifiers, shellDescriptions, Set.of(submodel),Set.of(shellDisplayName), null,null, ShellKind.INSTANCE, "shellType", Set.of(shellExtension)); + return new Shell(UUID.randomUUID(), "idExternalExample", "idShortExample", + shellIdentifiers, shellDescriptions, Set.of(submodel),Set.of(shellDisplayName), null,null, ShellKind.INSTANCE, "shellType"); } private AssetAdministrationShellDescriptor createCompleteAasDescriptor() { @@ -359,13 +247,7 @@ private AssetAdministrationShellDescriptor createCompleteAasDescriptor() { aasDisplayName.setText( "AAS Display Name" ); assetAdministrationShellDescriptor.setDisplayName(List.of( aasDisplayName) ); - org.eclipse.tractusx.semantics.aas.registry.model.ReferenceParent specificAssetIdParent - = new org.eclipse.tractusx.semantics.aas.registry.model.ReferenceParent(); - specificAssetIdParent.setType( ReferenceTypes.EXTERNALREFERENCE ); - Key specificAssetIdParentKey = new Key(); - specificAssetIdParentKey.setValue( "SpecificAssetId key RefernceParent key" ); - specificAssetIdParentKey.setType( KeyTypes.ASSETADMINISTRATIONSHELL ); - specificAssetIdParent.setKeys( List.of(specificAssetIdParentKey) ); + Reference specificAssetIdReference = new Reference(); specificAssetIdReference.setType( ReferenceTypes.EXTERNALREFERENCE ); @@ -373,7 +255,7 @@ private AssetAdministrationShellDescriptor createCompleteAasDescriptor() { specificAssetIdKey.setType( KeyTypes.ASSETADMINISTRATIONSHELL ); specificAssetIdKey.setValue( "SpecificAssetId key" ); specificAssetIdReference.setKeys( List.of(specificAssetIdKey) ); - specificAssetIdReference.setReferredSemanticId( specificAssetIdParent ); + Reference externalSubjectIdReference = new Reference(); externalSubjectIdReference.setType( ReferenceTypes.EXTERNALREFERENCE ); @@ -381,7 +263,6 @@ private AssetAdministrationShellDescriptor createCompleteAasDescriptor() { subjectIdKey.setType( KeyTypes.ASSETADMINISTRATIONSHELL ); subjectIdKey.setValue( "ExternalSubject key value" ); externalSubjectIdReference.setKeys( List.of(subjectIdKey) ); - externalSubjectIdReference.setReferredSemanticId( specificAssetIdParent ); SpecificAssetId specificAssetId1 = new SpecificAssetId(); specificAssetId1.setName( "identifier1KeyExample" ); @@ -405,13 +286,6 @@ private AssetAdministrationShellDescriptor createCompleteAasDescriptor() { description2.setText("this is an example description2" ); assetAdministrationShellDescriptor.setDescription(List.of(description1, description2)); - org.eclipse.tractusx.semantics.aas.registry.model.ReferenceParent aasReferenceParent - = new org.eclipse.tractusx.semantics.aas.registry.model.ReferenceParent(); - aasReferenceParent.setType( ReferenceTypes.EXTERNALREFERENCE ); - Key parentKey = new Key(); - parentKey.setValue( "AAS RefernParent key" ); - parentKey.setType( KeyTypes.ASSETADMINISTRATIONSHELL ); - aasReferenceParent.setKeys( List.of(parentKey) ); Reference aasReference = new Reference(); aasReference.setType( ReferenceTypes.EXTERNALREFERENCE ); @@ -419,16 +293,6 @@ private AssetAdministrationShellDescriptor createCompleteAasDescriptor() { aasKey.setType( KeyTypes.ASSETADMINISTRATIONSHELL ); aasKey.setValue( "AAS extension key" ); aasReference.setKeys( List.of(aasKey) ); - aasReference.setReferredSemanticId( aasReferenceParent ); - - Extension aasExtension = new Extension(); - aasExtension.setSemanticId( aasReference ); - aasExtension.setSupplementalSemanticIds( List.of(aasReference) ); - aasExtension.setValue( "AAS extension value" ); - aasExtension.setName( "AAS extension name" ); - aasExtension.setValueType( DataTypeDefXsd.ANYURI ); - aasExtension.setRefersTo( List.of(aasReference) ); - assetAdministrationShellDescriptor.setExtensions( List.of(aasExtension) ); ProtocolInformation protocolInformation = new ProtocolInformation(); protocolInformation.setEndpointProtocol("endpointProtocolExample"); @@ -451,12 +315,8 @@ private AssetAdministrationShellDescriptor createCompleteAasDescriptor() { Key key = new Key(); key.setType( KeyTypes.SUBMODEL ); key.setValue( "semanticId Example" ); - ReferenceParent semanticReferenceParent = new ReferenceParent(); - semanticReferenceParent.setKeys( List.of(key) ); - semanticReferenceParent.setType( ReferenceTypes.MODELREFERENCE ); submodelSemanticReference.setKeys( List.of(key) ); - submodelSemanticReference.setReferredSemanticId( semanticReferenceParent ); Reference submodelSupplemSemanticIdReference = new Reference(); submodelSupplemSemanticIdReference.setType( ReferenceTypes.EXTERNALREFERENCE ); @@ -464,34 +324,11 @@ private AssetAdministrationShellDescriptor createCompleteAasDescriptor() { submodelSupplemSemanticIdkey.setType( KeyTypes.SUBMODEL ); submodelSupplemSemanticIdkey.setValue( "supplementalsemanticIdExample value" ); - ReferenceParent submodelSupplemSemanticIdReferenceParent = new ReferenceParent(); - submodelSupplemSemanticIdReferenceParent.setKeys( List.of(submodelSupplemSemanticIdkey) ); - submodelSupplemSemanticIdReferenceParent.setType( ReferenceTypes.MODELREFERENCE ); - submodelSupplemSemanticIdReference.setKeys( List.of(submodelSupplemSemanticIdkey) ); - submodelSupplemSemanticIdReference.setReferredSemanticId( submodelSupplemSemanticIdReferenceParent ); - - Key submodelExtensionKey = new Key(); - submodelExtensionKey.setType( KeyTypes.SUBMODEL ); - submodelExtensionKey.setValue( "submodelExtensionIdExample" ); - - org.eclipse.tractusx.semantics.aas.registry.model.ReferenceParent sumodelExtensionParent - = new org.eclipse.tractusx.semantics.aas.registry.model.ReferenceParent(); - sumodelExtensionParent.setType( ReferenceTypes.MODELREFERENCE ); - sumodelExtensionParent.setKeys( List.of(submodelExtensionKey) ); Reference submodelExtensionRef = new Reference(); submodelExtensionRef.setType( ReferenceTypes.MODELREFERENCE ); - submodelExtensionRef.setReferredSemanticId( sumodelExtensionParent ); - submodelExtensionRef.setKeys( List.of(submodelExtensionKey) ); - - Extension submodelExtension = new Extension(); - submodelExtension.setRefersTo( List.of(submodelExtensionRef) ); - submodelExtension.setSupplementalSemanticIds( List.of(submodelExtensionRef) ); - submodelExtension.setName( "Submodel Extension name" ); - submodelExtension.setValue( "Submodel Extension value" ); - submodelExtension.setValueType( DataTypeDefXsd.STRING ); - submodelExtension.setSemanticId( submodelExtensionRef ); + SubmodelDescriptor submodelDescriptor = new SubmodelDescriptor(); submodelDescriptor.setId( "identificationExample"); submodelDescriptor.setIdShort("idShortExample"); @@ -503,7 +340,7 @@ private AssetAdministrationShellDescriptor createCompleteAasDescriptor() { submodelDescriptor.setSemanticId(submodelSemanticReference); submodelDescriptor.setDescription(List.of(description1, description2)); submodelDescriptor.setEndpoints(List.of(endpoint)); - submodelDescriptor.setExtensions( List.of(submodelExtension) ); + submodelDescriptor.setSupplementalSemanticId( List.of(submodelSupplemSemanticIdReference) ); assetAdministrationShellDescriptor.setSubmodelDescriptors(List.of(submodelDescriptor)); return assetAdministrationShellDescriptor; From 9c4afc6d545f432dba02ac522ac3602760db0760 Mon Sep 17 00:00:00 2001 From: "Aggarwal Sahil (BCI/ESW17)" Date: Thu, 10 Aug 2023 10:41:47 +0200 Subject: [PATCH 2/4] removed /query from lookup api --- .../AssetAdministrationShellApiDelegate.java | 1 - .../static/aas-registry-openapi.yaml | 28 ------------------- 2 files changed, 29 deletions(-) diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/controller/AssetAdministrationShellApiDelegate.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/controller/AssetAdministrationShellApiDelegate.java index 25dd93e6..59e263e1 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/controller/AssetAdministrationShellApiDelegate.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/controller/AssetAdministrationShellApiDelegate.java @@ -173,7 +173,6 @@ public ResponseEntity> postAllAssetLinksById(byte[] aasIde return new ResponseEntity<>(list, HttpStatus.CREATED); } - @Override public ResponseEntity> postQueryAllAssetAdministrationShellIds(ShellLookup shellLookup,@RequestHeader String externalSubjectId) { List assetIds = shellLookup.getQuery().getAssetIds(); List externalIds = shellService.findExternalShellIdsByIdentifiersByAnyMatch(shellMapper.fromApiDto(assetIds),getExternalSubjectIdOrEmpty(externalSubjectId)); diff --git a/backend/src/main/resources/static/aas-registry-openapi.yaml b/backend/src/main/resources/static/aas-registry-openapi.yaml index 3138544d..045c51f6 100644 --- a/backend/src/main/resources/static/aas-registry-openapi.yaml +++ b/backend/src/main/resources/static/aas-registry-openapi.yaml @@ -834,34 +834,6 @@ paths: description: Asset identifier key-value-pairs deleted successfully x-semanticIds: - https://admin-shell.io/aas/API/DeleteAllAssetLinksById/1/0/RC02 - /lookup/shells/query: - post: - tags: - - Registry and Discovery Interface - summary: Returns a list of Asset Administration Shell ids based on Asset identifier key-value-pairs. - operationId: PostQueryAllAssetAdministrationShellIds - parameters: - - $ref: '#/components/parameters/ExternalSubjectIdHeader' - requestBody: - description: Asset Administration Shell Descriptor object - content: - application/json: - schema: - $ref: '#/components/schemas/ShellLookup' - required: true - responses: - "200": - description: Requested Asset Administration Shell ids - content: - application/json: - schema: - type: array - maxItems: 10000 - items: - $ref: '#/components/schemas/Identifier' - examples: - complete: - $ref: '#/components/examples/lookup-shells-by-aas-identifier-response' components: securitySchemes: bearerAuth: From d1c1f73bce86c551ab169622d660fe12f534d24c Mon Sep 17 00:00:00 2001 From: "Aggarwal Sahil (BCI/ESW17)" Date: Thu, 10 Aug 2023 10:44:31 +0200 Subject: [PATCH 3/4] Added new version to CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e4cb042..dfa8a756 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.3.14-M1 +### Added + +## fixed +- Refactored existing models to align with AAS 3.0. Removed /query from lookup api. + ## 0.3.13-M1 ### Added - In this version the models have been adjusted to new version AAS 3.0. From aa78dc173f88935db05a1c053b8f4f9279a6840b Mon Sep 17 00:00:00 2001 From: "Aggarwal Sahil (BCI/ESW17)" Date: Mon, 14 Aug 2023 12:06:28 +0200 Subject: [PATCH 4/4] refactored openapi yml file --- CHANGELOG.md | 7 +-- .../AssetAdministrationShellApiDelegate.java | 4 ++ .../static/aas-registry-openapi.yaml | 49 +++---------------- 3 files changed, 13 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfa8a756..ada332b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,17 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 0.3.14-M1 -### Added - -## fixed -- Refactored existing models to align with AAS 3.0. Removed /query from lookup api. - ## 0.3.13-M1 ### Added - In this version the models have been adjusted to new version AAS 3.0. ## fixed +- Refactored existing models to align with AAS 3.0. Removed /query from lookup api because it is not a part of AAS 3.0 version. ## 0.3.12-M1 ### Added diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/controller/AssetAdministrationShellApiDelegate.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/controller/AssetAdministrationShellApiDelegate.java index 59e263e1..0d40b248 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/controller/AssetAdministrationShellApiDelegate.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/controller/AssetAdministrationShellApiDelegate.java @@ -173,6 +173,10 @@ public ResponseEntity> postAllAssetLinksById(byte[] aasIde return new ResponseEntity<>(list, HttpStatus.CREATED); } + /** + * Since /query is not part of AAS 3.0, so this method is not used. + * Keeping it for the reason that it might come up in next version. + */ public ResponseEntity> postQueryAllAssetAdministrationShellIds(ShellLookup shellLookup,@RequestHeader String externalSubjectId) { List assetIds = shellLookup.getQuery().getAssetIds(); List externalIds = shellService.findExternalShellIdsByIdentifiersByAnyMatch(shellMapper.fromApiDto(assetIds),getExternalSubjectIdOrEmpty(externalSubjectId)); diff --git a/backend/src/main/resources/static/aas-registry-openapi.yaml b/backend/src/main/resources/static/aas-registry-openapi.yaml index 045c51f6..6a79885a 100644 --- a/backend/src/main/resources/static/aas-registry-openapi.yaml +++ b/backend/src/main/resources/static/aas-registry-openapi.yaml @@ -924,7 +924,7 @@ components: required: - id type: object - example: {"description":[{"language":"de","text":"hello text"},{"language":"en","text":"hello s"}],"displayName":[{"language":"de","text":"this is an example description1"}],"extensions":[{"supplementalSemanticIds":[{"type":"ExternalReference","keys":[{"type":"Submodel","value":"semanticIdExample"}]}],"refersTo":[{"type":"ExternalReference","keys":[{"type":"Submodel","value":"semanticIdExample"}]}]}],"endpoints":[{"interface":"interfaceNameExample","protocolInformation":{"href":"endpointAddressExample","endpointProtocol":"endpointProtocolExample","endpointProtocolVersion":["e"],"subprotocol":"subprotocolExample","subprotocolBody":"subprotocolBodyExample","subprotocolBodyEncoding":"subprotocolBodyExample","securityAttributes":[{"type":"NONE"}]}}],"idShort":"idShortExample","id":"e1eba3d7-91f0-4dac-a730-eaa1d35e035c","specificAssetIds":[{"supplementalSemanticIds":[{"type":"ExternalReference","keys":[{"type":"Submodel","value":"semanticIdExample"}]}],"name":"identifier1KeyExample","value":"identifier1ValueExample"},{"supplementalSemanticIds":[{"type":"ExternalReference","keys":[{"type":"Submodel","value":"semanticIdExample"}]}],"name":"identifier2KeyExample","value":"identifier2ValueExample"}],"submodelDescriptors":[{"endpoints":[{"interface":"interfaceNameExample","protocolInformation":{"href":"endpointAddressExample","endpointProtocol":"endpointProtocolExample","endpointProtocolVersion":["e"],"subprotocol":"subprotocolExample","subprotocolBody":"subprotocolBodyExample","subprotocolBodyEncoding":"subprotocolBodyExample","securityAttributes":[{"type":"NONE"}]}}],"idShort":"idShortExample","id":"cd47615b-daf3-4036-8670-d2f89349d388","semanticId":{"type":"ExternalReference","keys":[{"type":"Submodel","value":"semanticIdExample"}]},"description":[{"language":"de","text":"hello text"},{"language":"en","text":"hello s"}]}]} + example: {"description":[{"language":"de","text":"hello text"},{"language":"en","text":"hello s"}],"displayName":[{"language":"de","text":"this is an example description1"}],"endpoints":[{"interface":"interfaceNameExample","protocolInformation":{"href":"endpointAddressExample","endpointProtocol":"endpointProtocolExample","endpointProtocolVersion":["e"],"subprotocol":"subprotocolExample","subprotocolBody":"subprotocolBodyExample","subprotocolBodyEncoding":"subprotocolBodyExample","securityAttributes":[{"type":"NONE","key": "Security Attribute key","value": "Security Attribute value"}]}}],"idShort":"idShortExample","id":"e1eba3d7-91f0-4dac-a730-eaa1d35e035c","specificAssetIds":[{"supplementalSemanticIds":[{"type":"ExternalReference","keys":[{"type":"Submodel","value":"semanticIdExample"}]}],"name":"identifier1KeyExample","value":"identifier1ValueExample"},{"supplementalSemanticIds":[{"type":"ExternalReference","keys":[{"type":"Submodel","value":"semanticIdExample"}]}],"name":"identifier2KeyExample","value":"identifier2ValueExample"}],"submodelDescriptors":[{"endpoints":[{"interface":"interfaceNameExample","protocolInformation":{"href":"endpointAddressExample","endpointProtocol":"endpointProtocolExample","endpointProtocolVersion":["e"],"subprotocol":"subprotocolExample","subprotocolBody":"subprotocolBodyExample","subprotocolBodyEncoding":"subprotocolBodyExample","securityAttributes":[{"type":"NONE","key": "Security Attribute key","value": "Security Attribute value"}]}}],"idShort":"idShortExample","id":"cd47615b-daf3-4036-8670-d2f89349d388","semanticId":{"type":"ExternalReference","keys":[{"type":"Submodel","value":"semanticIdExample"}]},"description":[{"language":"de","text":"hello text"},{"language":"en","text":"hello s"}]}]} allOf: - $ref: '#/components/schemas/Descriptor' - properties: @@ -979,12 +979,6 @@ components: maxItems: 10000 items: $ref: '#/components/schemas/LangStringNameType' - extensions: - minItems: 1 - maxItems: 10000 - type: array - items: - $ref: '#/components/schemas/Extension' example: { "endpoints": [ { "protocolInformation": { "endpointAddress": "https://localhost:1234", "endpointProtocolVersion": "1.1" }, "interface": "AAS-1.0" }, { "protocolInformation": { "endpointAddress": "opc.tcp://localhost:4840" }, "interface": "AAS-1.0" }, { "protocolInformation": { "endpointAddress": "https://localhost:5678", "endpointProtocolVersion": "1.1", "subprotocol": "OPC UA Basic SOAP", "subprotocolBody": "ns=2;s=MyAAS", "subprotocolBodyEncoding": "application/soap+xml" }, "interface": "AAS-1.0" } ] } LangStringTextType: allOf: @@ -1043,9 +1037,6 @@ components: Reference: allOf: - $ref: '#/components/schemas/ReferenceParent' - - properties: - referredSemanticId: - $ref: '#/components/schemas/ReferenceParent' ReferenceParent: properties: type: @@ -1327,6 +1318,9 @@ components: type: boolean Endpoint: type: object + required: + - interface + - protocolInformation properties: interface: maxLength: 128 @@ -1409,7 +1403,7 @@ components: type: array items: $ref: '#/components/schemas/Reference' - example: {"endpoints": [{"interface": "interfaceNameExample","protocolInformation": {"href": "endpointAddressExample","endpointProtocol": "endpointProtocolExample","endpointProtocolVersion": [ "e"],"subprotocol": "subprotocolExample","subprotocolBody": "subprotocolBodyExample","subprotocolBodyEncoding": "subprotocolBodyExample","securityAttributes": [{"type": "NONE" }]}}],"idShort": "idShortExample","id": "341f63de-728a-4b6d-9c72-c0d9ba4f8c7d","semanticId": {"type": "ExternalReference","keys": [{"type": "Submodel","value": "semanticIdExample"}]},"description": [{"language": "de","text": "hello text"},{"language": "en","text": "hello s"}]} + example: {"endpoints": [{"interface": "interfaceNameExample","protocolInformation": {"href": "endpointAddressExample","endpointProtocol": "endpointProtocolExample","endpointProtocolVersion": [ "e"],"subprotocol": "subprotocolExample","subprotocolBody": "subprotocolBodyExample","subprotocolBodyEncoding": "subprotocolBodyExample","securityAttributes": [{"type": "NONE","key": "Security Attribute key","value": "Security Attribute value" }]}}],"idShort": "idShortExample","id": "341f63de-728a-4b6d-9c72-c0d9ba4f8c7d","semanticId": {"type": "ExternalReference","keys": [{"type": "Submodel","value": "semanticIdExample"}]},"description": [{"language": "de","text": "hello text"},{"language": "en","text": "hello s"}]} allOf: - $ref: '#/components/schemas/Descriptor' Result: @@ -1621,16 +1615,7 @@ components: "type": "AnnotatedRelationshipElement", "value": "udbffFELY8AudbffZC3^WZ],;udbff^kud8005udbff2ud8002ud800Dud800j" } - ], - "referredSemanticId": { - "type": "ExternalReference", - "keys": [ - { - "type": "AnnotatedRelationshipElement", - "value": "=udbffJud800budbff4udbffiud800TZud800budbff6ud800sudbffudbff`udbff;qitud800[ud800Rkrud800edud8005Qud800UtSud800F5~ud800[4Jud800cud800:udbffOI8D1udbffIudbff3udbffAudbffpudbffi udbff;ud800kudbffG$udbff[%ud800?6udbffNud800;&udbffMudbffA0eMB*5:JXudbffoudbffQud800\\" - } - ] - } + ] }, "supplementalSemanticIds": [ { @@ -1640,16 +1625,7 @@ components: "type": "AnnotatedRelationshipElement", "value": "Sud800oud800n>NTud800mud800VpV<7rEKPhAudbff`qOudbff]ud800;aud800>udbffav^nudbff;iRudbffsud8002ud800cqut^" } - ], - "referredSemanticId": { - "type": "ExternalReference", - "keys": [ - { - "type": "AnnotatedRelationshipElement", - "value": "udbffVud800Eudbff9udbffYQ70Q!flyud800rudbffXudbffpZud8008q_Re?oA6cs'ud800u" - } - ] - } + ] } ], "name": "VCudbffB!ud800VkTudbffZdStPOud800:S:P0ud800Budbff;udbff1nootWudb", @@ -1661,16 +1637,7 @@ components: "type": "AnnotatedRelationshipElement", "value": "ud800\\pZLbimgkR[Tudbffpudb", } - ], - "referredSemanticId": { - "type": "ExternalReference", - "keys": [ - { - "type": "AnnotatedRelationshipElement", - "value": "5Iudbffjud800kudbff?m_$2ud800?udbff^h8udbff^HS$w@Uud8008Gudbfft0ehud800[4udbffoJZZudbffc3udbff4udbff@$ud800f3iud800Vud8005ud800G" - } - ] - } + ] } } ]