From c76085ef7dea5f2f9d37af40d9f9b8f24c3e6b56 Mon Sep 17 00:00:00 2001 From: Paulo Gomes da Cruz Junior Date: Fri, 20 Dec 2024 05:47:58 -0800 Subject: [PATCH] chore: fixing reflection --- .../SilvaGlobalConfiguration.java | 81 +++++++++++++++++++ .../ForestClientAutocompleteResultDto.java | 2 - .../results/common/dto/ForestClientDto.java | 2 - .../common/dto/ForestClientLocationDto.java | 2 - .../restapi/results/common/dto/IdNameDto.java | 2 - .../results/common/dto/OracleLogDto.java | 2 - .../common/dto/WmsLayersWhitelistUserDto.java | 2 - .../common/enums/ForestClientStatusEnum.java | 6 +- .../common/enums/ForestClientTypeEnum.java | 6 +- .../results/common/enums/YesNoEnum.java | 2 - .../converter/OpeningCategoryConverter.java | 6 +- .../converter/OpeningStatusConverter.java | 6 +- .../oracle/dto/CodeDescriptionDto.java | 2 - .../oracle/dto/OpeningSearchFiltersDto.java | 2 - .../oracle/dto/OpeningSearchResponseDto.java | 2 - .../results/oracle/dto/RecentOpeningDto.java | 3 +- .../oracle/entity/ClientAcronymEntity.java | 2 - .../entity/CutBlockOpenAdminEntity.java | 2 - .../oracle/entity/OpenCategoryCodeEntity.java | 2 - .../entity/OpeningAttachmentEntity.java | 2 - .../results/oracle/entity/OpeningEntity.java | 2 - .../results/oracle/entity/OrgUnitEntity.java | 2 - .../ResultsElectronicSubmissionEntity.java | 2 - .../oracle/enums/AuditActionCodeEnum.java | 2 - .../oracle/enums/OpeningCategoryEnum.java | 2 - .../oracle/enums/OpeningStatusEnum.java | 2 - .../postgres/dto/DashboardFiltersDto.java | 10 ++- .../dto/FreeGrowingMilestonesDto.java | 2 - .../dto/MyRecentActionsRequestsDto.java | 2 - .../postgres/dto/OpeningsPerYearDto.java | 4 +- .../postgres/dto/UserRecentOpeningDto.java | 2 - .../entity/OpeningsActivityEntity.java | 2 - .../entity/OpeningsActivityEntityId.java | 16 ++-- .../entity/OpeningsLastYearEntity.java | 2 - .../entity/OracleExtractionLogsEntity.java | 2 - .../postgres/entity/UserOpeningEntity.java | 2 - .../entity/UserRecentOpeningEntity.java | 22 +++-- .../META-INF/native-image/reflect-config.json | 4 + 38 files changed, 122 insertions(+), 96 deletions(-) diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/common/configuration/SilvaGlobalConfiguration.java b/backend/src/main/java/ca/bc/gov/restapi/results/common/configuration/SilvaGlobalConfiguration.java index 0f2d3dbf8..3d5a0d48e 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/common/configuration/SilvaGlobalConfiguration.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/common/configuration/SilvaGlobalConfiguration.java @@ -1,11 +1,92 @@ package ca.bc.gov.restapi.results.common.configuration; +import ca.bc.gov.restapi.results.common.dto.ForestClientAutocompleteResultDto; +import ca.bc.gov.restapi.results.common.dto.ForestClientDto; +import ca.bc.gov.restapi.results.common.dto.ForestClientLocationDto; +import ca.bc.gov.restapi.results.common.dto.IdNameDto; +import ca.bc.gov.restapi.results.common.dto.OracleLogDto; +import ca.bc.gov.restapi.results.common.dto.WmsLayersWhitelistUserDto; +import ca.bc.gov.restapi.results.common.enums.ForestClientStatusEnum; +import ca.bc.gov.restapi.results.common.enums.ForestClientTypeEnum; +import ca.bc.gov.restapi.results.common.enums.YesNoEnum; +import ca.bc.gov.restapi.results.common.pagination.PaginatedResult; +import ca.bc.gov.restapi.results.common.pagination.PaginationParameters; +import ca.bc.gov.restapi.results.oracle.converter.OpeningCategoryConverter; +import ca.bc.gov.restapi.results.oracle.converter.OpeningStatusConverter; +import ca.bc.gov.restapi.results.oracle.dto.CodeDescriptionDto; +import ca.bc.gov.restapi.results.oracle.dto.OpeningSearchFiltersDto; +import ca.bc.gov.restapi.results.oracle.dto.OpeningSearchResponseDto; +import ca.bc.gov.restapi.results.oracle.dto.RecentOpeningDto; +import ca.bc.gov.restapi.results.oracle.entity.ClientAcronymEntity; +import ca.bc.gov.restapi.results.oracle.entity.CutBlockOpenAdminEntity; +import ca.bc.gov.restapi.results.oracle.entity.OpenCategoryCodeEntity; +import ca.bc.gov.restapi.results.oracle.entity.OpeningAttachmentEntity; +import ca.bc.gov.restapi.results.oracle.entity.OpeningEntity; +import ca.bc.gov.restapi.results.oracle.entity.OrgUnitEntity; +import ca.bc.gov.restapi.results.oracle.entity.ResultsElectronicSubmissionEntity; +import ca.bc.gov.restapi.results.oracle.enums.AuditActionCodeEnum; +import ca.bc.gov.restapi.results.oracle.enums.OpeningCategoryEnum; +import ca.bc.gov.restapi.results.oracle.enums.OpeningStatusEnum; +import ca.bc.gov.restapi.results.postgres.dto.DashboardFiltersDto; +import ca.bc.gov.restapi.results.postgres.dto.FreeGrowingMilestonesDto; +import ca.bc.gov.restapi.results.postgres.dto.MyRecentActionsRequestsDto; +import ca.bc.gov.restapi.results.postgres.dto.OpeningsPerYearDto; +import ca.bc.gov.restapi.results.postgres.dto.UserRecentOpeningDto; +import ca.bc.gov.restapi.results.postgres.entity.OpeningsActivityEntity; +import ca.bc.gov.restapi.results.postgres.entity.OpeningsActivityEntityId; +import ca.bc.gov.restapi.results.postgres.entity.OpeningsLastYearEntity; +import ca.bc.gov.restapi.results.postgres.entity.OracleExtractionLogsEntity; +import ca.bc.gov.restapi.results.postgres.entity.UserOpeningEntity; +import ca.bc.gov.restapi.results.postgres.entity.UserOpeningEntityId; +import ca.bc.gov.restapi.results.postgres.entity.UserRecentOpeningEntity; import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; @Configuration +@RegisterReflectionForBinding({ + ForestClientAutocompleteResultDto.class, + ForestClientDto.class, + ForestClientLocationDto.class, + IdNameDto.class, + OracleLogDto.class, + WmsLayersWhitelistUserDto.class, + ForestClientStatusEnum.class, + ForestClientTypeEnum.class, + YesNoEnum.class, + PaginatedResult.class, + PaginationParameters.class, + OpeningCategoryConverter.class, + OpeningStatusConverter.class, + CodeDescriptionDto.class, + OpeningSearchFiltersDto.class, + OpeningSearchResponseDto.class, + RecentOpeningDto.class, + ClientAcronymEntity.class, + CutBlockOpenAdminEntity.class, + OpenCategoryCodeEntity.class, + OpeningAttachmentEntity.class, + OpeningEntity.class, + OrgUnitEntity.class, + ResultsElectronicSubmissionEntity.class, + AuditActionCodeEnum.class, + OpeningCategoryEnum.class, + OpeningStatusEnum.class, + DashboardFiltersDto.class, + FreeGrowingMilestonesDto.class, + MyRecentActionsRequestsDto.class, + OpeningsPerYearDto.class, + UserRecentOpeningDto.class, + OpeningsActivityEntity.class, + OpeningsActivityEntityId.class, + OpeningsLastYearEntity.class, + OracleExtractionLogsEntity.class, + UserOpeningEntity.class, + UserOpeningEntityId.class, + UserRecentOpeningEntity.class, +}) public class SilvaGlobalConfiguration { @Bean diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/ForestClientAutocompleteResultDto.java b/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/ForestClientAutocompleteResultDto.java index 7aa887d72..e14497998 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/ForestClientAutocompleteResultDto.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/ForestClientAutocompleteResultDto.java @@ -1,9 +1,7 @@ package ca.bc.gov.restapi.results.common.dto; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; -@RegisterReflectionForBinding @With public record ForestClientAutocompleteResultDto( String id, diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/ForestClientDto.java b/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/ForestClientDto.java index 9364c7b64..10dcd8ee2 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/ForestClientDto.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/ForestClientDto.java @@ -7,13 +7,11 @@ import java.util.stream.Stream; import lombok.Builder; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; import org.springframework.data.annotation.Transient; /** * This record represents a Forest Client object. */ -@RegisterReflectionForBinding @Builder @With public record ForestClientDto( diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/ForestClientLocationDto.java b/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/ForestClientLocationDto.java index da1a820f0..7bbac1d26 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/ForestClientLocationDto.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/ForestClientLocationDto.java @@ -3,9 +3,7 @@ import ca.bc.gov.restapi.results.common.enums.YesNoEnum; import java.time.LocalDate; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; -@RegisterReflectionForBinding @With public record ForestClientLocationDto( String clientNumber, diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/IdNameDto.java b/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/IdNameDto.java index 63247b580..c87158cb2 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/IdNameDto.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/IdNameDto.java @@ -1,9 +1,7 @@ package ca.bc.gov.restapi.results.common.dto; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; -@RegisterReflectionForBinding @With public record IdNameDto( String id, diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/OracleLogDto.java b/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/OracleLogDto.java index 9cb946178..6f482e27f 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/OracleLogDto.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/OracleLogDto.java @@ -3,12 +3,10 @@ import java.time.LocalDateTime; import lombok.Builder; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This record holds messages and its local date time when it happened. */ -@RegisterReflectionForBinding @Builder @With public record OracleLogDto(String message, LocalDateTime eventTime) { diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/WmsLayersWhitelistUserDto.java b/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/WmsLayersWhitelistUserDto.java index 4a0fdf8f8..dfeecab57 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/WmsLayersWhitelistUserDto.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/common/dto/WmsLayersWhitelistUserDto.java @@ -2,12 +2,10 @@ import lombok.Builder; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This record represents a user in the whitelist. */ -@RegisterReflectionForBinding @Builder @With public record WmsLayersWhitelistUserDto(String userName) { diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/common/enums/ForestClientStatusEnum.java b/backend/src/main/java/ca/bc/gov/restapi/results/common/enums/ForestClientStatusEnum.java index f2f369911..8691e14c4 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/common/enums/ForestClientStatusEnum.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/common/enums/ForestClientStatusEnum.java @@ -3,12 +3,12 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Getter; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; -/** This enum contains all forest client statuses codes and descriptions. */ +/** + * This enum contains all forest client statuses codes and descriptions. + */ @Getter @JsonFormat(shape = JsonFormat.Shape.OBJECT) -@RegisterReflectionForBinding public enum ForestClientStatusEnum { @JsonProperty("ACT") ACTIVE("ACT", "Active"), diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/common/enums/ForestClientTypeEnum.java b/backend/src/main/java/ca/bc/gov/restapi/results/common/enums/ForestClientTypeEnum.java index c0958438f..65bb08eed 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/common/enums/ForestClientTypeEnum.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/common/enums/ForestClientTypeEnum.java @@ -3,12 +3,12 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Getter; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; -/** This enum contains all forest client types codes and descriptions. */ +/** + * This enum contains all forest client types codes and descriptions. + */ @Getter @JsonFormat(shape = JsonFormat.Shape.OBJECT) -@RegisterReflectionForBinding public enum ForestClientTypeEnum { @JsonProperty("A") ASSOCIATION('A', "Association"), diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/common/enums/YesNoEnum.java b/backend/src/main/java/ca/bc/gov/restapi/results/common/enums/YesNoEnum.java index 7c2203382..b414ef055 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/common/enums/YesNoEnum.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/common/enums/YesNoEnum.java @@ -2,9 +2,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; -@RegisterReflectionForBinding public enum YesNoEnum { YES("Y"), NO("N"); diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/converter/OpeningCategoryConverter.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/converter/OpeningCategoryConverter.java index edb577cf0..f430b1c6d 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/converter/OpeningCategoryConverter.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/converter/OpeningCategoryConverter.java @@ -4,11 +4,11 @@ import jakarta.persistence.AttributeConverter; import jakarta.persistence.Converter; import java.util.Objects; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; -/** This class represents a column converter for the opening category column. */ +/** + * This class represents a column converter for the opening category column. + */ @Converter(autoApply = true) -@RegisterReflectionForBinding public class OpeningCategoryConverter implements AttributeConverter { @Override diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/converter/OpeningStatusConverter.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/converter/OpeningStatusConverter.java index 15f2f8a06..3cbb345e7 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/converter/OpeningStatusConverter.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/converter/OpeningStatusConverter.java @@ -4,11 +4,11 @@ import jakarta.persistence.AttributeConverter; import jakarta.persistence.Converter; import java.util.Objects; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; -/** This class represents a column converter for the opening status column. */ +/** + * This class represents a column converter for the opening status column. + */ @Converter(autoApply = true) -@RegisterReflectionForBinding public class OpeningStatusConverter implements AttributeConverter { @Override diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/CodeDescriptionDto.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/CodeDescriptionDto.java index 3225f06e4..6dcf89dfb 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/CodeDescriptionDto.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/CodeDescriptionDto.java @@ -1,9 +1,7 @@ package ca.bc.gov.restapi.results.oracle.dto; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; -@RegisterReflectionForBinding @With public record CodeDescriptionDto( String code, diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/OpeningSearchFiltersDto.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/OpeningSearchFiltersDto.java index d108cdfa3..09436f4a1 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/OpeningSearchFiltersDto.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/OpeningSearchFiltersDto.java @@ -8,13 +8,11 @@ import lombok.ToString; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.BooleanUtils; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; import org.springframework.util.CollectionUtils; /** * This record contains all possible filters when using the Opening Search API. */ -@RegisterReflectionForBinding @Slf4j @Getter @ToString diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/OpeningSearchResponseDto.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/OpeningSearchResponseDto.java index e7933dbee..ed5a4ea12 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/OpeningSearchResponseDto.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/OpeningSearchResponseDto.java @@ -9,12 +9,10 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This class represents a record of the opening search api response. */ -@RegisterReflectionForBinding @Data @Builder @With diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/RecentOpeningDto.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/RecentOpeningDto.java index 61155258d..b82fee88b 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/RecentOpeningDto.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/RecentOpeningDto.java @@ -7,12 +7,10 @@ import java.time.LocalDateTime; import lombok.Builder; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * Represents a Recent Opening in the Home screen. */ -@RegisterReflectionForBinding @Builder @With public record RecentOpeningDto( @@ -28,4 +26,5 @@ public record RecentOpeningDto( LocalDateTime entryTimestamp, LocalDateTime updateTimestamp ) { + } diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/ClientAcronymEntity.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/ClientAcronymEntity.java index 2a6f5f845..bec326c80 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/ClientAcronymEntity.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/ClientAcronymEntity.java @@ -9,12 +9,10 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This class represents a Client Acronym in the database. */ -@RegisterReflectionForBinding @Data @Builder @With diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/CutBlockOpenAdminEntity.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/CutBlockOpenAdminEntity.java index bef6f8d3d..ce68fa521 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/CutBlockOpenAdminEntity.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/CutBlockOpenAdminEntity.java @@ -11,12 +11,10 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This class represents a CUT_BLOCK_OPEN_ADMIN entity in the database. */ -@RegisterReflectionForBinding @Data @Builder @With diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OpenCategoryCodeEntity.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OpenCategoryCodeEntity.java index 92370bc23..22616b904 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OpenCategoryCodeEntity.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OpenCategoryCodeEntity.java @@ -11,12 +11,10 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This class represents an Opening Category in the database. */ -@RegisterReflectionForBinding @Data @Builder @With diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OpeningAttachmentEntity.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OpeningAttachmentEntity.java index 72035023c..a1cc1825d 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OpeningAttachmentEntity.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OpeningAttachmentEntity.java @@ -9,12 +9,10 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This class represents an Opening Attachment in the database. */ -@RegisterReflectionForBinding @Data @Builder @With diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OpeningEntity.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OpeningEntity.java index 5f77ef922..9abcfca03 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OpeningEntity.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OpeningEntity.java @@ -10,12 +10,10 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This class represents an Opening in the database. */ -@RegisterReflectionForBinding @Data @Builder @With diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OrgUnitEntity.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OrgUnitEntity.java index 6dbbc9f0b..424f958ab 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OrgUnitEntity.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/OrgUnitEntity.java @@ -10,12 +10,10 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This class represents an Organization Unity in the database. */ -@RegisterReflectionForBinding @Data @Builder @With diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/ResultsElectronicSubmissionEntity.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/ResultsElectronicSubmissionEntity.java index 20cd48898..9c5780b06 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/ResultsElectronicSubmissionEntity.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/entity/ResultsElectronicSubmissionEntity.java @@ -9,12 +9,10 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This class represents an Electronic Submission for the Openings in the database. */ -@RegisterReflectionForBinding @Data @Builder @With diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/enums/AuditActionCodeEnum.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/enums/AuditActionCodeEnum.java index e178dfa6f..81c009abf 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/enums/AuditActionCodeEnum.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/enums/AuditActionCodeEnum.java @@ -4,12 +4,10 @@ import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; @JsonFormat(shape = JsonFormat.Shape.OBJECT) @AllArgsConstructor(access = AccessLevel.PRIVATE) @Getter -@RegisterReflectionForBinding public enum AuditActionCodeEnum { UPD("UPD", "Update"), COR("COR", "Correction"), diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/enums/OpeningCategoryEnum.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/enums/OpeningCategoryEnum.java index 938447d5d..0c6ed187a 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/enums/OpeningCategoryEnum.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/enums/OpeningCategoryEnum.java @@ -1,14 +1,12 @@ package ca.bc.gov.restapi.results.oracle.enums; import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This enumeration represents all possible values for the Opening Category column from the Opening * table. */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) -@RegisterReflectionForBinding public enum OpeningCategoryEnum { CONT("CONT", "SP as a part of contractual agreement"), EXCLU("EXCLU", "Openings excluded from Crown managed forests"), diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/enums/OpeningStatusEnum.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/enums/OpeningStatusEnum.java index fc0f1406c..e0ac5982e 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/enums/OpeningStatusEnum.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/enums/OpeningStatusEnum.java @@ -2,14 +2,12 @@ import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Objects; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This enumeration represents all possible values for the Opening Status column from the Opening * table. */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) -@RegisterReflectionForBinding public enum OpeningStatusEnum { AMD("AMD", "Amended"), AMG("AMG", "Amalgamate"), diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/DashboardFiltersDto.java b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/DashboardFiltersDto.java index 039e886d3..e8f8172bb 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/DashboardFiltersDto.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/DashboardFiltersDto.java @@ -3,10 +3,10 @@ import java.time.LocalDateTime; import lombok.Builder; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; -/** This record contains all possible filters for the dashboard openings per years api. */ -@RegisterReflectionForBinding +/** + * This record contains all possible filters for the dashboard openings per years api. + */ @Builder @With public record DashboardFiltersDto( @@ -14,4 +14,6 @@ public record DashboardFiltersDto( String status, LocalDateTime entryDateStart, LocalDateTime entryDateEnd, - String clientNumber) {} + String clientNumber) { + +} diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/FreeGrowingMilestonesDto.java b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/FreeGrowingMilestonesDto.java index f6efc9ece..82ec92da3 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/FreeGrowingMilestonesDto.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/FreeGrowingMilestonesDto.java @@ -3,12 +3,10 @@ import java.math.BigDecimal; import lombok.Builder; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This record represent a slice of the free growing milestone chart. */ -@RegisterReflectionForBinding @Builder @With public record FreeGrowingMilestonesDto( diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/MyRecentActionsRequestsDto.java b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/MyRecentActionsRequestsDto.java index 98ec859fc..ffe64feaf 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/MyRecentActionsRequestsDto.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/MyRecentActionsRequestsDto.java @@ -3,12 +3,10 @@ import java.time.LocalDateTime; import lombok.Builder; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This record represents an opening activity in the requests tab. */ -@RegisterReflectionForBinding @Builder @With public record MyRecentActionsRequestsDto( diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/OpeningsPerYearDto.java b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/OpeningsPerYearDto.java index ac540a188..aee905e78 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/OpeningsPerYearDto.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/OpeningsPerYearDto.java @@ -3,12 +3,10 @@ import java.util.Map; import lombok.Builder; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This record represents a record for the "Opening submission trends" chart. */ -@RegisterReflectionForBinding @Builder @With public record OpeningsPerYearDto( @@ -16,7 +14,7 @@ public record OpeningsPerYearDto( Integer year, String monthName, Long amount, - Map statusCounts + Map statusCounts ) { } diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/UserRecentOpeningDto.java b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/UserRecentOpeningDto.java index faf1681c7..2eb9da615 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/UserRecentOpeningDto.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/dto/UserRecentOpeningDto.java @@ -3,9 +3,7 @@ import java.time.LocalDateTime; import lombok.Builder; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; -@RegisterReflectionForBinding @With @Builder public record UserRecentOpeningDto( diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OpeningsActivityEntity.java b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OpeningsActivityEntity.java index 149e3876e..257181d6a 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OpeningsActivityEntity.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OpeningsActivityEntity.java @@ -11,12 +11,10 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This class represents a record in the database for the openings_activity table. */ -@RegisterReflectionForBinding @Data @Builder @With diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OpeningsActivityEntityId.java b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OpeningsActivityEntityId.java index 6ec38303a..895fbc7de 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OpeningsActivityEntityId.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OpeningsActivityEntityId.java @@ -3,18 +3,14 @@ import lombok.AccessLevel; import lombok.Builder; import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.Getter; import lombok.NoArgsConstructor; import lombok.NonNull; import lombok.RequiredArgsConstructor; -import lombok.Setter; -import lombok.ToString; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; -/** Composite key for {@link OpeningsActivityEntity}. */ -@RegisterReflectionForBinding +/** + * Composite key for {@link OpeningsActivityEntity}. + */ @NoArgsConstructor(access = AccessLevel.PACKAGE) @RequiredArgsConstructor @Data @@ -22,7 +18,9 @@ @With public class OpeningsActivityEntityId { - @NonNull private Integer activityId; + @NonNull + private Integer activityId; - @NonNull private Long openingId; + @NonNull + private Long openingId; } diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OpeningsLastYearEntity.java b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OpeningsLastYearEntity.java index dee6df380..95341e977 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OpeningsLastYearEntity.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OpeningsLastYearEntity.java @@ -10,12 +10,10 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This class represents a record in the database for the openings_last_year table. */ -@RegisterReflectionForBinding @Data @Builder @With diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OracleExtractionLogsEntity.java b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OracleExtractionLogsEntity.java index 4667a6de7..1e4940b76 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OracleExtractionLogsEntity.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/OracleExtractionLogsEntity.java @@ -13,12 +13,10 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This class represents a log message in the database, for the oracle extraction flow. */ -@RegisterReflectionForBinding @Data @Builder @NoArgsConstructor diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/UserOpeningEntity.java b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/UserOpeningEntity.java index c8b6b47ad..2ba819b07 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/UserOpeningEntity.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/UserOpeningEntity.java @@ -10,12 +10,10 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; /** * This class represents an Opening saved as favourite to the user. */ -@RegisterReflectionForBinding @Data @Builder @With diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/UserRecentOpeningEntity.java b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/UserRecentOpeningEntity.java index c3bcd1809..d1ec935f8 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/UserRecentOpeningEntity.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/postgres/entity/UserRecentOpeningEntity.java @@ -13,29 +13,27 @@ import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.With; -import org.springframework.aot.hint.annotation.RegisterReflectionForBinding; -@RegisterReflectionForBinding @Data @NoArgsConstructor @AllArgsConstructor @With @Builder @Entity -@EqualsAndHashCode(exclude = {"id","lastViewed"}) +@EqualsAndHashCode(exclude = {"id", "lastViewed"}) @Table(schema = "silva", name = "user_recent_openings") public class UserRecentOpeningEntity { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; - @Column(name = "user_id", nullable = false) - private String userId; + @Column(name = "user_id", nullable = false) + private String userId; - @Column(name = "opening_id", nullable = false) - private Long openingId; + @Column(name = "opening_id", nullable = false) + private Long openingId; - @Column(name = "last_viewed", nullable = false) - private LocalDateTime lastViewed; + @Column(name = "last_viewed", nullable = false) + private LocalDateTime lastViewed; } diff --git a/backend/src/main/resources/META-INF/native-image/reflect-config.json b/backend/src/main/resources/META-INF/native-image/reflect-config.json index 01d88c269..a72f8e0e7 100644 --- a/backend/src/main/resources/META-INF/native-image/reflect-config.json +++ b/backend/src/main/resources/META-INF/native-image/reflect-config.json @@ -16,5 +16,9 @@ { "name": "ca.bc.gov.restapi.results.oracle.entity.SilvicultureSearchProjection", "allDeclaredMethods": true + }, + { + "name": "ca.bc.gov.restapi.results.common.pagination.PaginatedViaQuery", + "allDeclaredMethods": true } ] \ No newline at end of file