From 53ffe9e73874ee9f522472b4847819634f1f91e0 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Tue, 2 Jan 2024 13:03:15 +0100 Subject: [PATCH] fix SwaggerUI issue with duplicate method name --- .../relationship/HsOfficeRelationshipController.java | 2 +- .../relationship/HsOfficeRelationshipRepository.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipController.java index 3d6332e3..98c6bccf 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipController.java @@ -51,7 +51,7 @@ public class HsOfficeRelationshipController implements HsOfficeRelationshipsApi final HsOfficeRelationshipTypeResource relationshipType) { context.define(currentUser, assumedRoles); - final var entities = relationshipRepo.findRelationshipRelatedToPersonUuid(personUuid, + final var entities = relationshipRepo.findRelationshipRelatedToPersonUuidAndRelationshipType(personUuid, mapper.map(relationshipType, HsOfficeRelationshipType.class)); final var resources = mapper.mapList(entities, HsOfficeRelationshipResource.class, diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipRepository.java b/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipRepository.java index a55f2272..d34caa8c 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipRepository.java @@ -12,22 +12,22 @@ public interface HsOfficeRelationshipRepository extends Repository findByUuid(UUID id); - default List findRelationshipRelatedToPersonUuid(@NotNull UUID personUuid, HsOfficeRelationshipType relationshipType) { - return findRelationshipRelatedToPersonUuid(personUuid, relationshipType.toString()); + default List findRelationshipRelatedToPersonUuidAndRelationshipType(@NotNull UUID personUuid, HsOfficeRelationshipType relationshipType) { + return findRelationshipRelatedToPersonUuidAndRelationshipTypeString(personUuid, relationshipType.toString()); } @Query(value = """ SELECT p.* FROM hs_office_relationship_rv AS p WHERE p.relAnchorUuid = :personUuid OR p.relHolderUuid = :personUuid """, nativeQuery = true) - List findRelationshipRelatedToPersonUuid2(@NotNull UUID personUuid); + List findRelationshipRelatedToPersonUuid(@NotNull UUID personUuid); @Query(value = """ SELECT p.* FROM hs_office_relationship_rv AS p WHERE (:relationshipType IS NULL OR p.relType = cast(:relationshipType AS HsOfficeRelationshipType)) AND ( p.relAnchorUuid = :personUuid OR p.relHolderUuid = :personUuid) """, nativeQuery = true) - List findRelationshipRelatedToPersonUuid(@NotNull UUID personUuid, String relationshipType); + List findRelationshipRelatedToPersonUuidAndRelationshipTypeString(@NotNull UUID personUuid, String relationshipType); HsOfficeRelationshipEntity save(final HsOfficeRelationshipEntity entity);