From 054b8b4e16be2ed95daca3244ed8e665b4d8749b Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Fri, 1 Nov 2024 12:20:02 +0530 Subject: [PATCH] #813 - source compiling --- .../server/dao/CustomJpaRepositoryImpl.java | 12 +++++++---- .../server/dao/EncounterSearchRepository.java | 4 ++-- .../dao/LocationMappingSyncRepository.java | 2 +- .../server/dao/LocationSyncRepository.java | 2 +- .../server/dao/RoleSwitchableRepository.java | 4 ++-- .../server/dao/SubjectSearchRepository.java | 4 ++-- .../exporter/ExportBatchConfiguration.java | 2 +- .../LongitudinalExportTaskletImpl.java | 6 ++++-- .../v2/LongitudinalExportV2TaskletImpl.java | 5 +++-- .../postgres/CHSPostgreSQL94Dialect.java | 16 --------------- .../postgres/CHSPostgreSQLDialect.java | 20 +++++++++++++++++++ .../server/service/AddressLevelCache.java | 2 +- .../avni/server/service/CatchmentService.java | 2 +- .../avni/server/web/CatchmentController.java | 2 +- .../avni/server/web/ErrorInterceptors.java | 7 ++++--- .../org/avni/server/web/FormController.java | 12 ++++++----- .../avni/server/web/IndividualController.java | 1 + .../server/web/SyncSubjectController.java | 18 ++++++++--------- .../src/main/resources/application.properties | 4 ++-- .../AbstractControllerIntegrationTest.java | 2 +- .../service/AddressLevelServiceTest.java | 4 ++-- .../src/test/resources/application.properties | 4 ++-- 22 files changed, 75 insertions(+), 60 deletions(-) delete mode 100644 avni-server-api/src/main/java/org/avni/server/framework/postgres/CHSPostgreSQL94Dialect.java create mode 100644 avni-server-api/src/main/java/org/avni/server/framework/postgres/CHSPostgreSQLDialect.java diff --git a/avni-server-api/src/main/java/org/avni/server/dao/CustomJpaRepositoryImpl.java b/avni-server-api/src/main/java/org/avni/server/dao/CustomJpaRepositoryImpl.java index fbb2d3a53..467282ef2 100644 --- a/avni-server-api/src/main/java/org/avni/server/dao/CustomJpaRepositoryImpl.java +++ b/avni-server-api/src/main/java/org/avni/server/dao/CustomJpaRepositoryImpl.java @@ -8,13 +8,12 @@ import org.springframework.data.jpa.repository.support.JpaEntityInformation; import org.springframework.data.jpa.repository.support.SimpleJpaRepository; -import javax.persistence.EntityManager; -import javax.persistence.TypedQuery; +import jakarta.persistence.EntityManager; +import jakarta.persistence.TypedQuery; import java.io.Serializable; import java.util.List; public class CustomJpaRepositoryImpl extends SimpleJpaRepository implements CustomCHSJpaRepository { - public CustomJpaRepositoryImpl(JpaEntityInformation entityInformation, EntityManager entityManager) { super(entityInformation, entityManager); } @@ -25,6 +24,11 @@ public Slice findAllAsSlice(Specification specification, Pageable pageable return pageable.isUnpaged() ? new SliceImpl<>(query.getResultList()) : readSlice(query, pageable, specification); } + @Override + public void deleteInBatch(Iterable entities) { + entities.forEach(this::delete); + } + private Slice readSlice(TypedQuery query, Pageable pageable, Specification specification){ if (pageable.isPaged()){ query.setFirstResult((int) pageable.getOffset()); @@ -37,4 +41,4 @@ private Slice readSlice(TypedQuery query, Pageable pageable, Specification } return new SliceImpl<>(content, pageable, hasNextPage); } -} \ No newline at end of file +} 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 0ee4cbddf..29a711fcc 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 @@ -6,8 +6,8 @@ import org.avni.server.web.api.EncounterSearchRequest; import org.springframework.stereotype.Repository; -import javax.persistence.EntityManager; -import javax.persistence.Query; +import jakarta.persistence.EntityManager; +import jakarta.persistence.Query; import javax.transaction.Transactional; import java.math.BigInteger; import java.util.List; 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 1610ed038..d517f44cc 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 @@ -6,7 +6,7 @@ import org.springframework.data.domain.Slice; import org.springframework.stereotype.Repository; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; import javax.transaction.Transactional; /** 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 923f9ff96..8e7ee4cce 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 @@ -5,7 +5,7 @@ import org.springframework.data.domain.Slice; import org.springframework.stereotype.Repository; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; import javax.transaction.Transactional; @Repository 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 8db61ed58..2b1eee922 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,9 @@ import org.avni.server.framework.security.UserContextHolder; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; import javax.persistence.PersistenceContext; -import javax.persistence.Query; +import jakarta.persistence.Query; 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 19993a203..eea533e21 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 @@ -11,9 +11,9 @@ import org.springframework.stereotype.Repository; import org.springframework.util.StringUtils; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; import javax.persistence.PersistenceContext; -import javax.persistence.Query; +import jakarta.persistence.Query; import javax.transaction.Transactional; import java.math.BigInteger; import java.util.List; diff --git a/avni-server-api/src/main/java/org/avni/server/exporter/ExportBatchConfiguration.java b/avni-server-api/src/main/java/org/avni/server/exporter/ExportBatchConfiguration.java index e2a57cafc..6e58ad893 100644 --- a/avni-server-api/src/main/java/org/avni/server/exporter/ExportBatchConfiguration.java +++ b/avni-server-api/src/main/java/org/avni/server/exporter/ExportBatchConfiguration.java @@ -27,7 +27,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.data.domain.Sort; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; 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/exporter/LongitudinalExportTaskletImpl.java b/avni-server-api/src/main/java/org/avni/server/exporter/LongitudinalExportTaskletImpl.java index be9ef2d49..817308e39 100644 --- a/avni-server-api/src/main/java/org/avni/server/exporter/LongitudinalExportTaskletImpl.java +++ b/avni-server-api/src/main/java/org/avni/server/exporter/LongitudinalExportTaskletImpl.java @@ -5,13 +5,14 @@ import org.slf4j.LoggerFactory; import org.springframework.batch.core.StepContribution; import org.springframework.batch.core.scope.context.ChunkContext; +import org.springframework.batch.item.Chunk; import org.springframework.batch.item.ExecutionContext; import org.springframework.batch.item.file.FlatFileItemWriter; import org.springframework.batch.item.file.transform.DelimitedLineAggregator; import org.springframework.batch.repeat.RepeatStatus; import org.springframework.core.io.FileSystemResource; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; import java.io.File; import java.util.ArrayList; import java.util.Iterator; @@ -86,7 +87,8 @@ private void createFileWriter(String uuid, ExecutionContext executionContext) { private void writeToFile(List rows) throws Exception { if (rows.size() == 0) return; - writer.write(rows); + + writer.write(Chunk.of(rows.toArray(new ExportItemRow[0]))); } @Override diff --git a/avni-server-api/src/main/java/org/avni/server/exporter/v2/LongitudinalExportV2TaskletImpl.java b/avni-server-api/src/main/java/org/avni/server/exporter/v2/LongitudinalExportV2TaskletImpl.java index 99db8d021..6abd9ef00 100644 --- a/avni-server-api/src/main/java/org/avni/server/exporter/v2/LongitudinalExportV2TaskletImpl.java +++ b/avni-server-api/src/main/java/org/avni/server/exporter/v2/LongitudinalExportV2TaskletImpl.java @@ -6,13 +6,14 @@ import org.slf4j.LoggerFactory; import org.springframework.batch.core.StepContribution; import org.springframework.batch.core.scope.context.ChunkContext; +import org.springframework.batch.item.Chunk; import org.springframework.batch.item.ExecutionContext; import org.springframework.batch.item.file.FlatFileItemWriter; import org.springframework.batch.item.file.transform.DelimitedLineAggregator; import org.springframework.batch.repeat.RepeatStatus; import org.springframework.core.io.FileSystemResource; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; import java.io.File; import java.util.ArrayList; import java.util.Iterator; @@ -92,7 +93,7 @@ private void createFileWriter(String uuid, ExecutionContext executionContext) { private void writeToFile(List rows) throws Exception { if (rows.isEmpty()) return; - writer.write(rows); + writer.write(Chunk.of(rows.toArray(new LongitudinalExportItemRow[0]))); } @Override diff --git a/avni-server-api/src/main/java/org/avni/server/framework/postgres/CHSPostgreSQL94Dialect.java b/avni-server-api/src/main/java/org/avni/server/framework/postgres/CHSPostgreSQL94Dialect.java deleted file mode 100644 index aa30a285b..000000000 --- a/avni-server-api/src/main/java/org/avni/server/framework/postgres/CHSPostgreSQL94Dialect.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.avni.server.framework.postgres; - -import org.hibernate.dialect.PostgreSQL94Dialect; - -import java.sql.Types; - -public class CHSPostgreSQL94Dialect extends PostgreSQL94Dialect { - private static final String JSONB = "jsonb"; - private static final String JSON = "json"; - - public CHSPostgreSQL94Dialect() { - super(); - this.registerColumnType(Types.JAVA_OBJECT, JSONB); - this.registerColumnType(Types.JAVA_OBJECT, JSON); - } -} 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 new file mode 100644 index 000000000..a5d1d01a5 --- /dev/null +++ b/avni-server-api/src/main/java/org/avni/server/framework/postgres/CHSPostgreSQLDialect.java @@ -0,0 +1,20 @@ +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/service/AddressLevelCache.java b/avni-server-api/src/main/java/org/avni/server/service/AddressLevelCache.java index c65401db2..5f7f67174 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 @@ -8,7 +8,7 @@ import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Component; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; import javax.transaction.Transactional; import java.util.List; 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 2aa6c7925..781db786e 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 @@ -16,7 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; import javax.transaction.Transactional; import java.util.ArrayList; import java.util.HashSet; 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 ab95ca554..a2b3448c3 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 @@ -79,7 +79,7 @@ public EntityModel getById(@PathVariable Long id) { CatchmentContract catchmentContract = CatchmentContract.fromEntity(catchment); boolean fastSyncExists = s3Service.fileExists(String.format("MobileDbBackup-%s", catchment.getUuid())); catchmentContract.setFastSyncExists(fastSyncExists); - return new EntityModel<>(catchmentContract); + return EntityModel.of(catchmentContract); } @GetMapping(value = "catchment/search/findAllById") diff --git a/avni-server-api/src/main/java/org/avni/server/web/ErrorInterceptors.java b/avni-server-api/src/main/java/org/avni/server/web/ErrorInterceptors.java index 344a3e43c..518bf9df6 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/ErrorInterceptors.java +++ b/avni-server-api/src/main/java/org/avni/server/web/ErrorInterceptors.java @@ -16,6 +16,7 @@ import org.springframework.data.rest.webmvc.ResourceNotFoundException; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; +import org.springframework.http.HttpStatusCode; import org.springframework.http.ResponseEntity; import org.springframework.http.converter.HttpMessageConversionException; import org.springframework.web.bind.MethodArgumentNotValidException; @@ -72,7 +73,7 @@ public ErrorInterceptors(@Value("${spring.servlet.multipart.max-file-size}") Str } @Override - protected ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex, HttpHeaders headers, HttpStatus status, WebRequest request) { + protected ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) { Map body = new HashMap<>(); List errors = ex.getBindingResult() .getFieldErrors() @@ -121,8 +122,8 @@ public ResponseEntity unknownException(Exception e) { } @Override - protected ResponseEntity handleExceptionInternal(Exception ex, Object body, HttpHeaders headers, HttpStatus status, WebRequest request) { + protected ResponseEntity handleExceptionInternal(Exception ex, Object body, HttpHeaders headers, HttpStatusCode statusCode, WebRequest request) { bugsnagReporter.logAndReportToBugsnag(ex); - return super.handleExceptionInternal(ex, errorBodyBuilder.getErrorBody(body), headers, status, request); + return super.handleExceptionInternal(ex, errorBodyBuilder.getErrorBody(body), headers, statusCode, request); } } 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 e769381bf..c2d39a9d1 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 @@ -52,6 +52,8 @@ import java.util.stream.Collectors; import static java.lang.String.format; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; @RestController public class FormController implements RestControllerResourceProcessor { @@ -103,9 +105,9 @@ public CollectionModel> getAllFormsWeb( @RequestParam(value = "includeVoided", required = false) boolean includeVoided, Pageable pageable) { Long organisationId = UserContextHolder.getUserContext().getOrganisation().getId(); - Sort sortWithId = pageable.getSort().and(new Sort("id")); + Sort sortWithId = pageable.getSort().and(Sort.by("id")); - PageRequest pageRequest = new PageRequest(pageable.getPageNumber(), pageable.getPageSize(), sortWithId); + PageRequest pageRequest = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), sortWithId); Page
forms = formRepository.findAll((root, query, builder) -> { Predicate predicate = builder.equal(root.get("organisationId"), organisationId); @@ -388,11 +390,11 @@ private List getFormsByProgram(Program program, Pageable pagea Form form = fm.getForm(); BasicFormDetails formDetail = new BasicFormDetails(form, program.getOperationalProgramName()); formDetail.add(linkTo(methodOn(FormController.class).getForms(programId, pageable)).withSelfRel()); - Link formLink = entityLinks.linkToSingleResource(Form.class, form.getId()); + Link formLink = entityLinks.linkToItemResource(Form.class, form.getId()); formDetail.add(formLink); formDetail.add(Link.of(formLink.getHref() + "/formElementGroups", "formElementGroups")); - formDetail.add(entityLinks.linkToSingleResource(User.class, form.getCreatedBy().getId()).withRel("createdBy")); - formDetail.add(entityLinks.linkToSingleResource(User.class, form.getLastModifiedBy().getId()).withRel("lastModifiedBy")); + formDetail.add(entityLinks.linkToItemResource(User.class, form.getCreatedBy().getId()).withRel("createdBy")); + formDetail.add(entityLinks.linkToItemResource(User.class, form.getLastModifiedBy().getId()).withRel("lastModifiedBy")); return formDetail; }).collect(Collectors.toList()); } 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 305fe1465..ba9a48e16 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 @@ -48,6 +48,7 @@ import java.util.stream.Collectors; import static org.avni.server.web.resourceProcessors.ResourceProcessor.addAuditFields; +import static org.springframework.data.jpa.domain.Specification.where; @RestController public class IndividualController extends AbstractController implements RestControllerResourceProcessor { diff --git a/avni-server-api/src/main/java/org/avni/server/web/SyncSubjectController.java b/avni-server-api/src/main/java/org/avni/server/web/SyncSubjectController.java index a27db02ed..9e4381251 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/SyncSubjectController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/SyncSubjectController.java @@ -26,15 +26,15 @@ public SyncSubjectController(SubjectSyncResponseBuilderService subjectSyncRespon public EntityModel> process(SyncSubjectResponse syncSubjectResponse) { HashMap result = new HashMap<>(); - result.put("individual", new IndividualResourceProcessor().process(new EntityModel<>(syncSubjectResponse.getIndividual()))); - result.put("programEnrolments", syncSubjectResponse.getProgramEnrolments().stream().map(programEnrolment -> new ProgramEnrolmentResourceProcessor().process(new EntityModel<>(programEnrolment)))); - result.put("programEncounters", syncSubjectResponse.getProgramEncounters().stream().map(programEncounter1 -> new ProgramEncounterResourceProcessor().process(new EntityModel<>(programEncounter1)))); - result.put("encounters", syncSubjectResponse.getEncounters().stream().map(encounter -> new EncounterResourceProcessor().process(new EntityModel<>(encounter)))); - result.put("checklists", syncSubjectResponse.getChecklists().stream().map(checklist -> new ChecklistResourceProcessor().process(new EntityModel<>(checklist)))); - result.put("checklistItems", syncSubjectResponse.getChecklistItems().stream().map(checklistItem -> new ChecklistItemResourceProcessor().process(new EntityModel<>(checklistItem)))); - result.put("groupSubjects", syncSubjectResponse.getGroupSubjects().stream().map(groupSubject -> new GroupSubjectResourceProcessor().process(new EntityModel<>(groupSubject)))); - result.put("individualRelationships", syncSubjectResponse.getIndividualRelationships().stream().map(individualRelationship -> new IndividualRelationshipResourceProcessor().process(new EntityModel<>(individualRelationship)))); - return new EntityModel<>(result); + result.put("individual", new IndividualResourceProcessor().process(EntityModel.of(syncSubjectResponse.getIndividual()))); + result.put("programEnrolments", syncSubjectResponse.getProgramEnrolments().stream().map(programEnrolment -> new ProgramEnrolmentResourceProcessor().process(EntityModel.of(programEnrolment)))); + result.put("programEncounters", syncSubjectResponse.getProgramEncounters().stream().map(programEncounter1 -> new ProgramEncounterResourceProcessor().process(EntityModel.of(programEncounter1)))); + result.put("encounters", syncSubjectResponse.getEncounters().stream().map(encounter -> new EncounterResourceProcessor().process(EntityModel.of(encounter)))); + result.put("checklists", syncSubjectResponse.getChecklists().stream().map(checklist -> new ChecklistResourceProcessor().process(EntityModel.of(checklist)))); + result.put("checklistItems", syncSubjectResponse.getChecklistItems().stream().map(checklistItem -> new ChecklistItemResourceProcessor().process(EntityModel.of(checklistItem)))); + result.put("groupSubjects", syncSubjectResponse.getGroupSubjects().stream().map(groupSubject -> new GroupSubjectResourceProcessor().process(EntityModel.of(groupSubject)))); + result.put("individualRelationships", syncSubjectResponse.getIndividualRelationships().stream().map(individualRelationship -> new IndividualRelationshipResourceProcessor().process(EntityModel.of(individualRelationship)))); + return EntityModel.of(result); } @GetMapping("/subject/{uuid}/allEntities") diff --git a/avni-server-api/src/main/resources/application.properties b/avni-server-api/src/main/resources/application.properties index dc225e3ee..f03b753ff 100644 --- a/avni-server-api/src/main/resources/application.properties +++ b/avni-server-api/src/main/resources/application.properties @@ -30,9 +30,9 @@ 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.CHSPostgreSQL94Dialect +spring.jpa.properties.hibernate.dialect=org.avni.server.framework.postgres.CHSPostgreSQLDialect spring.jpa.properties.hibernate.ejb.interceptor=org.avni.server.framework.hibernate.UpdateOrganisationHibernateInterceptor -spring.jpa.database-platform=org.avni.server.framework.postgres.CHSPostgreSQL94Dialect +spring.jpa.database-platform=org.avni.server.framework.postgres.CHSPostgreSQLDialect spring.jpa.hibernate.use-new-id-generator-mappings=true spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false avni.custom.query.timeout=${AVNI_CUSTOM_QUERY_TIMEOUT:3} 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 808c7d3ba..468812b31 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,7 +19,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; import javax.persistence.PersistenceContext; import java.net.URL; import java.util.ArrayList; diff --git a/avni-server-api/src/test/java/org/avni/server/service/AddressLevelServiceTest.java b/avni-server-api/src/test/java/org/avni/server/service/AddressLevelServiceTest.java index bc20b822e..a99b6ac1a 100644 --- a/avni-server-api/src/test/java/org/avni/server/service/AddressLevelServiceTest.java +++ b/avni-server-api/src/test/java/org/avni/server/service/AddressLevelServiceTest.java @@ -16,8 +16,8 @@ import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; -import javax.persistence.EntityManager; -import javax.persistence.Query; +import jakarta.persistence.EntityManager; +import jakarta.persistence.Query; import java.util.Arrays; import java.util.Map; diff --git a/avni-server-api/src/test/resources/application.properties b/avni-server-api/src/test/resources/application.properties index ef4e26caf..2369253e4 100644 --- a/avni-server-api/src/test/resources/application.properties +++ b/avni-server-api/src/test/resources/application.properties @@ -27,13 +27,13 @@ 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.CHSPostgreSQL94Dialect +spring.jpa.properties.hibernate.dialect=org.avni.server.framework.postgres.CHSPostgreSQLDialect 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.CHSPostgreSQL94Dialect +spring.jpa.database-platform=org.avni.server.framework.postgres.CHSPostgreSQLDialect spring.jpa.hibernate.use-new-id-generator-mappings=true spring.profiles.active=${OPENCHS_MODE:test} spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false