diff --git a/CHANGELOG.md b/CHANGELOG.md index 597c1369..1af4f70e 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.11-M1 +### Added + +## fixed +- In this version, a bug is fixed that occurred while fetching all the submodels for a Shell. + ## 0.3.10-M1 ### Added - In this new version, Base64 decoding is provided for the provided encoded parameters. All the provided path parameters has to be Base64 URL encoded. diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/utils/ShellSpecification.java b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/utils/ShellSpecification.java index 5a921e52..20577f3e 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/registry/utils/ShellSpecification.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/registry/utils/ShellSpecification.java @@ -20,6 +20,8 @@ package org.eclipse.tractusx.semantics.registry.utils; import java.time.Instant; +import java.util.UUID; + import org.springframework.data.jpa.domain.Specification; import jakarta.persistence.criteria.CriteriaBuilder; import jakarta.persistence.criteria.CriteriaQuery; @@ -35,17 +37,18 @@ public class ShellSpecification implements Specification { @Override public Predicate toPredicate( Root root, CriteriaQuery cq, CriteriaBuilder criteriaBuilder ) { - Predicate predicate = applyFilter( root, criteriaBuilder ); - cq.orderBy( criteriaBuilder.asc(criteriaBuilder.coalesce( root.get( sortFieldName ), Instant.now() ) )); - return predicate; + return applyFilter( root,cq, criteriaBuilder ); } - private Predicate applyFilter( Root root, CriteriaBuilder criteriaBuilder ) { + private Predicate applyFilter( Root root,CriteriaQuery cq, CriteriaBuilder criteriaBuilder ) { if(root.toString().contains( "Shell" )){ var searchValue = shellCursor.getShellSearchCursor(); + cq.orderBy( criteriaBuilder.asc( criteriaBuilder.coalesce( root.get( sortFieldName ), Instant.now() ) ) ); return criteriaBuilder.greaterThan( root.get( sortFieldName ), searchValue ); }else{ var searchValue = shellCursor.getSubmodelSearchCursor(); + cq.orderBy( criteriaBuilder.asc( criteriaBuilder.coalesce( root.get( sortFieldName ), + UUID.fromString( "00000000-0000-0000-0000-000000000000" )) ) ); return criteriaBuilder.greaterThan( root.get( sortFieldName ), searchValue ); } }