Skip to content

Commit

Permalink
refactored models for changes required
Browse files Browse the repository at this point in the history
  • Loading branch information
agg3fe committed Aug 9, 2023
1 parent 721a0de commit 6567619
Show file tree
Hide file tree
Showing 45 changed files with 261 additions and 3,233 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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<ShellIdentifier> fromApiDto(List<SpecificAssetId> apiDto);

@Mappings({
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -103,19 +92,6 @@ default List<String> protocolVersionDescriptor(String version){

LangStringTextType mapSubModelDescription (SubmodelDescription description);

@Mappings({
@Mapping(source = "submodelExtensions", target = "extensions"),
})
@InheritInverseConfiguration
List<SubmodelDescriptor> toApiDto( Set<Submodel> 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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,6 @@ public class Shell {
private ShellKind shellKind;
private String shellType;

@JsonManagedReference
@OneToMany(cascade = CascadeType.ALL, mappedBy = "shellId")
Set<ShellExtension> shellExtensions= new HashSet<>();

public void setShellExtensions(Set<ShellExtension> shellExtensions) {
if(shellExtensions==null) {shellExtensions = new HashSet<>();}
this.shellExtensions = shellExtensions;
for(ShellExtension s : shellExtensions) {
s.setShellId(this);
}
}

public void setDisplayNames(Set<ShellDisplayName> displayNames) {
if(displayNames==null) {displayNames = new HashSet<>();}
this.displayNames = displayNames;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6567619

Please sign in to comment.