From 273044910cca552e54fe91092037ddf4f06cbbc4 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Fri, 1 Nov 2024 20:47:26 +0530 Subject: [PATCH] #813 - more javax => jakarta. hibernate/postgres related changes --- avni-server-api/build.gradle | 39 ++++++++++++------- .../avni/messaging/domain/ManualMessage.java | 4 +- .../messaging/domain/MessageReceiver.java | 2 +- .../avni/messaging/domain/MessageRequest.java | 2 +- .../avni/messaging/domain/MessageRule.java | 2 +- .../server/application/DecisionConcept.java | 2 +- .../org/avni/server/application/Form.java | 2 +- .../avni/server/application/FormElement.java | 2 +- .../server/application/FormElementGroup.java | 2 +- .../avni/server/application/FormMapping.java | 2 +- .../org/avni/server/application/Format.java | 3 +- .../application/NonApplicableFormElement.java | 2 +- .../server/application/menu/MenuItem.java | 2 +- .../server/dao/EncounterSearchRepository.java | 2 +- .../java/org/avni/server/dao/JobStatus.java | 4 +- .../dao/LocationMappingSyncRepository.java | 2 +- .../server/dao/LocationSyncRepository.java | 2 +- .../server/dao/RoleSwitchableRepository.java | 4 +- .../server/dao/SubjectSearchRepository.java | 34 ++++++++++++---- .../org/avni/server/dao/UserRepository.java | 3 +- .../avni/server/domain/AbstractEncounter.java | 2 +- .../java/org/avni/server/domain/Account.java | 2 +- .../org/avni/server/domain/AccountAdmin.java | 2 +- .../org/avni/server/domain/AddressLevel.java | 2 +- .../avni/server/domain/AddressLevelType.java | 2 +- .../server/domain/AnswerConceptMigration.java | 2 +- .../avni/server/domain/ApprovalStatus.java | 2 +- .../org/avni/server/domain/CHSBaseEntity.java | 10 +++-- .../org/avni/server/domain/CHSEntity.java | 2 +- .../org/avni/server/domain/Catchment.java | 2 +- .../org/avni/server/domain/Checklist.java | 2 +- .../avni/server/domain/ChecklistDetail.java | 2 +- .../org/avni/server/domain/ChecklistItem.java | 2 +- .../server/domain/ChecklistItemDetail.java | 2 +- .../java/org/avni/server/domain/Comment.java | 2 +- .../org/avni/server/domain/CommentThread.java | 2 +- .../java/org/avni/server/domain/Concept.java | 2 +- .../org/avni/server/domain/ConceptAnswer.java | 2 +- .../org/avni/server/domain/CustomQuery.java | 3 +- .../org/avni/server/domain/Dashboard.java | 2 +- .../avni/server/domain/DashboardSection.java | 2 +- .../domain/DashboardSectionCardMapping.java | 2 +- .../org/avni/server/domain/Documentation.java | 2 +- .../avni/server/domain/DocumentationItem.java | 2 +- .../org/avni/server/domain/ETLEntity.java | 4 +- .../org/avni/server/domain/Encounter.java | 2 +- .../org/avni/server/domain/EncounterType.java | 2 +- .../server/domain/EntityApprovalStatus.java | 2 +- .../server/domain/ExportJobParameters.java | 2 +- .../java/org/avni/server/domain/Gender.java | 2 +- .../java/org/avni/server/domain/Group.java | 2 +- .../avni/server/domain/GroupDashboard.java | 2 +- .../org/avni/server/domain/GroupRole.java | 2 +- .../org/avni/server/domain/GroupSubject.java | 2 +- .../server/domain/IdentifierAssignment.java | 2 +- .../avni/server/domain/IdentifierSource.java | 2 +- .../domain/IdentifierUserAssignment.java | 2 +- .../org/avni/server/domain/Individual.java | 2 +- .../org/avni/server/domain/Msg91Config.java | 5 +-- .../java/org/avni/server/domain/News.java | 5 +-- .../domain/OperationalEncounterType.java | 2 +- .../server/domain/OperationalProgram.java | 2 +- .../server/domain/OperationalSubjectType.java | 2 +- .../org/avni/server/domain/Organisation.java | 2 +- .../domain/OrganisationAwareEntity.java | 4 +- .../server/domain/OrganisationConfig.java | 5 +-- .../avni/server/domain/OrganisationGroup.java | 2 +- .../domain/OrganisationGroupOrganisation.java | 2 +- .../server/domain/ParentLocationMapping.java | 2 +- .../server/domain/PlatformTranslation.java | 2 +- .../java/org/avni/server/domain/Program.java | 2 +- .../avni/server/domain/ProgramEncounter.java | 2 +- .../avni/server/domain/ProgramEnrolment.java | 2 +- .../org/avni/server/domain/ReportCard.java | 2 +- .../org/avni/server/domain/ResetSync.java | 2 +- .../java/org/avni/server/domain/Rule.java | 2 +- .../avni/server/domain/RuleDependency.java | 2 +- .../avni/server/domain/RuleFailureLog.java | 4 +- .../server/domain/RuleFailureTelemetry.java | 2 +- .../server/domain/StandardReportCardType.java | 2 +- .../avni/server/domain/SubjectMigration.java | 2 +- .../org/avni/server/domain/SubjectType.java | 2 +- .../server/domain/SyncAttributeEntity.java | 4 +- .../org/avni/server/domain/SyncTelemetry.java | 2 +- .../org/avni/server/domain/Translation.java | 2 +- .../java/org/avni/server/domain/User.java | 16 +++++--- .../org/avni/server/domain/UserGroup.java | 2 +- .../org/avni/server/domain/UserSubject.java | 3 +- .../server/domain/UserSubjectAssignment.java | 2 +- .../java/org/avni/server/domain/Video.java | 3 +- .../avni/server/domain/VideoTelemetric.java | 2 +- .../avni/server/domain/VirtualCatchment.java | 2 +- .../domain/accessControl/GroupPrivilege.java | 2 +- .../domain/accessControl/Privilege.java | 2 +- .../domain/app/dashboard/DashboardFilter.java | 2 +- .../extenalSystem/ExternalSystemConfig.java | 5 +-- .../IndividualRelation.java | 5 +-- .../IndividualRelationGenderMapping.java | 2 +- .../IndividualRelationship.java | 2 +- .../IndividualRelationshipType.java | 2 +- .../organisation/OrganisationCategory.java | 2 +- .../organisation/OrganisationStatus.java | 2 +- .../program/SubjectProgramEligibility.java | 2 +- .../org/avni/server/domain/task/Task.java | 2 +- .../avni/server/domain/task/TaskStatus.java | 2 +- .../org/avni/server/domain/task/TaskType.java | 2 +- .../server/domain/task/TaskUnAssignment.java | 2 +- .../server/exporter/ExportJobService.java | 2 +- .../framework/hibernate/DummyInterceptor.java | 2 +- .../framework/hibernate/package-info.java | 15 ------- .../postgres/CHSPostgreSQLDialect.java | 20 ---------- ...fixedUserPoolBasedIdentifierGenerator.java | 2 +- .../UserPoolBasedIdentifierGenerator.java | 2 +- .../server/importer/batch/JobService.java | 2 +- .../batch/csv/writer/BulkLocationCreator.java | 2 +- .../batch/csv/writer/BulkLocationEditor.java | 2 +- .../batch/csv/writer/SubjectWriter.java | 7 ++-- .../csv/writer/UserAndCatchmentWriter.java | 2 +- .../UserSubjectTypeCreateTasklet.java | 2 +- .../org/avni/server/report/ReportHelper.java | 2 +- .../server/service/AddressLevelCache.java | 2 +- .../avni/server/service/CatchmentService.java | 2 +- .../avni/server/service/ChecklistService.java | 2 +- .../service/IdentifierAssignmentService.java | 2 +- .../server/service/IndividualService.java | 4 +- .../server/service/KeycloakIdpService.java | 2 +- .../service/OrganisationConfigService.java | 2 +- .../service/ProgramEnrolmentService.java | 2 +- .../org/avni/server/service/RuleService.java | 2 +- .../service/SubjectMigrationService.java | 2 +- .../SubjectSyncResponseBuilderService.java | 2 +- .../server/service/SubjectTypeService.java | 2 +- .../server/service/SyncDetailsService.java | 2 +- .../service/UserSubjectAssignmentService.java | 2 +- .../exception/GroupNotFoundException.java | 2 +- .../avni/server/web/AccountController.java | 2 +- .../web/AddressLevelTypeController.java | 2 +- .../avni/server/web/CatchmentController.java | 2 +- .../avni/server/web/ChecklistController.java | 2 +- .../server/web/ChecklistDetailController.java | 2 +- .../server/web/ChecklistItemController.java | 2 +- .../avni/server/web/CommentController.java | 2 +- .../server/web/CommentThreadController.java | 2 +- .../avni/server/web/ConceptController.java | 2 +- .../server/web/CustomQueryController.java | 2 +- .../avni/server/web/DashboardController.java | 2 +- .../server/web/DocumentationController.java | 2 +- .../avni/server/web/EncounterController.java | 2 +- .../server/web/EncounterTypeController.java | 2 +- .../web/EntityApprovalStatusController.java | 2 +- .../avni/server/web/ExtensionController.java | 2 +- .../org/avni/server/web/FormController.java | 2 +- .../server/web/FormMappingController.java | 2 +- .../org/avni/server/web/GenderController.java | 2 +- .../server/web/GroupDashboardController.java | 2 +- .../server/web/GroupPrivilegeController.java | 2 +- .../avni/server/web/GroupRoleController.java | 2 +- .../server/web/GroupSubjectController.java | 2 +- .../org/avni/server/web/GroupsController.java | 2 +- .../web/IdentifierAssignmentController.java | 2 +- .../web/IdentifierSourceController.java | 2 +- .../web/IdentifierSourceWebController.java | 2 +- .../IdentifierUserAssignmentController.java | 2 +- ...IdentifierUserAssignmentWebController.java | 2 +- .../server/web/ImplementationController.java | 2 +- .../avni/server/web/IndividualController.java | 2 +- .../web/IndividualRelationController.java | 2 +- .../web/IndividualRelationshipController.java | 2 +- .../IndividualRelationshipTypeController.java | 2 +- .../avni/server/web/LocationController.java | 2 +- .../server/web/LocationMappingController.java | 2 +- .../org/avni/server/web/NewsController.java | 2 +- .../OperationalEncounterTypesController.java | 2 +- .../web/OperationalProgramsController.java | 2 +- .../OperationalSubjectTypesController.java | 2 +- .../web/OrganisationConfigController.java | 2 +- .../server/web/OrganisationController.java | 2 +- .../web/OrganisationGroupController.java | 2 +- .../web/PlatformTranslationController.java | 2 +- .../avni/server/web/ProgramController.java | 2 +- .../web/ProgramEncounterController.java | 2 +- .../web/ProgramEnrolmentController.java | 2 +- .../avni/server/web/ReportCardController.java | 2 +- .../avni/server/web/ReportingController.java | 2 +- .../SubjectProgramEligibilityController.java | 2 +- .../server/web/SubjectTypeController.java | 2 +- .../server/web/SyncTelemetryController.java | 2 +- .../server/web/TranslationController.java | 2 +- .../org/avni/server/web/UserController.java | 8 ++-- .../avni/server/web/UserGroupController.java | 2 +- .../avni/server/web/UserInfoController.java | 2 +- .../org/avni/server/web/VideoController.java | 2 +- .../server/web/VideoTelemetricController.java | 2 +- .../avni/server/web/ViewGenController.java | 2 +- .../api/GeneralEncounterApiController.java | 2 +- .../api/ProgramEncounterApiController.java | 2 +- .../api/ProgramEnrolmentApiController.java | 2 +- .../web/menu/MenuItemWebController.java | 2 +- .../validateRules/RuleValidationService.java | 3 +- .../server/web/response/SubjectResponse.java | 5 ++- .../rules/RuleFailureTelemetryController.java | 2 +- .../RuleFailureTelemetryWebController.java | 2 +- .../avni/server/web/task/TaskController.java | 2 +- .../web/task/TaskUnAssignmentController.java | 2 +- .../server/web/task/TaskWebController.java | 2 +- .../src/main/resources/application.properties | 13 ++++--- .../src/main/resources/log4j.properties | 9 ----- .../AbstractControllerIntegrationTest.java | 3 +- .../src/test/resources/application.properties | 13 ++++--- mypatch.patch | 2 +- 210 files changed, 297 insertions(+), 326 deletions(-) delete mode 100644 avni-server-api/src/main/java/org/avni/server/framework/hibernate/package-info.java delete mode 100644 avni-server-api/src/main/java/org/avni/server/framework/postgres/CHSPostgreSQLDialect.java delete mode 100644 avni-server-api/src/main/resources/log4j.properties diff --git a/avni-server-api/build.gradle b/avni-server-api/build.gradle index b3ed1e7be..43dc709af 100644 --- a/avni-server-api/build.gradle +++ b/avni-server-api/build.gradle @@ -41,31 +41,38 @@ repositories { mavenCentral() } configurations { dev + all*.exclude group: 'org.slf4j', module: 'slf4j-reload4j' all*.exclude group: 'org.slf4j', module: 'slf4j-simple' } dependencies { - implementation group: 'org.apache.tomcat', name: 'tomcat-jdbc', version: '8.5.46' + implementation group: 'org.apache.tomcat', name: 'tomcat-jdbc' implementation("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") implementation "org.springframework.boot:spring-boot-starter-data-jpa:${springBootVersion}" testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}" implementation "org.springframework.boot:spring-boot-starter-data-rest:${springBootVersion}" implementation("org.springframework.boot:spring-boot-starter-security:${springBootVersion}") testImplementation "com.github.tomakehurst:wiremock-jre8-standalone:2.34.0" - implementation "org.postgresql:postgresql:9.4-1200-jdbc41" + implementation "org.postgresql:postgresql" implementation 'org.springframework.boot:spring-boot-starter-batch' testImplementation 'org.springframework.batch:spring-batch-test' - implementation "joda-time:joda-time:2.9.4" - implementation group: 'org.jadira.usertype', name: 'usertype.core', version: '6.0.1.GA' - implementation "org.flywaydb:flyway-core:4.0.3" - implementation "org.flywaydb.flyway-test-extensions:flyway-spring-test:4.0" - implementation "com.zaxxer:HikariCP:2.5.1" + implementation "joda-time:joda-time" + runtimeOnly("javax.transaction:jta:1.1") +// implementation(group: 'org.jadira.usertype', name: 'usertype.core', version: '7.0.0.CR1') { +// exclude(group: 'org.hibernate', module: 'hibernate-core') +// } + implementation "org.flywaydb:flyway-core:10.20.1" + runtimeOnly("org.flywaydb:flyway-database-postgresql:10.20.1") + implementation "org.flywaydb.flyway-test-extensions:flyway-spring6-test:10.0.0" + implementation "com.zaxxer:HikariCP" implementation "org.apache.poi:poi:3.16-beta2" implementation "org.apache.poi:poi-ooxml:3.16-beta2" - implementation 'org.apache.httpcomponents:httpclient:4.5.9' + implementation 'org.apache.httpcomponents:httpclient' implementation 'com.auth0:jwks-rsa:0.3.0' implementation 'com.auth0:java-jwt:3.3.0' - implementation group: 'org.hibernate', name: 'hibernate-search-orm', version: '5.9.2.Final' + implementation(group: 'org.hibernate', name: 'hibernate-search-orm', version: '5.9.2.Final') { + exclude(group: 'org.hibernate', module: 'hibernate-core') + } implementation 'com.bugsnag:bugsnag:3.+' implementation 'com.amazonaws:aws-java-sdk-s3' implementation 'com.amazonaws:aws-java-sdk-cognitoidp' @@ -74,12 +81,14 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-cache' implementation 'org.keycloak:keycloak-spring-boot-starter:21.0.2' implementation 'org.keycloak:keycloak-admin-client:21.0.2' - implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.6' - implementation 'com.fasterxml.jackson.core:jackson-core:2.12.6' - implementation 'com.fasterxml.jackson.core:jackson-annotations:2.12.6' - implementation 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.12.6' - implementation 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.12.6' - implementation 'org.hibernate:hibernate-ehcache:5.6.15.Final' + implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.4' + implementation 'com.fasterxml.jackson.core:jackson-core:2.15.4' + implementation 'com.fasterxml.jackson.core:jackson-annotations:2.15.4' + implementation 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.15.2' + implementation 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.15.4' + implementation('org.hibernate:hibernate-ehcache:5.6.15.Final') { + exclude(group: 'org.hibernate', module: 'hibernate-core') + } implementation 'javax.cache:cache-api:1.1.1' dev "org.springframework.boot:spring-boot-devtools:${springBootVersion}" testImplementation "org.mockito:mockito-core:2.23.4" diff --git a/avni-server-api/src/main/java/org/avni/messaging/domain/ManualMessage.java b/avni-server-api/src/main/java/org/avni/messaging/domain/ManualMessage.java index cf57160cc..cf29cdb0a 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/domain/ManualMessage.java +++ b/avni-server-api/src/main/java/org/avni/messaging/domain/ManualMessage.java @@ -5,9 +5,7 @@ import org.avni.server.framework.hibernate.NextTriggerDetailsUserType; import org.hibernate.annotations.Type; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Table; +import jakarta.persistence.*; @Entity @Table(name = "manual_message") diff --git a/avni-server-api/src/main/java/org/avni/messaging/domain/MessageReceiver.java b/avni-server-api/src/main/java/org/avni/messaging/domain/MessageReceiver.java index 133b87d1c..22acb3fbd 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/domain/MessageReceiver.java +++ b/avni-server-api/src/main/java/org/avni/messaging/domain/MessageReceiver.java @@ -2,7 +2,7 @@ import org.avni.server.domain.OrganisationAwareEntity; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/messaging/domain/MessageRequest.java b/avni-server-api/src/main/java/org/avni/messaging/domain/MessageRequest.java index 199ce542d..d6f1ce116 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/domain/MessageRequest.java +++ b/avni-server-api/src/main/java/org/avni/messaging/domain/MessageRequest.java @@ -3,7 +3,7 @@ import org.avni.server.domain.OrganisationAwareEntity; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/messaging/domain/MessageRule.java b/avni-server-api/src/main/java/org/avni/messaging/domain/MessageRule.java index 51eadeb3d..5a3627727 100644 --- a/avni-server-api/src/main/java/org/avni/messaging/domain/MessageRule.java +++ b/avni-server-api/src/main/java/org/avni/messaging/domain/MessageRule.java @@ -2,7 +2,7 @@ import org.avni.server.domain.OrganisationAwareEntity; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/application/DecisionConcept.java b/avni-server-api/src/main/java/org/avni/server/application/DecisionConcept.java index a7ef53de5..1bbd01a3c 100644 --- a/avni-server-api/src/main/java/org/avni/server/application/DecisionConcept.java +++ b/avni-server-api/src/main/java/org/avni/server/application/DecisionConcept.java @@ -2,7 +2,7 @@ import org.avni.server.domain.Concept; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/application/Form.java b/avni-server-api/src/main/java/org/avni/server/application/Form.java index 532b70616..1fb15ac42 100644 --- a/avni-server-api/src/main/java/org/avni/server/application/Form.java +++ b/avni-server-api/src/main/java/org/avni/server/application/Form.java @@ -8,7 +8,7 @@ import org.avni.server.framework.hibernate.DeclarativeRuleUserType; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.*; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/application/FormElement.java b/avni-server-api/src/main/java/org/avni/server/application/FormElement.java index f70d76c66..c0e8248d4 100644 --- a/avni-server-api/src/main/java/org/avni/server/application/FormElement.java +++ b/avni-server-api/src/main/java/org/avni/server/application/FormElement.java @@ -11,7 +11,7 @@ import org.avni.server.web.validation.ValidationException; import org.springframework.util.StringUtils; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.ArrayList; import java.util.HashSet; diff --git a/avni-server-api/src/main/java/org/avni/server/application/FormElementGroup.java b/avni-server-api/src/main/java/org/avni/server/application/FormElementGroup.java index ce2369487..0a6769c40 100644 --- a/avni-server-api/src/main/java/org/avni/server/application/FormElementGroup.java +++ b/avni-server-api/src/main/java/org/avni/server/application/FormElementGroup.java @@ -6,7 +6,7 @@ import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.HashSet; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/application/FormMapping.java b/avni-server-api/src/main/java/org/avni/server/application/FormMapping.java index 733cf3917..41ea42163 100644 --- a/avni-server-api/src/main/java/org/avni/server/application/FormMapping.java +++ b/avni-server-api/src/main/java/org/avni/server/application/FormMapping.java @@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.data.rest.core.config.Projection; -import javax.persistence.*; +import jakarta.persistence.*; @Entity @Table(name = "form_mapping") diff --git a/avni-server-api/src/main/java/org/avni/server/application/Format.java b/avni-server-api/src/main/java/org/avni/server/application/Format.java index 6b0f9b288..9cd86beee 100644 --- a/avni-server-api/src/main/java/org/avni/server/application/Format.java +++ b/avni-server-api/src/main/java/org/avni/server/application/Format.java @@ -1,7 +1,6 @@ package org.avni.server.application; -import javax.persistence.Column; -import javax.persistence.Embeddable; +import jakarta.persistence.*; @Embeddable public class Format { diff --git a/avni-server-api/src/main/java/org/avni/server/application/NonApplicableFormElement.java b/avni-server-api/src/main/java/org/avni/server/application/NonApplicableFormElement.java index 01f6d3a9c..772790622 100644 --- a/avni-server-api/src/main/java/org/avni/server/application/NonApplicableFormElement.java +++ b/avni-server-api/src/main/java/org/avni/server/application/NonApplicableFormElement.java @@ -3,7 +3,7 @@ import org.avni.server.domain.OrganisationAwareEntity; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; @Entity @Table(name = "non_applicable_form_element") diff --git a/avni-server-api/src/main/java/org/avni/server/application/menu/MenuItem.java b/avni-server-api/src/main/java/org/avni/server/application/menu/MenuItem.java index 880748693..904bbdaa7 100644 --- a/avni-server-api/src/main/java/org/avni/server/application/menu/MenuItem.java +++ b/avni-server-api/src/main/java/org/avni/server/application/menu/MenuItem.java @@ -2,7 +2,7 @@ import org.avni.server.domain.OrganisationAwareEntity; -import javax.persistence.*; +import jakarta.persistence.*; @Entity @Table(name = "menu_item") diff --git a/avni-server-api/src/main/java/org/avni/server/dao/EncounterSearchRepository.java b/avni-server-api/src/main/java/org/avni/server/dao/EncounterSearchRepository.java index 29a711fcc..becb40b8d 100644 --- a/avni-server-api/src/main/java/org/avni/server/dao/EncounterSearchRepository.java +++ b/avni-server-api/src/main/java/org/avni/server/dao/EncounterSearchRepository.java @@ -8,7 +8,7 @@ import jakarta.persistence.EntityManager; import jakarta.persistence.Query; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.math.BigInteger; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/dao/JobStatus.java b/avni-server-api/src/main/java/org/avni/server/dao/JobStatus.java index 550eb0685..7ef6bd327 100644 --- a/avni-server-api/src/main/java/org/avni/server/dao/JobStatus.java +++ b/avni-server-api/src/main/java/org/avni/server/dao/JobStatus.java @@ -1,8 +1,6 @@ package org.avni.server.dao; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; +import jakarta.persistence.*; import java.util.Date; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/dao/LocationMappingSyncRepository.java b/avni-server-api/src/main/java/org/avni/server/dao/LocationMappingSyncRepository.java index d517f44cc..ff54d7b1c 100644 --- a/avni-server-api/src/main/java/org/avni/server/dao/LocationMappingSyncRepository.java +++ b/avni-server-api/src/main/java/org/avni/server/dao/LocationMappingSyncRepository.java @@ -7,7 +7,7 @@ import org.springframework.stereotype.Repository; import jakarta.persistence.EntityManager; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; /** * LocationSyncRepository uses the postgres @> keyword for sync, which does not index well and creates poor plans. diff --git a/avni-server-api/src/main/java/org/avni/server/dao/LocationSyncRepository.java b/avni-server-api/src/main/java/org/avni/server/dao/LocationSyncRepository.java index 8e7ee4cce..ea0b92c4a 100644 --- a/avni-server-api/src/main/java/org/avni/server/dao/LocationSyncRepository.java +++ b/avni-server-api/src/main/java/org/avni/server/dao/LocationSyncRepository.java @@ -6,7 +6,7 @@ import org.springframework.stereotype.Repository; import jakarta.persistence.EntityManager; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @Repository public class LocationSyncRepository extends RoleSwitchableRepository implements SyncableRepository { diff --git a/avni-server-api/src/main/java/org/avni/server/dao/RoleSwitchableRepository.java b/avni-server-api/src/main/java/org/avni/server/dao/RoleSwitchableRepository.java index 2b1eee922..669b4f5c9 100644 --- a/avni-server-api/src/main/java/org/avni/server/dao/RoleSwitchableRepository.java +++ b/avni-server-api/src/main/java/org/avni/server/dao/RoleSwitchableRepository.java @@ -2,9 +2,7 @@ import org.avni.server.framework.security.UserContextHolder; -import jakarta.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import jakarta.persistence.Query; +import jakarta.persistence.*; public abstract class RoleSwitchableRepository { @PersistenceContext diff --git a/avni-server-api/src/main/java/org/avni/server/dao/SubjectSearchRepository.java b/avni-server-api/src/main/java/org/avni/server/dao/SubjectSearchRepository.java index eea533e21..c89506392 100644 --- a/avni-server-api/src/main/java/org/avni/server/dao/SubjectSearchRepository.java +++ b/avni-server-api/src/main/java/org/avni/server/dao/SubjectSearchRepository.java @@ -4,18 +4,21 @@ import org.avni.server.dao.search.SqlQuery; import org.avni.server.domain.SubjectType; import org.avni.server.web.request.webapp.search.SubjectSearchRequest; -import org.hibernate.query.internal.NativeQueryImpl; -import org.hibernate.transform.AliasToEntityMapResultTransformer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Repository; import org.springframework.util.StringUtils; import jakarta.persistence.EntityManager; -import javax.persistence.PersistenceContext; + +import jakarta.persistence.*; + import jakarta.persistence.Query; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; + import java.math.BigInteger; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -32,6 +35,24 @@ public SubjectSearchRepository(EntityManager entityManager, SubjectTypeRepositor this.subjectTypeRepository = subjectTypeRepository; } + private List> convertTuplesToMap(List tuples) { + List> result = new ArrayList<>(); + + tuples.forEach(object -> { + if (object instanceof Tuple single) { + Map tempMap = new HashMap<>(); + for (TupleElement key : single.getElements()) { + tempMap.put(key.getAlias(), single.get(key)); + } + result.add(tempMap); + } else { + throw new RuntimeException("Query should return instance of Tuple"); + } + }); + + return result; + } + @Transactional public List> search(SubjectSearchRequest searchRequest, SearchBuilder searchBuilder) { SubjectType subjectType = StringUtils.isEmpty(searchRequest.getSubjectType()) ? null : subjectTypeRepository.findByUuid(searchRequest.getSubjectType()); @@ -41,12 +62,11 @@ public List> search(SubjectSearchRequest searchRequest, Sear logger.debug("Executing query: " + query.getSql()); logger.debug("Parameters: " + query.getParameters()); Query sql = entityManager.createNativeQuery(query.getSql()); - NativeQueryImpl nativeQuery = (NativeQueryImpl) sql; - nativeQuery.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE); query.getParameters().forEach((name, value) -> { sql.setParameter(name, value); }); - return sql.getResultList(); + List resultList = sql.getResultList(); + return convertTuplesToMap(resultList); } finally { setRoleBackToUser(); } diff --git a/avni-server-api/src/main/java/org/avni/server/dao/UserRepository.java b/avni-server-api/src/main/java/org/avni/server/dao/UserRepository.java index 8adca890a..3f1af8a7f 100644 --- a/avni-server-api/src/main/java/org/avni/server/dao/UserRepository.java +++ b/avni-server-api/src/main/java/org/avni/server/dao/UserRepository.java @@ -15,8 +15,7 @@ import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.stereotype.Repository; -import javax.persistence.EntityNotFoundException; -import jakarta.persistence.QueryHint; +import jakarta.persistence.*; import java.util.List; import java.util.Optional; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/AbstractEncounter.java b/avni-server-api/src/main/java/org/avni/server/domain/AbstractEncounter.java index 0c91c5c85..7ebe662b1 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/AbstractEncounter.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/AbstractEncounter.java @@ -8,7 +8,7 @@ import org.hibernate.annotations.Type; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.Objects; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Account.java b/avni-server-api/src/main/java/org/avni/server/domain/Account.java index 65b7cde3b..c3633d7d8 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Account.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Account.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.HashSet; import java.util.Set; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/AccountAdmin.java b/avni-server-api/src/main/java/org/avni/server/domain/AccountAdmin.java index 831e87e23..f0c8c9e09 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/AccountAdmin.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/AccountAdmin.java @@ -3,7 +3,7 @@ import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; @Entity @Table(name = "account_admin") diff --git a/avni-server-api/src/main/java/org/avni/server/domain/AddressLevel.java b/avni-server-api/src/main/java/org/avni/server/domain/AddressLevel.java index cc74e8812..879674c1a 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/AddressLevel.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/AddressLevel.java @@ -12,7 +12,7 @@ import org.avni.server.geo.Point; import org.springframework.data.rest.core.config.Projection; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.*; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/AddressLevelType.java b/avni-server-api/src/main/java/org/avni/server/domain/AddressLevelType.java index b363b64b2..cf79d282c 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/AddressLevelType.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/AddressLevelType.java @@ -6,7 +6,7 @@ import org.avni.server.application.projections.BaseProjection; import org.springframework.data.rest.core.config.Projection; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.*; import jakarta.validation.constraints.NotNull; import java.util.HashSet; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/AnswerConceptMigration.java b/avni-server-api/src/main/java/org/avni/server/domain/AnswerConceptMigration.java index 094600e48..a01566d3f 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/AnswerConceptMigration.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/AnswerConceptMigration.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; @Entity @Table(name = "answer_concept_migration") diff --git a/avni-server-api/src/main/java/org/avni/server/domain/ApprovalStatus.java b/avni-server-api/src/main/java/org/avni/server/domain/ApprovalStatus.java index a58116723..e7faad534 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/ApprovalStatus.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/ApprovalStatus.java @@ -3,7 +3,7 @@ import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import org.joda.time.DateTime; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/CHSBaseEntity.java b/avni-server-api/src/main/java/org/avni/server/domain/CHSBaseEntity.java index b20dee8d8..9e924cd43 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/CHSBaseEntity.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/CHSBaseEntity.java @@ -1,9 +1,10 @@ package org.avni.server.domain; import jakarta.validation.constraints.NotNull; -import org.hibernate.proxy.HibernateProxyHelper; +import org.hibernate.proxy.HibernateProxy; +import org.hibernate.proxy.LazyInitializer; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.UUID; @MappedSuperclass @@ -59,7 +60,10 @@ public void assignUUIDIfRequired() { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || HibernateProxyHelper.getClassWithoutInitializingProxy(this) != HibernateProxyHelper.getClassWithoutInitializingProxy(o)) return false; + + LazyInitializer lazyInitializer1 = HibernateProxy.extractLazyInitializer(this); + LazyInitializer lazyInitializer2 = HibernateProxy.extractLazyInitializer(o); + if (o == null || lazyInitializer2 == null || lazyInitializer1 == null || lazyInitializer1.getImplementationClass() != lazyInitializer2.getImplementationClass()) return false; CHSBaseEntity that = (CHSBaseEntity) o; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/CHSEntity.java b/avni-server-api/src/main/java/org/avni/server/domain/CHSEntity.java index 999a1e53e..9a475c9f7 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/CHSEntity.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/CHSEntity.java @@ -11,7 +11,7 @@ import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.Date; @MappedSuperclass diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Catchment.java b/avni-server-api/src/main/java/org/avni/server/domain/Catchment.java index 469ac1aee..74eb08e8b 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Catchment.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Catchment.java @@ -3,7 +3,7 @@ import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.CacheConcurrencyStrategy; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.HashSet; import java.util.Set; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Checklist.java b/avni-server-api/src/main/java/org/avni/server/domain/Checklist.java index b49b0d5d0..018f13ba4 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Checklist.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Checklist.java @@ -4,7 +4,7 @@ import org.hibernate.annotations.BatchSize; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/ChecklistDetail.java b/avni-server-api/src/main/java/org/avni/server/domain/ChecklistDetail.java index 64761657c..a16f0aa28 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/ChecklistDetail.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/ChecklistDetail.java @@ -4,7 +4,7 @@ import org.hibernate.annotations.BatchSize; import org.springframework.data.rest.core.config.Projection; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/ChecklistItem.java b/avni-server-api/src/main/java/org/avni/server/domain/ChecklistItem.java index af90bc7f0..ece67a297 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/ChecklistItem.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/ChecklistItem.java @@ -6,7 +6,7 @@ import org.hibernate.annotations.Type; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/ChecklistItemDetail.java b/avni-server-api/src/main/java/org/avni/server/domain/ChecklistItemDetail.java index 8aea02f6a..b396c13f2 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/ChecklistItemDetail.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/ChecklistItemDetail.java @@ -5,7 +5,7 @@ import org.hibernate.annotations.Type; import org.avni.server.application.Form; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Comment.java b/avni-server-api/src/main/java/org/avni/server/domain/Comment.java index 94b50a8d2..77028a57e 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Comment.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Comment.java @@ -4,7 +4,7 @@ import org.hibernate.annotations.BatchSize; import org.avni.server.util.S; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/CommentThread.java b/avni-server-api/src/main/java/org/avni/server/domain/CommentThread.java index 7332fbb81..e07bdc3ee 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/CommentThread.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/CommentThread.java @@ -5,7 +5,7 @@ import org.hibernate.annotations.BatchSize; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.HashSet; import java.util.Set; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Concept.java b/avni-server-api/src/main/java/org/avni/server/domain/Concept.java index 57c3090f3..126837cfb 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Concept.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Concept.java @@ -11,7 +11,7 @@ import org.avni.server.application.KeyValues; import org.avni.server.web.request.ConceptContract; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.*; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/ConceptAnswer.java b/avni-server-api/src/main/java/org/avni/server/domain/ConceptAnswer.java index a695505ed..490138a99 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/ConceptAnswer.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/ConceptAnswer.java @@ -9,7 +9,7 @@ import org.avni.server.projection.ConceptProjection; import org.springframework.data.rest.core.config.Projection; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.Objects; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/CustomQuery.java b/avni-server-api/src/main/java/org/avni/server/domain/CustomQuery.java index a919fac60..fd16e4627 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/CustomQuery.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/CustomQuery.java @@ -1,8 +1,7 @@ package org.avni.server.domain; -import javax.persistence.Column; -import javax.persistence.Entity; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity(name = "custom_query") diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Dashboard.java b/avni-server-api/src/main/java/org/avni/server/domain/Dashboard.java index 0f57f871f..79e842617 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Dashboard.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Dashboard.java @@ -4,7 +4,7 @@ import org.avni.server.domain.app.dashboard.DashboardFilter; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.HashSet; import java.util.Set; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/DashboardSection.java b/avni-server-api/src/main/java/org/avni/server/domain/DashboardSection.java index f249b5648..447e81a02 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/DashboardSection.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/DashboardSection.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.HashSet; import java.util.Set; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/DashboardSectionCardMapping.java b/avni-server-api/src/main/java/org/avni/server/domain/DashboardSectionCardMapping.java index c57652b81..b7edd444c 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/DashboardSectionCardMapping.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/DashboardSectionCardMapping.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Documentation.java b/avni-server-api/src/main/java/org/avni/server/domain/Documentation.java index 5c9dcb0b4..7ab224da8 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Documentation.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Documentation.java @@ -2,7 +2,7 @@ import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.HashSet; import java.util.Set; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/DocumentationItem.java b/avni-server-api/src/main/java/org/avni/server/domain/DocumentationItem.java index add8abcca..9e0b7b51d 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/DocumentationItem.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/DocumentationItem.java @@ -2,7 +2,7 @@ import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/ETLEntity.java b/avni-server-api/src/main/java/org/avni/server/domain/ETLEntity.java index 829e2e05c..80486d8d3 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/ETLEntity.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/ETLEntity.java @@ -1,7 +1,7 @@ package org.avni.server.domain; -import javax.persistence.Column; -import javax.persistence.MappedSuperclass; +import jakarta.persistence.Column; +import jakarta.persistence.MappedSuperclass; @MappedSuperclass public class ETLEntity extends CHSBaseEntity { diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Encounter.java b/avni-server-api/src/main/java/org/avni/server/domain/Encounter.java index 5caca4f7b..d0c544b20 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Encounter.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Encounter.java @@ -9,7 +9,7 @@ import org.avni.server.domain.EncounterType.EncounterTypeProjection; import org.springframework.data.rest.core.config.Projection; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/EncounterType.java b/avni-server-api/src/main/java/org/avni/server/domain/EncounterType.java index 1f1620929..56ce11e2c 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/EncounterType.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/EncounterType.java @@ -9,7 +9,7 @@ import org.hibernate.annotations.Type; import org.springframework.data.rest.core.config.Projection; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.HashSet; import java.util.Objects; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/EntityApprovalStatus.java b/avni-server-api/src/main/java/org/avni/server/domain/EntityApprovalStatus.java index 5bc27b930..5d75fb768 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/EntityApprovalStatus.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/EntityApprovalStatus.java @@ -4,7 +4,7 @@ import org.hibernate.annotations.BatchSize; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/ExportJobParameters.java b/avni-server-api/src/main/java/org/avni/server/domain/ExportJobParameters.java index f57c22428..3b4c4759c 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/ExportJobParameters.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/ExportJobParameters.java @@ -4,7 +4,7 @@ import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Gender.java b/avni-server-api/src/main/java/org/avni/server/domain/Gender.java index fc2365baa..f76440202 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Gender.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Gender.java @@ -4,7 +4,7 @@ import org.hibernate.annotations.BatchSize; import org.springframework.data.rest.core.config.Projection; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Group.java b/avni-server-api/src/main/java/org/avni/server/domain/Group.java index c2427c737..da217141d 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Group.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Group.java @@ -4,7 +4,7 @@ import org.avni.server.domain.accessControl.GroupPrivilege; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.HashSet; import java.util.Set; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/GroupDashboard.java b/avni-server-api/src/main/java/org/avni/server/domain/GroupDashboard.java index 25fe4b0d6..6694610e3 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/GroupDashboard.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/GroupDashboard.java @@ -2,7 +2,7 @@ import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/GroupRole.java b/avni-server-api/src/main/java/org/avni/server/domain/GroupRole.java index 054454444..3de735ce2 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/GroupRole.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/GroupRole.java @@ -5,7 +5,7 @@ import org.hibernate.annotations.BatchSize; import org.springframework.data.rest.core.config.Projection; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/GroupSubject.java b/avni-server-api/src/main/java/org/avni/server/domain/GroupSubject.java index 55e46d09a..b9ca17683 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/GroupSubject.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/GroupSubject.java @@ -5,7 +5,7 @@ import org.hibernate.annotations.BatchSize; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/IdentifierAssignment.java b/avni-server-api/src/main/java/org/avni/server/domain/IdentifierAssignment.java index 84487b886..9d7426b20 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/IdentifierAssignment.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/IdentifierAssignment.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/IdentifierSource.java b/avni-server-api/src/main/java/org/avni/server/domain/IdentifierSource.java index 4eb9ad821..5397daa4b 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/IdentifierSource.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/IdentifierSource.java @@ -5,7 +5,7 @@ import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/IdentifierUserAssignment.java b/avni-server-api/src/main/java/org/avni/server/domain/IdentifierUserAssignment.java index 18755a319..c5c735122 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/IdentifierUserAssignment.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/IdentifierUserAssignment.java @@ -3,7 +3,7 @@ import org.avni.server.domain.identifier.IdentifierGeneratorType; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; @Entity @Table(name = "identifier_user_assignment") diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Individual.java b/avni-server-api/src/main/java/org/avni/server/domain/Individual.java index 9babc59d5..3b3394559 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Individual.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Individual.java @@ -12,7 +12,7 @@ import org.hibernate.annotations.Type; import org.joda.time.LocalDate; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.HashSet; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Msg91Config.java b/avni-server-api/src/main/java/org/avni/server/domain/Msg91Config.java index 43013a8ee..73114c857 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Msg91Config.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Msg91Config.java @@ -2,9 +2,8 @@ import org.hibernate.annotations.BatchSize; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Table; +import jakarta.persistence.Column; +import jakarta.persistence.*; @Entity @Table(name = "msg91_config") diff --git a/avni-server-api/src/main/java/org/avni/server/domain/News.java b/avni-server-api/src/main/java/org/avni/server/domain/News.java index be266005f..835767f3b 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/News.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/News.java @@ -3,9 +3,8 @@ import org.hibernate.annotations.BatchSize; import org.joda.time.DateTime; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Table; +import jakarta.persistence.Column; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/OperationalEncounterType.java b/avni-server-api/src/main/java/org/avni/server/domain/OperationalEncounterType.java index d18cc3a14..adcedb819 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/OperationalEncounterType.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/OperationalEncounterType.java @@ -3,7 +3,7 @@ import org.hibernate.annotations.BatchSize; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/OperationalProgram.java b/avni-server-api/src/main/java/org/avni/server/domain/OperationalProgram.java index 0d6e43b44..d4b18c583 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/OperationalProgram.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/OperationalProgram.java @@ -3,7 +3,7 @@ import org.hibernate.annotations.BatchSize; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/OperationalSubjectType.java b/avni-server-api/src/main/java/org/avni/server/domain/OperationalSubjectType.java index 6c6837090..71363771c 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/OperationalSubjectType.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/OperationalSubjectType.java @@ -5,7 +5,7 @@ import org.hibernate.annotations.BatchSize; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Organisation.java b/avni-server-api/src/main/java/org/avni/server/domain/Organisation.java index 36a80085c..01ad781e6 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Organisation.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Organisation.java @@ -5,7 +5,7 @@ import org.avni.server.domain.organisation.OrganisationStatus; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/OrganisationAwareEntity.java b/avni-server-api/src/main/java/org/avni/server/domain/OrganisationAwareEntity.java index d68c03f6c..ffba75d74 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/OrganisationAwareEntity.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/OrganisationAwareEntity.java @@ -1,8 +1,8 @@ package org.avni.server.domain; import com.fasterxml.jackson.annotation.JsonIgnore; -import javax.persistence.Column; -import javax.persistence.MappedSuperclass; +import jakarta.persistence.Column; +import jakarta.persistence.MappedSuperclass; @MappedSuperclass public class OrganisationAwareEntity extends CHSEntity { diff --git a/avni-server-api/src/main/java/org/avni/server/domain/OrganisationConfig.java b/avni-server-api/src/main/java/org/avni/server/domain/OrganisationConfig.java index 6aa0dbfd5..6eb9a8bfa 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/OrganisationConfig.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/OrganisationConfig.java @@ -12,9 +12,8 @@ import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Type; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Table; +import jakarta.persistence.Column; +import jakarta.persistence.*; import java.util.*; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/OrganisationGroup.java b/avni-server-api/src/main/java/org/avni/server/domain/OrganisationGroup.java index 2e2598c7a..d32224afa 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/OrganisationGroup.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/OrganisationGroup.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.HashSet; import java.util.Set; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/OrganisationGroupOrganisation.java b/avni-server-api/src/main/java/org/avni/server/domain/OrganisationGroupOrganisation.java index 9b0b3b9a4..177291194 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/OrganisationGroupOrganisation.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/OrganisationGroupOrganisation.java @@ -2,7 +2,7 @@ import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; @Entity @Table(name = "organisation_group_organisation") diff --git a/avni-server-api/src/main/java/org/avni/server/domain/ParentLocationMapping.java b/avni-server-api/src/main/java/org/avni/server/domain/ParentLocationMapping.java index b0255947b..834637c86 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/ParentLocationMapping.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/ParentLocationMapping.java @@ -2,7 +2,7 @@ import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; @Entity @Table(name = "location_location_mapping") diff --git a/avni-server-api/src/main/java/org/avni/server/domain/PlatformTranslation.java b/avni-server-api/src/main/java/org/avni/server/domain/PlatformTranslation.java index fcc968912..d35cf78ec 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/PlatformTranslation.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/PlatformTranslation.java @@ -5,7 +5,7 @@ import org.hibernate.annotations.Type; import org.avni.server.application.Platform; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Program.java b/avni-server-api/src/main/java/org/avni/server/domain/Program.java index 704117142..3897ad978 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Program.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Program.java @@ -9,7 +9,7 @@ import org.hibernate.annotations.Type; import org.springframework.data.rest.core.config.Projection; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.HashSet; import java.util.Objects; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/ProgramEncounter.java b/avni-server-api/src/main/java/org/avni/server/domain/ProgramEncounter.java index 57cf9466a..362425813 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/ProgramEncounter.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/ProgramEncounter.java @@ -9,7 +9,7 @@ import org.avni.server.domain.EncounterType.EncounterTypeProjection; import org.springframework.data.rest.core.config.Projection; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/ProgramEnrolment.java b/avni-server-api/src/main/java/org/avni/server/domain/ProgramEnrolment.java index f54af1691..c0a9df222 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/ProgramEnrolment.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/ProgramEnrolment.java @@ -11,7 +11,7 @@ import org.joda.time.DateTime; import org.avni.server.geo.Point; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.HashSet; import java.util.Set; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/ReportCard.java b/avni-server-api/src/main/java/org/avni/server/domain/ReportCard.java index 0868e7f09..c4cd578f2 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/ReportCard.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/ReportCard.java @@ -7,7 +7,7 @@ import org.hibernate.annotations.Type; import org.springframework.util.StringUtils; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.HashMap; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/ResetSync.java b/avni-server-api/src/main/java/org/avni/server/domain/ResetSync.java index 6c12a8742..951e7afd6 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/ResetSync.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/ResetSync.java @@ -2,7 +2,7 @@ import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; @Entity @Table(name = "reset_sync") diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Rule.java b/avni-server-api/src/main/java/org/avni/server/domain/Rule.java index 31d78e2d4..a931b8867 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Rule.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Rule.java @@ -6,7 +6,7 @@ import org.hibernate.annotations.Type; import org.avni.server.application.RuleType; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity(name = "rule") diff --git a/avni-server-api/src/main/java/org/avni/server/domain/RuleDependency.java b/avni-server-api/src/main/java/org/avni/server/domain/RuleDependency.java index 46a0abad4..d4668c3f6 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/RuleDependency.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/RuleDependency.java @@ -2,7 +2,7 @@ import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.Set; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/RuleFailureLog.java b/avni-server-api/src/main/java/org/avni/server/domain/RuleFailureLog.java index 1645df842..05ee3f077 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/RuleFailureLog.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/RuleFailureLog.java @@ -2,9 +2,7 @@ import org.hibernate.annotations.BatchSize; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Table; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.io.PrintWriter; import java.io.StringWriter; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/RuleFailureTelemetry.java b/avni-server-api/src/main/java/org/avni/server/domain/RuleFailureTelemetry.java index d6180a0c6..98e265756 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/RuleFailureTelemetry.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/RuleFailureTelemetry.java @@ -14,7 +14,7 @@ import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.Date; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/StandardReportCardType.java b/avni-server-api/src/main/java/org/avni/server/domain/StandardReportCardType.java index ddabba016..e12f0a603 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/StandardReportCardType.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/StandardReportCardType.java @@ -3,7 +3,7 @@ import org.hibernate.annotations.BatchSize; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/SubjectMigration.java b/avni-server-api/src/main/java/org/avni/server/domain/SubjectMigration.java index dcd878ae0..562e84068 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/SubjectMigration.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/SubjectMigration.java @@ -4,7 +4,7 @@ import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.DynamicInsert; -import javax.persistence.*; +import jakarta.persistence.*; @Entity @Table(name = "subject_migration") diff --git a/avni-server-api/src/main/java/org/avni/server/domain/SubjectType.java b/avni-server-api/src/main/java/org/avni/server/domain/SubjectType.java index 7886bbe7d..34d84e201 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/SubjectType.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/SubjectType.java @@ -13,7 +13,7 @@ import org.hibernate.annotations.Type; import org.springframework.data.rest.core.config.Projection; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.*; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/SyncAttributeEntity.java b/avni-server-api/src/main/java/org/avni/server/domain/SyncAttributeEntity.java index 37b0fac01..d7c95846e 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/SyncAttributeEntity.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/SyncAttributeEntity.java @@ -2,8 +2,8 @@ import com.fasterxml.jackson.annotation.JsonIgnore; -import javax.persistence.Column; -import javax.persistence.MappedSuperclass; +import jakarta.persistence.Column; +import jakarta.persistence.MappedSuperclass; @MappedSuperclass public class SyncAttributeEntity extends OrganisationAwareEntity { diff --git a/avni-server-api/src/main/java/org/avni/server/domain/SyncTelemetry.java b/avni-server-api/src/main/java/org/avni/server/domain/SyncTelemetry.java index ecc5ff20a..34bcaca51 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/SyncTelemetry.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/SyncTelemetry.java @@ -5,7 +5,7 @@ import org.hibernate.annotations.Type; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Translation.java b/avni-server-api/src/main/java/org/avni/server/domain/Translation.java index 2f4381410..4e93fb61f 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Translation.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Translation.java @@ -4,7 +4,7 @@ import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/User.java b/avni-server-api/src/main/java/org/avni/server/domain/User.java index 63f8a6dee..0296d8ccb 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/User.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/User.java @@ -11,10 +11,11 @@ import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Type; -import org.hibernate.proxy.HibernateProxyHelper; +import org.hibernate.proxy.HibernateProxy; +import org.hibernate.proxy.LazyInitializer; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.*; import java.util.stream.Collectors; @@ -236,12 +237,15 @@ public void setUserGroups(List userGroups) { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || HibernateProxyHelper.getClassWithoutInitializingProxy(this) != HibernateProxyHelper.getClassWithoutInitializingProxy(o)) return false; - User other = (User) o; + LazyInitializer lazyInitializer1 = HibernateProxy.extractLazyInitializer(this); + LazyInitializer lazyInitializer2 = HibernateProxy.extractLazyInitializer(o); + if (o == null || lazyInitializer2 == null || lazyInitializer1 == null || lazyInitializer1.getImplementationClass() != lazyInitializer2.getImplementationClass()) return false; - if (getId() != null ? !getId().equals(other.getId()) : other.getId() != null) return false; - return getUuid() != null ? getUuid().equals(other.getUuid()) : other.getUuid() == null; + User that = (User) o; + + if (getId() != null ? !getId().equals(that.getId()) : that.getId() != null) return false; + return getUuid() != null ? getUuid().equals(that.getUuid()) : that.getUuid() == null; } @Override diff --git a/avni-server-api/src/main/java/org/avni/server/domain/UserGroup.java b/avni-server-api/src/main/java/org/avni/server/domain/UserGroup.java index b2d970870..e6a9ba788 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/UserGroup.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/UserGroup.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.UUID; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/UserSubject.java b/avni-server-api/src/main/java/org/avni/server/domain/UserSubject.java index ee4f463a0..dd7c35211 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/UserSubject.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/UserSubject.java @@ -1,7 +1,6 @@ package org.avni.server.domain; -import javax.persistence.Entity; -import javax.persistence.ManyToOne; +import jakarta.persistence.*; @Entity public class UserSubject extends OrganisationAwareEntity { diff --git a/avni-server-api/src/main/java/org/avni/server/domain/UserSubjectAssignment.java b/avni-server-api/src/main/java/org/avni/server/domain/UserSubjectAssignment.java index e79bc851c..2c9061f8b 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/UserSubjectAssignment.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/UserSubjectAssignment.java @@ -2,7 +2,7 @@ import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/Video.java b/avni-server-api/src/main/java/org/avni/server/domain/Video.java index c82bf7680..8db80047a 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/Video.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/Video.java @@ -2,8 +2,7 @@ import org.hibernate.annotations.BatchSize; -import javax.persistence.Entity; -import javax.persistence.Table; +import jakarta.persistence.*; @Entity @Table(name = "video") diff --git a/avni-server-api/src/main/java/org/avni/server/domain/VideoTelemetric.java b/avni-server-api/src/main/java/org/avni/server/domain/VideoTelemetric.java index 978bb90e1..686a7e154 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/VideoTelemetric.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/VideoTelemetric.java @@ -3,7 +3,7 @@ import org.hibernate.annotations.BatchSize; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/VirtualCatchment.java b/avni-server-api/src/main/java/org/avni/server/domain/VirtualCatchment.java index f8d99bad1..513de2766 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/VirtualCatchment.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/VirtualCatchment.java @@ -3,7 +3,7 @@ import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.CacheConcurrencyStrategy; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.Objects; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/accessControl/GroupPrivilege.java b/avni-server-api/src/main/java/org/avni/server/domain/accessControl/GroupPrivilege.java index 66706096c..9a86a76fb 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/accessControl/GroupPrivilege.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/accessControl/GroupPrivilege.java @@ -4,7 +4,7 @@ import org.avni.server.domain.*; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/accessControl/Privilege.java b/avni-server-api/src/main/java/org/avni/server/domain/accessControl/Privilege.java index 9892c5829..195f0bd76 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/accessControl/Privilege.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/accessControl/Privilege.java @@ -1,6 +1,6 @@ package org.avni.server.domain.accessControl; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import org.avni.server.domain.CHSBaseEntity; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/app/dashboard/DashboardFilter.java b/avni-server-api/src/main/java/org/avni/server/domain/app/dashboard/DashboardFilter.java index 43517f9c4..da58d745a 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/app/dashboard/DashboardFilter.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/app/dashboard/DashboardFilter.java @@ -7,7 +7,7 @@ import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.List; import java.util.Map; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/extenalSystem/ExternalSystemConfig.java b/avni-server-api/src/main/java/org/avni/server/domain/extenalSystem/ExternalSystemConfig.java index 31c2920ac..23a8902e9 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/extenalSystem/ExternalSystemConfig.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/extenalSystem/ExternalSystemConfig.java @@ -5,10 +5,7 @@ import org.avni.server.framework.hibernate.JSONObjectUserType; import org.hibernate.annotations.Type; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity(name="external_system_config") diff --git a/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelation.java b/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelation.java index 8725c1566..08ec6edbf 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelation.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelation.java @@ -3,10 +3,7 @@ import org.avni.server.domain.OrganisationAwareEntity; import org.hibernate.annotations.BatchSize; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.OneToMany; -import javax.persistence.Table; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import java.util.HashSet; import java.util.Set; diff --git a/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelationGenderMapping.java b/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelationGenderMapping.java index 40e39e807..2d4e0e0ac 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelationGenderMapping.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelationGenderMapping.java @@ -4,7 +4,7 @@ import org.avni.server.domain.OrganisationAwareEntity; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelationship.java b/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelationship.java index b2da72fc3..7af252961 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelationship.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelationship.java @@ -9,7 +9,7 @@ import org.avni.server.domain.ObservationCollection; import org.avni.server.domain.OrganisationAwareEntity; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelationshipType.java b/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelationshipType.java index 4227450ee..3ce772eb8 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelationshipType.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/individualRelationship/IndividualRelationshipType.java @@ -3,7 +3,7 @@ import org.avni.server.domain.OrganisationAwareEntity; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/organisation/OrganisationCategory.java b/avni-server-api/src/main/java/org/avni/server/domain/organisation/OrganisationCategory.java index c38282fe4..d70d4c4dd 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/organisation/OrganisationCategory.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/organisation/OrganisationCategory.java @@ -2,7 +2,7 @@ import org.avni.server.domain.CHSEntity; -import javax.persistence.Entity; +import jakarta.persistence.*; @Entity public class OrganisationCategory extends CHSEntity { diff --git a/avni-server-api/src/main/java/org/avni/server/domain/organisation/OrganisationStatus.java b/avni-server-api/src/main/java/org/avni/server/domain/organisation/OrganisationStatus.java index eff982d21..bd1680b8a 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/organisation/OrganisationStatus.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/organisation/OrganisationStatus.java @@ -2,7 +2,7 @@ import org.avni.server.domain.CHSEntity; -import javax.persistence.Entity; +import jakarta.persistence.*; @Entity public class OrganisationStatus extends CHSEntity { diff --git a/avni-server-api/src/main/java/org/avni/server/domain/program/SubjectProgramEligibility.java b/avni-server-api/src/main/java/org/avni/server/domain/program/SubjectProgramEligibility.java index aa9e94d35..4875c6d44 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/program/SubjectProgramEligibility.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/program/SubjectProgramEligibility.java @@ -8,7 +8,7 @@ import org.hibernate.annotations.Type; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity(name = "subject_program_eligibility") diff --git a/avni-server-api/src/main/java/org/avni/server/domain/task/Task.java b/avni-server-api/src/main/java/org/avni/server/domain/task/Task.java index 4f3066537..c18e20ff5 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/task/Task.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/task/Task.java @@ -9,7 +9,7 @@ import org.hibernate.annotations.Type; import org.joda.time.DateTime; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/task/TaskStatus.java b/avni-server-api/src/main/java/org/avni/server/domain/task/TaskStatus.java index 414f68f75..ec7ead2d5 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/task/TaskStatus.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/task/TaskStatus.java @@ -3,7 +3,7 @@ import org.avni.server.domain.OrganisationAwareEntity; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/task/TaskType.java b/avni-server-api/src/main/java/org/avni/server/domain/task/TaskType.java index 8ddd6563a..b680541db 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/task/TaskType.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/task/TaskType.java @@ -6,7 +6,7 @@ import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/domain/task/TaskUnAssignment.java b/avni-server-api/src/main/java/org/avni/server/domain/task/TaskUnAssignment.java index f7696d803..c48976578 100644 --- a/avni-server-api/src/main/java/org/avni/server/domain/task/TaskUnAssignment.java +++ b/avni-server-api/src/main/java/org/avni/server/domain/task/TaskUnAssignment.java @@ -4,7 +4,7 @@ import org.avni.server.domain.User; import org.hibernate.annotations.BatchSize; -import javax.persistence.*; +import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; @Entity diff --git a/avni-server-api/src/main/java/org/avni/server/exporter/ExportJobService.java b/avni-server-api/src/main/java/org/avni/server/exporter/ExportJobService.java index cfea5f241..bb42786e2 100644 --- a/avni-server-api/src/main/java/org/avni/server/exporter/ExportJobService.java +++ b/avni-server-api/src/main/java/org/avni/server/exporter/ExportJobService.java @@ -34,7 +34,7 @@ import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.RequestBody; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import jakarta.validation.constraints.NotNull; import java.util.UUID; diff --git a/avni-server-api/src/main/java/org/avni/server/framework/hibernate/DummyInterceptor.java b/avni-server-api/src/main/java/org/avni/server/framework/hibernate/DummyInterceptor.java index b6036f1d8..1e3641f86 100644 --- a/avni-server-api/src/main/java/org/avni/server/framework/hibernate/DummyInterceptor.java +++ b/avni-server-api/src/main/java/org/avni/server/framework/hibernate/DummyInterceptor.java @@ -8,7 +8,7 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @Component /** diff --git a/avni-server-api/src/main/java/org/avni/server/framework/hibernate/package-info.java b/avni-server-api/src/main/java/org/avni/server/framework/hibernate/package-info.java deleted file mode 100644 index 6ef2cef89..000000000 --- a/avni-server-api/src/main/java/org/avni/server/framework/hibernate/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -@org.hibernate.annotations.TypeDefs({ - @org.hibernate.annotations.TypeDef(name = "observations", typeClass = ObservationCollectionUserType.class), - @org.hibernate.annotations.TypeDef(name = "ruleData", typeClass = RuleDataUserType.class), - @org.hibernate.annotations.TypeDef(name = "keyValues", typeClass = KeyValuesUserType.class), - @org.hibernate.annotations.TypeDef(name = "status", typeClass = ChecklistItemUserType.class), - @org.hibernate.annotations.TypeDef(name = "jsonObject", typeClass = JSONObjectUserType.class), - @org.hibernate.annotations.TypeDef(name = "ruledEntity", typeClass = RuledEntityUserType.class), - @org.hibernate.annotations.TypeDef(name = "declarativeRule", typeClass = DeclarativeRuleUserType.class), - @org.hibernate.annotations.TypeDef(name = "metadataSearchFields", typeClass = ArrayUserType.class), - @org.hibernate.annotations.TypeDef(name = "parameters", typeClass = ArrayUserType.class), - @org.hibernate.annotations.TypeDef(name = "nextTriggerDetails", typeClass = NextTriggerDetailsUserType.class) -}) - -package org.avni.server.framework.hibernate; - diff --git a/avni-server-api/src/main/java/org/avni/server/framework/postgres/CHSPostgreSQLDialect.java b/avni-server-api/src/main/java/org/avni/server/framework/postgres/CHSPostgreSQLDialect.java deleted file mode 100644 index a5d1d01a5..000000000 --- a/avni-server-api/src/main/java/org/avni/server/framework/postgres/CHSPostgreSQLDialect.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.avni.server.framework.postgres; - -import org.hibernate.dialect.PostgreSQL10Dialect; -import org.hibernate.type.StandardBasicTypes; -import org.hibernate.type.descriptor.jdbc.JdbcType; -import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeRegistry; - -import java.sql.Types; - -public class CHSPostgreSQLDialect extends PostgreSQL10Dialect { - private static final String JSONB = "jsonb"; - private static final String JSON = "json"; - - public CHSPostgreSQLDialect() { - super(); -// this.registerColumnTypes(); -// this.registerColumnType(Types.JAVA_OBJECT, JSONB); -// this.registerColumnType(Types.JAVA_OBJECT, JSON); - } -} diff --git a/avni-server-api/src/main/java/org/avni/server/identifier/PrefixedUserPoolBasedIdentifierGenerator.java b/avni-server-api/src/main/java/org/avni/server/identifier/PrefixedUserPoolBasedIdentifierGenerator.java index 0a5c6c2be..76b93ebe9 100644 --- a/avni-server-api/src/main/java/org/avni/server/identifier/PrefixedUserPoolBasedIdentifierGenerator.java +++ b/avni-server-api/src/main/java/org/avni/server/identifier/PrefixedUserPoolBasedIdentifierGenerator.java @@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.ArrayList; import java.util.Iterator; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/identifier/UserPoolBasedIdentifierGenerator.java b/avni-server-api/src/main/java/org/avni/server/identifier/UserPoolBasedIdentifierGenerator.java index 31dca3990..9a14d0f53 100644 --- a/avni-server-api/src/main/java/org/avni/server/identifier/UserPoolBasedIdentifierGenerator.java +++ b/avni-server-api/src/main/java/org/avni/server/identifier/UserPoolBasedIdentifierGenerator.java @@ -7,7 +7,7 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @Service diff --git a/avni-server-api/src/main/java/org/avni/server/importer/batch/JobService.java b/avni-server-api/src/main/java/org/avni/server/importer/batch/JobService.java index 8c6b3fbdc..fdd0ffaa0 100644 --- a/avni-server-api/src/main/java/org/avni/server/importer/batch/JobService.java +++ b/avni-server-api/src/main/java/org/avni/server/importer/batch/JobService.java @@ -19,7 +19,7 @@ import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import jakarta.validation.constraints.NotNull; import java.time.LocalDateTime; diff --git a/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/BulkLocationCreator.java b/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/BulkLocationCreator.java index b98dfbd13..842fbe92e 100644 --- a/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/BulkLocationCreator.java +++ b/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/BulkLocationCreator.java @@ -20,7 +20,7 @@ import org.springframework.stereotype.Component; import org.springframework.util.StringUtils; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.*; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/BulkLocationEditor.java b/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/BulkLocationEditor.java index 3630d9a3f..64b42a855 100644 --- a/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/BulkLocationEditor.java +++ b/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/BulkLocationEditor.java @@ -12,7 +12,7 @@ import org.springframework.stereotype.Component; import org.springframework.util.StringUtils; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/SubjectWriter.java b/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/SubjectWriter.java index 1822565ff..3f092294c 100644 --- a/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/SubjectWriter.java +++ b/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/SubjectWriter.java @@ -1,5 +1,6 @@ package org.avni.server.importer.batch.csv.writer; +import org.springframework.util.StringUtils; import org.avni.server.application.FormMapping; import org.avni.server.application.FormType; import org.avni.server.application.Subject; @@ -12,7 +13,7 @@ import org.avni.server.importer.batch.csv.writer.header.SubjectHeaders; import org.avni.server.importer.batch.model.Row; import org.avni.server.service.*; -import org.jadira.usertype.spi.utils.lang.StringUtils; +//import org.jadira.usertype.spi.utils.lang.StringUtils; import org.joda.time.LocalDate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -136,10 +137,10 @@ private void write(Row row) throws Exception { private void setProfilePicture(SubjectType subjectType, Individual individual, Row row, List errorMsgs) { try { String profilePicUrl = row.get(SubjectHeaders.profilePicture); - if(StringUtils.isNotEmpty(profilePicUrl) && subjectType.isAllowProfilePicture()) { + if(!StringUtils.isEmpty(profilePicUrl) && subjectType.isAllowProfilePicture()) { individual.setProfilePicture(s3Service .uploadProfilePic(profilePicUrl, null)); - } else if(StringUtils.isNotEmpty(profilePicUrl)) { + } else if(!StringUtils.isEmpty(profilePicUrl)) { errorMsgs.add(String.format("Not allowed to set '%s'", SubjectHeaders.profilePicture)); } } catch (Exception e) { diff --git a/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/UserAndCatchmentWriter.java b/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/UserAndCatchmentWriter.java index 0f503f95c..278832d21 100644 --- a/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/UserAndCatchmentWriter.java +++ b/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/UserAndCatchmentWriter.java @@ -21,7 +21,7 @@ import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.io.Serializable; import java.util.*; import java.util.regex.Matcher; diff --git a/avni-server-api/src/main/java/org/avni/server/importer/batch/userSubjectType/UserSubjectTypeCreateTasklet.java b/avni-server-api/src/main/java/org/avni/server/importer/batch/userSubjectType/UserSubjectTypeCreateTasklet.java index c23f0d93d..2b5d0cc5a 100644 --- a/avni-server-api/src/main/java/org/avni/server/importer/batch/userSubjectType/UserSubjectTypeCreateTasklet.java +++ b/avni-server-api/src/main/java/org/avni/server/importer/batch/userSubjectType/UserSubjectTypeCreateTasklet.java @@ -14,7 +14,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @Component @JobScope diff --git a/avni-server-api/src/main/java/org/avni/server/report/ReportHelper.java b/avni-server-api/src/main/java/org/avni/server/report/ReportHelper.java index 09d29898d..771b71645 100644 --- a/avni-server-api/src/main/java/org/avni/server/report/ReportHelper.java +++ b/avni-server-api/src/main/java/org/avni/server/report/ReportHelper.java @@ -7,7 +7,7 @@ import org.avni.server.util.S; import org.springframework.stereotype.Component; -import javax.persistence.EntityNotFoundException; +import jakarta.persistence.*; import java.util.List; import static java.lang.String.format; diff --git a/avni-server-api/src/main/java/org/avni/server/service/AddressLevelCache.java b/avni-server-api/src/main/java/org/avni/server/service/AddressLevelCache.java index 5f7f67174..27073f72a 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/AddressLevelCache.java +++ b/avni-server-api/src/main/java/org/avni/server/service/AddressLevelCache.java @@ -9,7 +9,7 @@ import org.springframework.stereotype.Component; import jakarta.persistence.EntityManager; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; @Component diff --git a/avni-server-api/src/main/java/org/avni/server/service/CatchmentService.java b/avni-server-api/src/main/java/org/avni/server/service/CatchmentService.java index 781db786e..8c9478253 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/CatchmentService.java +++ b/avni-server-api/src/main/java/org/avni/server/service/CatchmentService.java @@ -17,7 +17,7 @@ import org.springframework.stereotype.Service; import jakarta.persistence.EntityManager; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.ArrayList; import java.util.HashSet; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/service/ChecklistService.java b/avni-server-api/src/main/java/org/avni/server/service/ChecklistService.java index 3ae0e8969..57aaf2464 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/ChecklistService.java +++ b/avni-server-api/src/main/java/org/avni/server/service/ChecklistService.java @@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Set; @Component diff --git a/avni-server-api/src/main/java/org/avni/server/service/IdentifierAssignmentService.java b/avni-server-api/src/main/java/org/avni/server/service/IdentifierAssignmentService.java index 7ff80abfd..60a81d810 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/IdentifierAssignmentService.java +++ b/avni-server-api/src/main/java/org/avni/server/service/IdentifierAssignmentService.java @@ -16,7 +16,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Service; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/service/IndividualService.java b/avni-server-api/src/main/java/org/avni/server/service/IndividualService.java index 146cd3a7e..066a5fb5e 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/IndividualService.java +++ b/avni-server-api/src/main/java/org/avni/server/service/IndividualService.java @@ -30,8 +30,8 @@ import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; -import javax.persistence.EntityNotFoundException; -import javax.transaction.Transactional; +import jakarta.persistence.*; +import jakarta.transaction.Transactional; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; diff --git a/avni-server-api/src/main/java/org/avni/server/service/KeycloakIdpService.java b/avni-server-api/src/main/java/org/avni/server/service/KeycloakIdpService.java index 7c3ab5ed0..355fe0573 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/KeycloakIdpService.java +++ b/avni-server-api/src/main/java/org/avni/server/service/KeycloakIdpService.java @@ -23,7 +23,7 @@ import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; -import javax.persistence.EntityNotFoundException; +import jakarta.persistence.*; import javax.ws.rs.BadRequestException; import javax.ws.rs.ClientErrorException; import javax.ws.rs.ServerErrorException; diff --git a/avni-server-api/src/main/java/org/avni/server/service/OrganisationConfigService.java b/avni-server-api/src/main/java/org/avni/server/service/OrganisationConfigService.java index 3846af61a..ba5f545d8 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/OrganisationConfigService.java +++ b/avni-server-api/src/main/java/org/avni/server/service/OrganisationConfigService.java @@ -30,7 +30,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.*; import java.util.function.Predicate; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/service/ProgramEnrolmentService.java b/avni-server-api/src/main/java/org/avni/server/service/ProgramEnrolmentService.java index 30eeeb336..fd9212c1b 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/ProgramEnrolmentService.java +++ b/avni-server-api/src/main/java/org/avni/server/service/ProgramEnrolmentService.java @@ -24,7 +24,7 @@ import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Service; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/service/RuleService.java b/avni-server-api/src/main/java/org/avni/server/service/RuleService.java index cf5064739..2fb7efbf9 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/RuleService.java +++ b/avni-server-api/src/main/java/org/avni/server/service/RuleService.java @@ -28,7 +28,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.io.PrintWriter; import java.io.StringWriter; diff --git a/avni-server-api/src/main/java/org/avni/server/service/SubjectMigrationService.java b/avni-server-api/src/main/java/org/avni/server/service/SubjectMigrationService.java index 7f01a2446..06f080d61 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/SubjectMigrationService.java +++ b/avni-server-api/src/main/java/org/avni/server/service/SubjectMigrationService.java @@ -16,7 +16,7 @@ import org.springframework.data.domain.PageRequest; import org.springframework.stereotype.Service; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.*; @Service diff --git a/avni-server-api/src/main/java/org/avni/server/service/SubjectSyncResponseBuilderService.java b/avni-server-api/src/main/java/org/avni/server/service/SubjectSyncResponseBuilderService.java index 8c94d5a99..547036c48 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/SubjectSyncResponseBuilderService.java +++ b/avni-server-api/src/main/java/org/avni/server/service/SubjectSyncResponseBuilderService.java @@ -9,7 +9,7 @@ import org.avni.server.web.response.SyncSubjectResponse; import org.springframework.stereotype.Service; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/service/SubjectTypeService.java b/avni-server-api/src/main/java/org/avni/server/service/SubjectTypeService.java index 6a2ea1ec3..c2e5037b9 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/SubjectTypeService.java +++ b/avni-server-api/src/main/java/org/avni/server/service/SubjectTypeService.java @@ -25,7 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.*; import java.util.function.Predicate; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/service/SyncDetailsService.java b/avni-server-api/src/main/java/org/avni/server/service/SyncDetailsService.java index 4c50a6754..db229bcde 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/SyncDetailsService.java +++ b/avni-server-api/src/main/java/org/avni/server/service/SyncDetailsService.java @@ -16,7 +16,7 @@ import org.avni.server.service.accessControl.GroupPrivilegeService; import org.springframework.stereotype.Service; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.*; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/service/UserSubjectAssignmentService.java b/avni-server-api/src/main/java/org/avni/server/service/UserSubjectAssignmentService.java index c1f9dc180..b542bd114 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/UserSubjectAssignmentService.java +++ b/avni-server-api/src/main/java/org/avni/server/service/UserSubjectAssignmentService.java @@ -17,7 +17,7 @@ import org.springframework.data.projection.SpelAwareProxyProjectionFactory; import org.springframework.stereotype.Service; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.math.BigInteger; import java.util.*; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/service/exception/GroupNotFoundException.java b/avni-server-api/src/main/java/org/avni/server/service/exception/GroupNotFoundException.java index 4ece11b49..4d8fc746a 100644 --- a/avni-server-api/src/main/java/org/avni/server/service/exception/GroupNotFoundException.java +++ b/avni-server-api/src/main/java/org/avni/server/service/exception/GroupNotFoundException.java @@ -1,6 +1,6 @@ package org.avni.server.service.exception; -import javax.persistence.EntityNotFoundException; +import jakarta.persistence.*; public class GroupNotFoundException extends EntityNotFoundException { diff --git a/avni-server-api/src/main/java/org/avni/server/web/AccountController.java b/avni-server-api/src/main/java/org/avni/server/web/AccountController.java index ccc275357..9fe4fac3c 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/AccountController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/AccountController.java @@ -16,7 +16,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.HashSet; import java.util.Set; diff --git a/avni-server-api/src/main/java/org/avni/server/web/AddressLevelTypeController.java b/avni-server-api/src/main/java/org/avni/server/web/AddressLevelTypeController.java index 4eb6c1b9c..edf54efb2 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/AddressLevelTypeController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/AddressLevelTypeController.java @@ -20,7 +20,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; import java.util.Set; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/web/CatchmentController.java b/avni-server-api/src/main/java/org/avni/server/web/CatchmentController.java index a2b3448c3..3685ea6aa 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/CatchmentController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/CatchmentController.java @@ -29,7 +29,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import jakarta.validation.Valid; import java.util.List; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/web/ChecklistController.java b/avni-server-api/src/main/java/org/avni/server/web/ChecklistController.java index 4c888ba21..d641467cd 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/ChecklistController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/ChecklistController.java @@ -23,7 +23,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Collections; import static org.avni.server.web.resourceProcessors.ResourceProcessor.addAuditFields; diff --git a/avni-server-api/src/main/java/org/avni/server/web/ChecklistDetailController.java b/avni-server-api/src/main/java/org/avni/server/web/ChecklistDetailController.java index 7393e19b4..fbaf3022b 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/ChecklistDetailController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/ChecklistDetailController.java @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; @RestController diff --git a/avni-server-api/src/main/java/org/avni/server/web/ChecklistItemController.java b/avni-server-api/src/main/java/org/avni/server/web/ChecklistItemController.java index 5f905281d..ece7bd977 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/ChecklistItemController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/ChecklistItemController.java @@ -23,7 +23,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Collections; import static org.avni.server.web.resourceProcessors.ResourceProcessor.addAuditFields; diff --git a/avni-server-api/src/main/java/org/avni/server/web/CommentController.java b/avni-server-api/src/main/java/org/avni/server/web/CommentController.java index 060a237a5..c5b5b1866 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/CommentController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/CommentController.java @@ -25,7 +25,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Collections; import java.util.List; import java.util.Optional; diff --git a/avni-server-api/src/main/java/org/avni/server/web/CommentThreadController.java b/avni-server-api/src/main/java/org/avni/server/web/CommentThreadController.java index dab70ad3f..56c6238cf 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/CommentThreadController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/CommentThreadController.java @@ -26,7 +26,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Collections; import java.util.List; import java.util.Optional; diff --git a/avni-server-api/src/main/java/org/avni/server/web/ConceptController.java b/avni-server-api/src/main/java/org/avni/server/web/ConceptController.java index 797cba402..d38dee8fb 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/ConceptController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/ConceptController.java @@ -29,7 +29,7 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.util.HtmlUtils; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/web/CustomQueryController.java b/avni-server-api/src/main/java/org/avni/server/web/CustomQueryController.java index 459dee22b..d14a8157d 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/CustomQueryController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/CustomQueryController.java @@ -8,7 +8,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @RestController public class CustomQueryController { diff --git a/avni-server-api/src/main/java/org/avni/server/web/DashboardController.java b/avni-server-api/src/main/java/org/avni/server/web/DashboardController.java index e4e449fd0..11531db77 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/DashboardController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/DashboardController.java @@ -24,7 +24,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Collections; import java.util.List; import java.util.Optional; diff --git a/avni-server-api/src/main/java/org/avni/server/web/DocumentationController.java b/avni-server-api/src/main/java/org/avni/server/web/DocumentationController.java index 78d0c0d41..e6a9f71cc 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/DocumentationController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/DocumentationController.java @@ -14,7 +14,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; @RestController diff --git a/avni-server-api/src/main/java/org/avni/server/web/EncounterController.java b/avni-server-api/src/main/java/org/avni/server/web/EncounterController.java index d28cc836c..335206233 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/EncounterController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/EncounterController.java @@ -35,7 +35,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Collections; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/web/EncounterTypeController.java b/avni-server-api/src/main/java/org/avni/server/web/EncounterTypeController.java index dd3606a68..9a4c418a6 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/EncounterTypeController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/EncounterTypeController.java @@ -28,7 +28,7 @@ import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/web/EntityApprovalStatusController.java b/avni-server-api/src/main/java/org/avni/server/web/EntityApprovalStatusController.java index 29b8e8f2f..616edbbb2 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/EntityApprovalStatusController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/EntityApprovalStatusController.java @@ -27,7 +27,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Collections; import static org.avni.server.web.resourceProcessors.ResourceProcessor.addAuditFields; diff --git a/avni-server-api/src/main/java/org/avni/server/web/ExtensionController.java b/avni-server-api/src/main/java/org/avni/server/web/ExtensionController.java index 757368b6f..c229672df 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/ExtensionController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/ExtensionController.java @@ -30,7 +30,7 @@ import org.springframework.web.servlet.HandlerMapping; import jakarta.servlet.http.HttpServletRequest; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import jakarta.validation.Valid; import java.io.IOException; import java.io.InputStream; diff --git a/avni-server-api/src/main/java/org/avni/server/web/FormController.java b/avni-server-api/src/main/java/org/avni/server/web/FormController.java index c2d39a9d1..525f450b3 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/FormController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/FormController.java @@ -46,7 +46,7 @@ import org.springframework.web.bind.annotation.*; import jakarta.persistence.criteria.Predicate; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.io.InvalidObjectException; import java.util.*; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/web/FormMappingController.java b/avni-server-api/src/main/java/org/avni/server/web/FormMappingController.java index 982d53d95..cbfdb42d2 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/FormMappingController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/FormMappingController.java @@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; @RestController diff --git a/avni-server-api/src/main/java/org/avni/server/web/GenderController.java b/avni-server-api/src/main/java/org/avni/server/web/GenderController.java index 8b2172a46..903ec2e56 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/GenderController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/GenderController.java @@ -14,7 +14,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; @RestController diff --git a/avni-server-api/src/main/java/org/avni/server/web/GroupDashboardController.java b/avni-server-api/src/main/java/org/avni/server/web/GroupDashboardController.java index 7415f9a01..0a16f95f9 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/GroupDashboardController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/GroupDashboardController.java @@ -19,7 +19,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/web/GroupPrivilegeController.java b/avni-server-api/src/main/java/org/avni/server/web/GroupPrivilegeController.java index eff7fcd1c..7e4e62b48 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/GroupPrivilegeController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/GroupPrivilegeController.java @@ -13,7 +13,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.ArrayList; import java.util.List; import java.util.Optional; diff --git a/avni-server-api/src/main/java/org/avni/server/web/GroupRoleController.java b/avni-server-api/src/main/java/org/avni/server/web/GroupRoleController.java index 43c1f877d..8335f59f5 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/GroupRoleController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/GroupRoleController.java @@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @RestController public class GroupRoleController implements RestControllerResourceProcessor { diff --git a/avni-server-api/src/main/java/org/avni/server/web/GroupSubjectController.java b/avni-server-api/src/main/java/org/avni/server/web/GroupSubjectController.java index 0bee3fb5f..70e381784 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/GroupSubjectController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/GroupSubjectController.java @@ -32,7 +32,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/web/GroupsController.java b/avni-server-api/src/main/java/org/avni/server/web/GroupsController.java index 2069d5b77..70639935e 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/GroupsController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/GroupsController.java @@ -20,7 +20,7 @@ import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/web/IdentifierAssignmentController.java b/avni-server-api/src/main/java/org/avni/server/web/IdentifierAssignmentController.java index e0cf48afe..855b0d0e8 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/IdentifierAssignmentController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/IdentifierAssignmentController.java @@ -21,7 +21,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import static org.avni.server.web.resourceProcessors.ResourceProcessor.addAuditFields; diff --git a/avni-server-api/src/main/java/org/avni/server/web/IdentifierSourceController.java b/avni-server-api/src/main/java/org/avni/server/web/IdentifierSourceController.java index 89d6ef758..6ab067eec 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/IdentifierSourceController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/IdentifierSourceController.java @@ -20,7 +20,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; @RestController diff --git a/avni-server-api/src/main/java/org/avni/server/web/IdentifierSourceWebController.java b/avni-server-api/src/main/java/org/avni/server/web/IdentifierSourceWebController.java index 2effb875f..4bca5d242 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/IdentifierSourceWebController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/IdentifierSourceWebController.java @@ -17,7 +17,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @RestController public class IdentifierSourceWebController extends AbstractController implements RestControllerResourceProcessor { diff --git a/avni-server-api/src/main/java/org/avni/server/web/IdentifierUserAssignmentController.java b/avni-server-api/src/main/java/org/avni/server/web/IdentifierUserAssignmentController.java index 07557846d..93758fa1c 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/IdentifierUserAssignmentController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/IdentifierUserAssignmentController.java @@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; @RestController diff --git a/avni-server-api/src/main/java/org/avni/server/web/IdentifierUserAssignmentWebController.java b/avni-server-api/src/main/java/org/avni/server/web/IdentifierUserAssignmentWebController.java index 5176d9199..f0311e0af 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/IdentifierUserAssignmentWebController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/IdentifierUserAssignmentWebController.java @@ -23,7 +23,7 @@ import org.springframework.hateoas.EntityModel; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import org.springframework.web.bind.annotation.*; @RestController diff --git a/avni-server-api/src/main/java/org/avni/server/web/ImplementationController.java b/avni-server-api/src/main/java/org/avni/server/web/ImplementationController.java index 10d6ad85a..8b52d353a 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/ImplementationController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/ImplementationController.java @@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.io.ByteArrayOutputStream; import java.util.zip.ZipOutputStream; diff --git a/avni-server-api/src/main/java/org/avni/server/web/IndividualController.java b/avni-server-api/src/main/java/org/avni/server/web/IndividualController.java index ba9a48e16..de3648241 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/IndividualController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/IndividualController.java @@ -43,7 +43,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.*; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/web/IndividualRelationController.java b/avni-server-api/src/main/java/org/avni/server/web/IndividualRelationController.java index b41293b51..76b52e9f5 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/IndividualRelationController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/IndividualRelationController.java @@ -11,7 +11,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; import java.util.Optional; diff --git a/avni-server-api/src/main/java/org/avni/server/web/IndividualRelationshipController.java b/avni-server-api/src/main/java/org/avni/server/web/IndividualRelationshipController.java index 6837624a6..759542aa7 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/IndividualRelationshipController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/IndividualRelationshipController.java @@ -28,7 +28,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Collections; import java.util.Optional; diff --git a/avni-server-api/src/main/java/org/avni/server/web/IndividualRelationshipTypeController.java b/avni-server-api/src/main/java/org/avni/server/web/IndividualRelationshipTypeController.java index 471827c59..80fc89d46 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/IndividualRelationshipTypeController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/IndividualRelationshipTypeController.java @@ -10,7 +10,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; @RestController diff --git a/avni-server-api/src/main/java/org/avni/server/web/LocationController.java b/avni-server-api/src/main/java/org/avni/server/web/LocationController.java index 02dce5f23..25234790f 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/LocationController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/LocationController.java @@ -33,7 +33,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/web/LocationMappingController.java b/avni-server-api/src/main/java/org/avni/server/web/LocationMappingController.java index 991245f6c..d9b936bf8 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/LocationMappingController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/LocationMappingController.java @@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @RestController public class LocationMappingController implements RestControllerResourceProcessor { diff --git a/avni-server-api/src/main/java/org/avni/server/web/NewsController.java b/avni-server-api/src/main/java/org/avni/server/web/NewsController.java index b059fa054..c25280021 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/NewsController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/NewsController.java @@ -20,7 +20,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/web/OperationalEncounterTypesController.java b/avni-server-api/src/main/java/org/avni/server/web/OperationalEncounterTypesController.java index ef7523e5f..93e1abdf0 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/OperationalEncounterTypesController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/OperationalEncounterTypesController.java @@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @RestController public class OperationalEncounterTypesController { diff --git a/avni-server-api/src/main/java/org/avni/server/web/OperationalProgramsController.java b/avni-server-api/src/main/java/org/avni/server/web/OperationalProgramsController.java index 30873e5b7..a5b556fca 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/OperationalProgramsController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/OperationalProgramsController.java @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @RestController public class OperationalProgramsController { diff --git a/avni-server-api/src/main/java/org/avni/server/web/OperationalSubjectTypesController.java b/avni-server-api/src/main/java/org/avni/server/web/OperationalSubjectTypesController.java index 46e9e913c..6db1200ac 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/OperationalSubjectTypesController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/OperationalSubjectTypesController.java @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @RestController public class OperationalSubjectTypesController { diff --git a/avni-server-api/src/main/java/org/avni/server/web/OrganisationConfigController.java b/avni-server-api/src/main/java/org/avni/server/web/OrganisationConfigController.java index c024c7c06..3f70241fa 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/OrganisationConfigController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/OrganisationConfigController.java @@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @RepositoryRestController public class OrganisationConfigController implements RestControllerResourceProcessor { diff --git a/avni-server-api/src/main/java/org/avni/server/web/OrganisationController.java b/avni-server-api/src/main/java/org/avni/server/web/OrganisationController.java index d7b13ce50..949b72ded 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/OrganisationController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/OrganisationController.java @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.*; import jakarta.persistence.criteria.Predicate; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.*; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/web/OrganisationGroupController.java b/avni-server-api/src/main/java/org/avni/server/web/OrganisationGroupController.java index 8a02ab63e..660a34ed0 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/OrganisationGroupController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/OrganisationGroupController.java @@ -21,7 +21,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.HashSet; import java.util.Set; diff --git a/avni-server-api/src/main/java/org/avni/server/web/PlatformTranslationController.java b/avni-server-api/src/main/java/org/avni/server/web/PlatformTranslationController.java index 2e4d1a95b..f3b018bc9 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/PlatformTranslationController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/PlatformTranslationController.java @@ -18,7 +18,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @RestController public class PlatformTranslationController implements RestControllerResourceProcessor { diff --git a/avni-server-api/src/main/java/org/avni/server/web/ProgramController.java b/avni-server-api/src/main/java/org/avni/server/web/ProgramController.java index 399763316..2433a93ef 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/ProgramController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/ProgramController.java @@ -31,7 +31,7 @@ import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.ArrayList; import java.util.Comparator; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/web/ProgramEncounterController.java b/avni-server-api/src/main/java/org/avni/server/web/ProgramEncounterController.java index 21898d231..b13e6e84a 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/ProgramEncounterController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/ProgramEncounterController.java @@ -29,7 +29,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Collections; import static org.avni.server.web.resourceProcessors.ResourceProcessor.addAuditFields; diff --git a/avni-server-api/src/main/java/org/avni/server/web/ProgramEnrolmentController.java b/avni-server-api/src/main/java/org/avni/server/web/ProgramEnrolmentController.java index 244dc008b..d0a58b84f 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/ProgramEnrolmentController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/ProgramEnrolmentController.java @@ -33,7 +33,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Collections; import static org.avni.server.web.resourceProcessors.ResourceProcessor.addAuditFields; diff --git a/avni-server-api/src/main/java/org/avni/server/web/ReportCardController.java b/avni-server-api/src/main/java/org/avni/server/web/ReportCardController.java index 5e045d175..de03aef4d 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/ReportCardController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/ReportCardController.java @@ -22,7 +22,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/web/ReportingController.java b/avni-server-api/src/main/java/org/avni/server/web/ReportingController.java index 921d73ac9..68ed1e2da 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/ReportingController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/ReportingController.java @@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import javax.persistence.EntityNotFoundException; +import jakarta.persistence.*; import java.util.ArrayList; import java.util.HashSet; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/web/SubjectProgramEligibilityController.java b/avni-server-api/src/main/java/org/avni/server/web/SubjectProgramEligibilityController.java index 94f78efaa..36f8cc175 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/SubjectProgramEligibilityController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/SubjectProgramEligibilityController.java @@ -30,7 +30,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Collections; import static org.avni.server.web.resourceProcessors.ResourceProcessor.addAuditFields; diff --git a/avni-server-api/src/main/java/org/avni/server/web/SubjectTypeController.java b/avni-server-api/src/main/java/org/avni/server/web/SubjectTypeController.java index 46eefe611..ef3df2787 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/SubjectTypeController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/SubjectTypeController.java @@ -30,7 +30,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; import java.util.Objects; import java.util.Optional; diff --git a/avni-server-api/src/main/java/org/avni/server/web/SyncTelemetryController.java b/avni-server-api/src/main/java/org/avni/server/web/SyncTelemetryController.java index 9f570d825..cbb53fee7 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/SyncTelemetryController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/SyncTelemetryController.java @@ -15,7 +15,7 @@ import org.springframework.hateoas.EntityModel; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; @RestController diff --git a/avni-server-api/src/main/java/org/avni/server/web/TranslationController.java b/avni-server-api/src/main/java/org/avni/server/web/TranslationController.java index 7d6866ccf..94bef1cfc 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/TranslationController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/TranslationController.java @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.*; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/web/UserController.java b/avni-server-api/src/main/java/org/avni/server/web/UserController.java index 1a00cd8d3..0354fa00f 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/UserController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/UserController.java @@ -32,11 +32,9 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.persistence.EntityNotFoundException; -import jakarta.persistence.criteria.CriteriaBuilder; -import jakarta.persistence.criteria.Predicate; -import jakarta.persistence.criteria.Root; -import javax.transaction.Transactional; +import jakarta.persistence.*; +import jakarta.persistence.criteria.*; +import jakarta.transaction.Transactional; import java.util.List; import java.util.UUID; import java.util.regex.Pattern; diff --git a/avni-server-api/src/main/java/org/avni/server/web/UserGroupController.java b/avni-server-api/src/main/java/org/avni/server/web/UserGroupController.java index df9ee6ff9..390c5384b 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/UserGroupController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/UserGroupController.java @@ -23,7 +23,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/web/UserInfoController.java b/avni-server-api/src/main/java/org/avni/server/web/UserInfoController.java index 0467a6755..ca9bc9775 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/UserInfoController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/UserInfoController.java @@ -32,7 +32,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Arrays; import java.util.List; import java.util.UUID; diff --git a/avni-server-api/src/main/java/org/avni/server/web/VideoController.java b/avni-server-api/src/main/java/org/avni/server/web/VideoController.java index 2f832781a..cbdc4a781 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/VideoController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/VideoController.java @@ -12,7 +12,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Arrays; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/web/VideoTelemetricController.java b/avni-server-api/src/main/java/org/avni/server/web/VideoTelemetricController.java index 9068d626b..fa68aef94 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/VideoTelemetricController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/VideoTelemetricController.java @@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @RestController public class VideoTelemetricController implements RestControllerResourceProcessor { diff --git a/avni-server-api/src/main/java/org/avni/server/web/ViewGenController.java b/avni-server-api/src/main/java/org/avni/server/web/ViewGenController.java index 6e7bf8cd6..874821079 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/ViewGenController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/ViewGenController.java @@ -19,7 +19,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/avni-server-api/src/main/java/org/avni/server/web/api/GeneralEncounterApiController.java b/avni-server-api/src/main/java/org/avni/server/web/api/GeneralEncounterApiController.java index 5f7c8502c..dd2c83f88 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/api/GeneralEncounterApiController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/api/GeneralEncounterApiController.java @@ -29,7 +29,7 @@ import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.io.IOException; import java.util.ArrayList; import java.util.Map; diff --git a/avni-server-api/src/main/java/org/avni/server/web/api/ProgramEncounterApiController.java b/avni-server-api/src/main/java/org/avni/server/web/api/ProgramEncounterApiController.java index eedcd0b2d..cc93ae45f 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/api/ProgramEncounterApiController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/api/ProgramEncounterApiController.java @@ -30,7 +30,7 @@ import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.io.IOException; import java.util.ArrayList; import java.util.Map; diff --git a/avni-server-api/src/main/java/org/avni/server/web/api/ProgramEnrolmentApiController.java b/avni-server-api/src/main/java/org/avni/server/web/api/ProgramEnrolmentApiController.java index 117236b25..bed4ff8e6 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/api/ProgramEnrolmentApiController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/api/ProgramEnrolmentApiController.java @@ -29,7 +29,7 @@ import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.io.IOException; import java.util.ArrayList; diff --git a/avni-server-api/src/main/java/org/avni/server/web/menu/MenuItemWebController.java b/avni-server-api/src/main/java/org/avni/server/web/menu/MenuItemWebController.java index 54ec4975c..4ce81b652 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/menu/MenuItemWebController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/menu/MenuItemWebController.java @@ -17,7 +17,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; import java.util.stream.Collectors; diff --git a/avni-server-api/src/main/java/org/avni/server/web/request/rules/validateRules/RuleValidationService.java b/avni-server-api/src/main/java/org/avni/server/web/request/rules/validateRules/RuleValidationService.java index b05c9a801..839e993e5 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/request/rules/validateRules/RuleValidationService.java +++ b/avni-server-api/src/main/java/org/avni/server/web/request/rules/validateRules/RuleValidationService.java @@ -1,6 +1,5 @@ package org.avni.server.web.request.rules.validateRules; -import org.apache.logging.log4j.util.Strings; import org.avni.server.dao.ConceptRepository; import org.avni.server.dao.individualRelationship.RuleFailureLogRepository; import org.avni.server.domain.Concept; @@ -70,7 +69,7 @@ private Boolean checkConceptForRule(String conceptName, RuleFailureLog ruleFailu Concept concept = conceptRepository.findByName(conceptName); if (concept == null) { ruleFailureLog.setErrorMessage(String.format("concept not found with the name %s", conceptName)); - ruleFailureLog.setStacktrace(Strings.EMPTY); + ruleFailureLog.setStacktrace(""); ruleFailureLog.setUuid(UUID.randomUUID().toString()); ruleFailureLogRepository.save(ruleFailureLog); return false; diff --git a/avni-server-api/src/main/java/org/avni/server/web/response/SubjectResponse.java b/avni-server-api/src/main/java/org/avni/server/web/response/SubjectResponse.java index a8699a1cc..301a1aa49 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/response/SubjectResponse.java +++ b/avni-server-api/src/main/java/org/avni/server/web/response/SubjectResponse.java @@ -8,8 +8,9 @@ import org.avni.server.service.ConceptService; import org.avni.server.service.S3Service; import org.avni.server.web.request.api.SubjectResponseOptions; -import org.jadira.usertype.spi.utils.lang.StringUtils; +//import org.jadira.usertype.spi.utils.lang.StringUtils; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import java.net.URL; import java.util.*; @@ -38,7 +39,7 @@ public static SubjectResponse fromSubject(Individual subject, SubjectResponseOpt Response.putIfPresent(observations, "Middle name", subject.getMiddleName()); Response.putIfPresent(observations, "Last name", subject.getLastName()); if (subject.getSubjectType().isAllowProfilePicture() - && StringUtils.isNotEmpty(subject.getProfilePicture())) { + && !StringUtils.isEmpty(subject.getProfilePicture())) { URL url = s3Service.generateMediaDownloadUrl(subject.getProfilePicture()); observations.put("Profile picture", url.toString()); } diff --git a/avni-server-api/src/main/java/org/avni/server/web/rules/RuleFailureTelemetryController.java b/avni-server-api/src/main/java/org/avni/server/web/rules/RuleFailureTelemetryController.java index 65d25bb9a..19bcb3f07 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/rules/RuleFailureTelemetryController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/rules/RuleFailureTelemetryController.java @@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @RestController public class RuleFailureTelemetryController implements RestControllerResourceProcessor { diff --git a/avni-server-api/src/main/java/org/avni/server/web/rules/RuleFailureTelemetryWebController.java b/avni-server-api/src/main/java/org/avni/server/web/rules/RuleFailureTelemetryWebController.java index d9362667f..4bacf81cf 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/rules/RuleFailureTelemetryWebController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/rules/RuleFailureTelemetryWebController.java @@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; @RestController diff --git a/avni-server-api/src/main/java/org/avni/server/web/task/TaskController.java b/avni-server-api/src/main/java/org/avni/server/web/task/TaskController.java index 8d243243b..3984f8bec 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/task/TaskController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/task/TaskController.java @@ -24,7 +24,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import static org.avni.server.web.resourceProcessors.ResourceProcessor.addAuditFields; diff --git a/avni-server-api/src/main/java/org/avni/server/web/task/TaskUnAssignmentController.java b/avni-server-api/src/main/java/org/avni/server/web/task/TaskUnAssignmentController.java index b4b168b8c..9f1256f85 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/task/TaskUnAssignmentController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/task/TaskUnAssignmentController.java @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import static org.avni.server.web.resourceProcessors.ResourceProcessor.addAuditFields; diff --git a/avni-server-api/src/main/java/org/avni/server/web/task/TaskWebController.java b/avni-server-api/src/main/java/org/avni/server/web/task/TaskWebController.java index 6891d8103..dfb2b90d5 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/task/TaskWebController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/task/TaskWebController.java @@ -17,7 +17,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.HashMap; import java.util.Map; diff --git a/avni-server-api/src/main/resources/application.properties b/avni-server-api/src/main/resources/application.properties index f03b753ff..360e62d08 100644 --- a/avni-server-api/src/main/resources/application.properties +++ b/avni-server-api/src/main/resources/application.properties @@ -27,19 +27,20 @@ spring.flyway.out-of-order=true # JPA, Hibernate and Spring Data spring.jpa.show-sql=${SHOW_SQL:false} spring.jpa.hibernate.ddl-auto=none -spring.jpa.properties.jadira.usertype.databaseZone=jvm -spring.jpa.properties.jadira.usertype.javaZone=jvm -spring.jpa.properties.jadira.usertype.autoRegisterUserTypes=true -spring.jpa.properties.hibernate.dialect=org.avni.server.framework.postgres.CHSPostgreSQLDialect +#spring.jpa.properties.jadira.usertype.databaseZone=jvm +#spring.jpa.properties.jadira.usertype.javaZone=jvm +#spring.jpa.properties.jadira.usertype.autoRegisterUserTypes=true +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect spring.jpa.properties.hibernate.ejb.interceptor=org.avni.server.framework.hibernate.UpdateOrganisationHibernateInterceptor -spring.jpa.database-platform=org.avni.server.framework.postgres.CHSPostgreSQLDialect -spring.jpa.hibernate.use-new-id-generator-mappings=true +#spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL10Dialect spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false avni.custom.query.timeout=${AVNI_CUSTOM_QUERY_TIMEOUT:3} avni.custom.query.max.rows=${AVNI_CUSTOM_QUERY_MAX_ROWS:2000} avni.longitudinal.export.v2.limit=${AVNI_LONGITUDINAL_EXPORT_V2_LIMIT:10000} avni.legacy.longitudinal.export.limit=${AVNI_LEGACY_LONGITUDINAL_EXPORT_LIMIT:10000} +spring.main.allow-bean-definition-overriding=true + # Second level and Query cache. Also check ehcache.xml file. spring.jpa.properties.hibernate.cache.use_second_level_cache=true spring.jpa.properties.hibernate.cache.use_query_cache=true diff --git a/avni-server-api/src/main/resources/log4j.properties b/avni-server-api/src/main/resources/log4j.properties deleted file mode 100644 index 065753297..000000000 --- a/avni-server-api/src/main/resources/log4j.properties +++ /dev/null @@ -1,9 +0,0 @@ -# Set root logger level to DEBUG and its only appender to A1. -log4j.rootLogger=ERROR, A1 - -# A1 is set to be a ConsoleAppender. -log4j.appender.A1=org.apache.log4j.ConsoleAppender - -# A1 uses PatternLayout. -log4j.appender.A1.layout=org.apache.log4j.PatternLayout -log4j.appender.A1.layout.ConversionPattern=[%c{2}] %-5p - %m%n diff --git a/avni-server-api/src/test/java/org/avni/server/common/AbstractControllerIntegrationTest.java b/avni-server-api/src/test/java/org/avni/server/common/AbstractControllerIntegrationTest.java index f8e9e5697..707a39153 100644 --- a/avni-server-api/src/test/java/org/avni/server/common/AbstractControllerIntegrationTest.java +++ b/avni-server-api/src/test/java/org/avni/server/common/AbstractControllerIntegrationTest.java @@ -19,8 +19,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; -import jakarta.persistence.EntityManager; -import javax.persistence.PersistenceContext; +import jakarta.persistence.*; import java.net.URL; import java.util.ArrayList; diff --git a/avni-server-api/src/test/resources/application.properties b/avni-server-api/src/test/resources/application.properties index 2369253e4..461632bfc 100644 --- a/avni-server-api/src/test/resources/application.properties +++ b/avni-server-api/src/test/resources/application.properties @@ -24,17 +24,16 @@ server.tomcat.accesslog.max-days=90 # JPA, Hibernate and Spring Data spring.jpa.show-sql=false spring.jpa.hibernate.ddl-auto=none -spring.jpa.properties.jadira.usertype.databaseZone=jvm -spring.jpa.properties.jadira.usertype.javaZone=jvm -spring.jpa.properties.jadira.usertype.autoRegisterUserTypes=true -spring.jpa.properties.hibernate.dialect=org.avni.server.framework.postgres.CHSPostgreSQLDialect +#spring.jpa.properties.jadira.usertype.databaseZone=jvm +#spring.jpa.properties.jadira.usertype.javaZone=jvm +#spring.jpa.properties.jadira.usertype.autoRegisterUserTypes=true +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect spring.jpa.properties.hibernate.ejb.interceptor=org.avni.server.framework.hibernate.UpdateOrganisationHibernateInterceptor spring.jpa.properties.hibernate.cache.use_second_level_cache=true spring.jpa.properties.hibernate.cache.use_query_cache=true spring.jpa.properties.hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory spring.cache.jcache.config=${AVNI_EHCACHE_FILE:classpath:ehcache.xml} -spring.jpa.database-platform=org.avni.server.framework.postgres.CHSPostgreSQLDialect -spring.jpa.hibernate.use-new-id-generator-mappings=true +#spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL10Dialect spring.profiles.active=${OPENCHS_MODE:test} spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false avni.custom.query.timeout=${AVNI_CUSTOM_QUERY_TIMEOUT:5} @@ -46,6 +45,8 @@ cognito.poolid=dummy cognito.region=${OPENCHS_AWS_REGION:ap-south-1} spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true +spring.main.allow-bean-definition-overriding=true + #Bugsnag avni.bugsnag.apiKey=${OPENCHS_SERVER_BUGSNAG_API_KEY:dummy} avni.bugsnag.releaseStage=${OPENCHS_BUGSNAG_RELEASE_STAGE:development} diff --git a/mypatch.patch b/mypatch.patch index 119414ee1..f2bb00cfa 100644 --- a/mypatch.patch +++ b/mypatch.patch @@ -29,7 +29,7 @@ index 00000000..fd35b7b1 +import org.avni.server.domain.EntityType; +import org.avni.server.domain.OrganisationAwareEntity; + -+import javax.persistence.*; ++import jakarta.persistence.*; +import jakarta.validation.constraints.NotNull; + +@Entity