From 7c960785702f5744c405649c690c96dfc91c63ed Mon Sep 17 00:00:00 2001 From: Thomas Georgios Giannos Date: Tue, 3 Oct 2023 17:29:45 +0300 Subject: [PATCH] Updating Spring to version 6, adding service stack for DescriptionType entity --- dmp-backend/core/pom.xml | 31 + .../enums/DescriptionTemplateTypeStatus.java | 43 + .../typedefinition/DataType.java | 0 .../typedefinition/DatabaseColumnType.java | 0 .../PostgreSQLDatabaseColumnType.java | 0 .../typedefinition/PostgreSQLEnumType.java | 0 .../typedefinition/UUIDType.java | 38 +- .../typedefinition/XMLType.java | 37 +- .../eudat/convention/ConventionService.java | 40 + .../convention/ConventionServiceImpl.java | 150 +++ .../main/java/eu/eudat/data/BaseEntity.java | 5 + .../data/DescriptionTemplateTypeEntity.java | 54 + .../eu/eudat/errorcode/ErrorDescription.java | 25 + .../ErrorThesaurusConfiguration.java | 12 + .../errorcode/ErrorThesaurusProperties.java | 48 + .../eudat/model/DescriptionTemplateType.java | 37 + .../eu/eudat/model/builder/BaseBuilder.java | 97 ++ .../DescriptionTemplateTypeBuilder.java | 56 ++ .../eu/eudat/model/result/QueryResult.java | 71 ++ .../query/DescriptionTemplateTypeQuery.java | 132 +++ .../lookup/DescriptionTemplateTypeLookup.java | 25 + .../eu/eudat/query/lookup/LookupAware.java | 12 + .../DescriptionTemplateTypeService.java | 101 ++ dmp-backend/data/pom.xml | 7 + .../data/converters/DateToUTCConverter.java | 4 +- .../context/DatabaseContext.java | 6 +- .../service/DatabaseService.java | 2 +- .../eudat/data/dao/entities/DMPDaoImpl.java | 210 ++-- .../data/dao/entities/DatasetDaoImpl.java | 6 +- .../dao/entities/DatasetProfileDaoImpl.java | 8 +- .../DescriptionTemplateTypeDaoImpl.java | 2 +- .../eudat/data/dao/entities/GrantDaoImpl.java | 2 +- .../dao/entities/OrganisationDaoImpl.java | 2 +- .../data/dao/entities/ProjectDaoImpl.java | 2 +- .../java/eu/eudat/data/entities/Content.java | 2 +- .../eu/eudat/data/entities/Credential.java | 2 +- .../main/java/eu/eudat/data/entities/DMP.java | 2 +- .../data/entities/DMPDatasetProfile.java | 2 +- .../eudat/data/entities/DMPOrganisation.java | 2 +- .../eu/eudat/data/entities/DMPProfile.java | 4 +- .../eu/eudat/data/entities/DMPResearcher.java | 4 +- .../eudat/data/entities/DataRepository.java | 4 +- .../java/eu/eudat/data/entities/Dataset.java | 6 +- .../data/entities/DatasetDataRepository.java | 2 +- .../data/entities/DatasetExternalDataset.java | 2 +- .../data/entities/DatasetProfileRuleset.java | 4 +- .../entities/DatasetProfileViewstyle.java | 4 +- .../eudat/data/entities/DatasetRegistry.java | 7 +- .../eudat/data/entities/DatasetService.java | 2 +- .../data/entities/DescriptionTemplate.java | 4 +- .../entities/DescriptionTemplateType.java | 2 +- .../data/entities/EmailConfirmation.java | 2 +- .../eu/eudat/data/entities/EntityDoi.java | 3 +- .../eudat/data/entities/ExternalDataset.java | 2 +- .../eu/eudat/data/entities/FileUpload.java | 3 +- .../java/eu/eudat/data/entities/Funder.java | 6 +- .../java/eu/eudat/data/entities/Grant.java | 4 +- .../eu/eudat/data/entities/Invitation.java | 4 +- .../java/eu/eudat/data/entities/Lock.java | 2 +- .../eu/eudat/data/entities/Notification.java | 2 +- .../eu/eudat/data/entities/Organisation.java | 6 +- .../java/eu/eudat/data/entities/Project.java | 4 +- .../java/eu/eudat/data/entities/Registry.java | 4 +- .../eu/eudat/data/entities/Researcher.java | 6 +- .../java/eu/eudat/data/entities/Service.java | 4 +- .../java/eu/eudat/data/entities/UserDMP.java | 2 +- .../data/entities/UserDatasetProfile.java | 2 +- .../java/eu/eudat/data/entities/UserInfo.java | 4 +- .../java/eu/eudat/data/entities/UserRole.java | 2 +- .../eu/eudat/data/entities/UserToken.java | 2 +- .../data/entities/helpers/EntityBinder.java | 2 +- .../main/java/eu/eudat/query/DMPQuery.java | 2 +- .../java/eu/eudat/query/DatasetQuery.java | 2 +- .../main/java/eu/eudat/query/GrantQuery.java | 2 +- .../main/java/eu/eudat/query/LockQuery.java | 2 +- dmp-backend/pom.xml | 165 ++-- .../eu/eudat/queryable/QueryableList.java | 6 +- .../eudat/queryable/collector/Collector.java | 2 +- .../queryable/collector/ProjectionField.java | 2 +- .../QueryableHibernateList.java | 934 ++++++++++-------- .../jpa/predicates/EntitySelectPredicate.java | 4 +- .../jpa/predicates/GroupByPredicate.java | 6 +- .../NestedQuerySinglePredicate.java | 6 +- .../jpa/predicates/OrderByPredicate.java | 6 +- .../jpa/predicates/SinglePredicate.java | 6 +- .../queryable/queryableentity/DataEntity.java | 2 +- dmp-backend/web/pom.xml | 12 +- .../main/java/eu/eudat/EuDatApplication.java | 5 +- .../DevelDatabaseConfiguration.java | 6 +- .../ProductionDatabaseConfiguration.java | 2 +- .../configurations/WebMVCConfiguration.java | 4 +- .../DynamicFunderConfigurationDevelImpl.java | 4 +- .../DynamicFunderConfigurationProdImpl.java | 4 +- .../dynamicfunder/entities/Configuration.java | 6 +- .../dynamicfunder/entities/Dependency.java | 2 +- .../dynamicfunder/entities/Language.java | 2 +- .../dynamicfunder/entities/MainProperty.java | 4 +- .../dynamicfunder/entities/Property.java | 4 +- .../DynamicGrantConfigurationDevelImpl.java | 4 +- .../DynamicGrantConfigurationProdImpl.java | 4 +- .../dynamicgrant/entities/Configuration.java | 6 +- .../dynamicgrant/entities/Dependency.java | 2 +- .../dynamicgrant/entities/Language.java | 2 +- .../dynamicgrant/entities/MainProperty.java | 4 +- .../dynamicgrant/entities/Property.java | 4 +- .../DynamicProjectConfigurationDevelImpl.java | 4 +- .../DynamicProjectConfigurationProdImpl.java | 4 +- .../entities/Configuration.java | 6 +- .../dynamicproject/entities/Dependency.java | 2 +- .../dynamicproject/entities/Language.java | 2 +- .../dynamicproject/entities/MainProperty.java | 4 +- .../dynamicproject/entities/Property.java | 4 +- .../main/java/eu/eudat/controllers/Admin.java | 4 +- .../eu/eudat/controllers/ContactEmail.java | 2 +- .../controllers/DMPProfileController.java | 2 +- .../main/java/eu/eudat/controllers/DMPs.java | 4 +- .../controllers/DashBoardController.java | 2 +- .../java/eu/eudat/controllers/Datasets.java | 4 +- .../DescriptionTemplateTypeController.java | 2 +- .../eudat/controllers/EmailConfirmation.java | 2 +- .../controllers/EmailMergeConfirmation.java | 2 +- .../controllers/EmailUnlinkConfirmation.java | 2 +- .../eu/eudat/controllers/FileController.java | 2 +- .../java/eu/eudat/controllers/Grants.java | 4 +- .../main/java/eu/eudat/controllers/Login.java | 2 +- .../controllers/ManagementController.java | 2 +- .../eu/eudat/controllers/Organisations.java | 2 +- .../controllers/QuickWizardController.java | 4 +- .../controllers/UserInvitationController.java | 2 +- .../main/java/eu/eudat/controllers/Users.java | 2 +- .../ControllerErrorHandler.java | 2 +- .../ControllerUnauthorisedHandler.java | 2 +- .../interceptors/RequestInterceptor.java | 11 +- .../eudat/controllers/v2/BaseController.java | 36 + .../DescriptionTemplateTypeV2Controller.java | 59 ++ .../logic/builders/BuilderFactoryImpl.java | 3 +- .../logic/managers/ContactEmailManager.java | 2 +- .../logic/managers/DashBoardManager.java | 2 +- .../managers/DataManagementPlanManager.java | 8 +- .../DataManagementProfileManager.java | 2 +- .../eudat/logic/managers/DatasetManager.java | 14 +- .../logic/managers/DatasetProfileManager.java | 5 +- .../logic/managers/InvitationsManager.java | 6 +- .../eu/eudat/logic/managers/LockManager.java | 2 +- .../MergeEmailConfirmationManager.java | 2 +- .../eudat/logic/managers/MetricsManager.java | 4 +- .../logic/managers/NotificationManager.java | 4 +- .../eu/eudat/logic/managers/RDAManager.java | 2 +- .../UnlinkEmailConfirmationManager.java | 2 +- .../config/DataFieldsUrlConfiguration.java | 2 +- .../proxy/config/DataSearchConfiguration.java | 2 +- .../proxy/config/DataUrlConfiguration.java | 4 +- .../logic/proxy/config/ExternalUrls.java | 6 +- .../eudat/logic/proxy/config/QueryConfig.java | 2 +- .../logic/proxy/config/UrlConfiguration.java | 4 +- .../configloaders/DefaultConfigLoader.java | 4 +- .../configloaders/ProductionConfigLoader.java | 4 +- .../proxy/config/entities/DatasetUrls.java | 4 +- .../entities/DefaultPrefillingMapping.java | 4 +- .../proxy/config/entities/FunderUrls.java | 4 +- .../proxy/config/entities/GrantUrls.java | 4 +- .../proxy/config/entities/JournalUrls.java | 4 +- .../proxy/config/entities/LicenseUrls.java | 4 +- .../config/entities/OrganisationUrls.java | 4 +- .../config/entities/PrefillingConfig.java | 6 +- .../entities/PrefillingFixedMapping.java | 4 +- .../proxy/config/entities/PrefillingGet.java | 4 +- .../config/entities/PrefillingMapping.java | 2 +- .../config/entities/PrefillingSearch.java | 2 +- .../proxy/config/entities/ProjectUrls.java | 4 +- .../config/entities/PubRepositoryUrls.java | 4 +- .../config/entities/PublicationsUrls.java | 4 +- .../proxy/config/entities/RegistryUrls.java | 4 +- .../proxy/config/entities/RepositoryUrls.java | 4 +- .../proxy/config/entities/ResearcherUrls.java | 4 +- .../proxy/config/entities/ServiceUrls.java | 4 +- .../logic/proxy/config/entities/TagUrls.java | 4 +- .../proxy/config/entities/TaxonomiesUrls.java | 4 +- .../proxy/config/entities/ValidationUrls.java | 4 +- .../PrefillingConfigMapAdapter.java | 6 +- .../logic/proxy/fetching/LocalFetcher.java | 4 +- .../logic/proxy/fetching/RemoteFetcher.java | 4 +- .../logic/proxy/fetching/entities/Config.java | 6 +- .../proxy/fetching/entities/ConfigSingle.java | 4 +- .../fetching/entities/CurrencyModel.java | 6 +- .../entities/CurrencySingleModel.java | 4 +- .../B2Access/B2AccessCustomProviderImpl.java | 2 +- .../configurableProvider/Saml2SSOUtils.java | 2 +- .../google/GoogleTokenValidator.java | 4 +- .../operations/DatabaseRepositoryImpl.java | 2 +- .../services/utilities/InvitationService.java | 2 +- .../utilities/InvitationServiceImpl.java | 6 +- .../logic/services/utilities/MailService.java | 2 +- .../services/utilities/MailServiceImpl.java | 12 +- .../ImportXmlBuilderDatasetProfile.java | 6 +- .../datasetProfileModel/DatasetProfile.java | 6 +- .../datasetProfileModel/FieldSet.java | 6 +- .../datasetProfileModel/FieldSets.java | 4 +- .../Fields/DefaultValue.java | 4 +- .../datasetProfileModel/Fields/Field.java | 6 +- .../datasetProfileModel/Fields/Fields.java | 4 +- .../datasetProfileModel/Fields/Rule.java | 6 +- .../datasetProfileModel/Fields/Schematic.java | 4 +- .../Fields/Schematics.java | 4 +- .../Fields/Validation.java | 4 +- .../datasetProfileModel/Fields/Value.java | 6 +- .../datasetProfileModel/Fields/ViewStyle.java | 4 +- .../datasetProfileModel/Fields/Visible.java | 6 +- .../Fields/validations.java | 4 +- .../datasetProfileModel/Multiplicity.java | 4 +- .../datasetProfileModel/Page.java | 6 +- .../datasetProfileModel/Section.java | 6 +- .../datasetProfileModel/Sections.java | 6 +- .../dmpXml/ImportXmlBuilderDmpBlueprint.java | 6 +- .../DescriptionTemplate.java | 4 +- .../DescriptionTemplates.java | 4 +- .../dmpBlueprintModel/DmpBlueprint.java | 4 +- .../DmpBlueprintDefinition.java | 4 +- .../dmpXml/dmpBlueprintModel/ExtraField.java | 4 +- .../dmpXml/dmpBlueprintModel/ExtraFields.java | 4 +- .../xml/dmpXml/dmpBlueprintModel/Section.java | 6 +- .../dmpXml/dmpBlueprintModel/Sections.java | 4 +- .../dmpXml/dmpBlueprintModel/SystemField.java | 4 +- .../dmpBlueprintModel/SystemFields.java | 4 +- .../notification/NotificationScheduleJob.java | 2 +- .../recent/model/RecentDmpModel.java | 2 +- .../datasetImport/DatasetImportField.java | 8 +- .../datasetImport/DatasetImportFieldSet.java | 6 +- .../datasetImport/DatasetImportFieldSets.java | 4 +- .../datasetImport/DatasetImportFields.java | 4 +- .../data/datasetImport/DatasetImportPage.java | 6 +- .../DatasetImportPagedDatasetProfile.java | 6 +- .../datasetImport/DatasetImportSection.java | 6 +- .../datasetImport/DatasetImportSections.java | 4 +- .../dmp/AssociatedProfileImportModels.java | 4 +- .../models/data/dmp/DatasetImportModels.java | 10 +- .../eudat/models/data/dmp/DmpImportModel.java | 6 +- .../data/dmp/DmpProfileImportModel.java | 4 +- .../DynamicFieldWithValueImportModels.java | 2 +- .../models/data/dmp/FieldImportModels.java | 6 +- .../models/data/dmp/FunderImportModels.java | 2 +- .../models/data/dmp/GrantImportModels.java | 2 +- .../data/dmp/OrganisationImportModel.java | 4 +- .../models/data/dmp/ProjectImportModels.java | 2 +- .../data/dmp/ResearcherImportModels.java | 4 +- .../models/data/dmp/UserInfoImportModels.java | 2 +- .../models/data/dmp/adpter/PageAdapter.java | 2 +- .../data/external/orcid/ExpandedResult.java | 6 +- .../data/external/orcid/ExpandedSearch.java | 4 +- .../data/external/orcid/PersonalDetails.java | 4 +- .../data/external/orcid/PersonalName.java | 6 +- .../models/data/invitation/Properties.java | 4 +- .../models/rda/mapper/DatasetRDAMapper.java | 2 +- .../eudat/models/rda/mapper/DmpRDAMapper.java | 4 +- .../models/rda/mapper/FundingRDAMapper.java | 2 +- .../models/rda/mapper/ProjectRDAMapper.java | 2 +- .../controllers/PublicDmpsDocumentation.java | 2 +- .../managers/DatasetPublicManager.java | 2 +- .../DataManagmentPlanPublicTableRequest.java | 2 +- dmp-frontend/package.json | 2 +- 260 files changed, 2221 insertions(+), 1097 deletions(-) create mode 100644 dmp-backend/core/pom.xml create mode 100644 dmp-backend/core/src/main/java/eu/eudat/commons/enums/DescriptionTemplateTypeStatus.java rename dmp-backend/{web => core}/src/main/java/eu/eudat/configurations/typedefinition/DataType.java (100%) rename dmp-backend/{web => core}/src/main/java/eu/eudat/configurations/typedefinition/DatabaseColumnType.java (100%) rename dmp-backend/{web => core}/src/main/java/eu/eudat/configurations/typedefinition/PostgreSQLDatabaseColumnType.java (100%) rename dmp-backend/{web => core}/src/main/java/eu/eudat/configurations/typedefinition/PostgreSQLEnumType.java (100%) rename dmp-backend/{web => core}/src/main/java/eu/eudat/configurations/typedefinition/UUIDType.java (68%) rename dmp-backend/{web => core}/src/main/java/eu/eudat/configurations/typedefinition/XMLType.java (66%) create mode 100644 dmp-backend/core/src/main/java/eu/eudat/convention/ConventionService.java create mode 100644 dmp-backend/core/src/main/java/eu/eudat/convention/ConventionServiceImpl.java create mode 100644 dmp-backend/core/src/main/java/eu/eudat/data/BaseEntity.java create mode 100644 dmp-backend/core/src/main/java/eu/eudat/data/DescriptionTemplateTypeEntity.java create mode 100644 dmp-backend/core/src/main/java/eu/eudat/errorcode/ErrorDescription.java create mode 100644 dmp-backend/core/src/main/java/eu/eudat/errorcode/ErrorThesaurusConfiguration.java create mode 100644 dmp-backend/core/src/main/java/eu/eudat/errorcode/ErrorThesaurusProperties.java create mode 100644 dmp-backend/core/src/main/java/eu/eudat/model/DescriptionTemplateType.java create mode 100644 dmp-backend/core/src/main/java/eu/eudat/model/builder/BaseBuilder.java create mode 100644 dmp-backend/core/src/main/java/eu/eudat/model/builder/DescriptionTemplateTypeBuilder.java create mode 100644 dmp-backend/core/src/main/java/eu/eudat/model/result/QueryResult.java create mode 100644 dmp-backend/core/src/main/java/eu/eudat/query/DescriptionTemplateTypeQuery.java create mode 100644 dmp-backend/core/src/main/java/eu/eudat/query/lookup/DescriptionTemplateTypeLookup.java create mode 100644 dmp-backend/core/src/main/java/eu/eudat/query/lookup/LookupAware.java create mode 100644 dmp-backend/core/src/main/java/eu/eudat/service/DescriptionTemplateTypeService.java create mode 100644 dmp-backend/web/src/main/java/eu/eudat/controllers/v2/BaseController.java create mode 100644 dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DescriptionTemplateTypeV2Controller.java diff --git a/dmp-backend/core/pom.xml b/dmp-backend/core/pom.xml new file mode 100644 index 000000000..6b4369902 --- /dev/null +++ b/dmp-backend/core/pom.xml @@ -0,0 +1,31 @@ + + + 4.0.0 + + eu.eudat + dmp-backend + 1.0.0-SNAPSHOT + + + core + + + UTF-8 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 17 + 17 + + + + + + \ No newline at end of file diff --git a/dmp-backend/core/src/main/java/eu/eudat/commons/enums/DescriptionTemplateTypeStatus.java b/dmp-backend/core/src/main/java/eu/eudat/commons/enums/DescriptionTemplateTypeStatus.java new file mode 100644 index 000000000..718809a01 --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/commons/enums/DescriptionTemplateTypeStatus.java @@ -0,0 +1,43 @@ +package eu.eudat.commons.enums; + +public enum DescriptionTemplateTypeStatus { + + SAVED((short) 0), FINALIZED((short) 1), DELETED((short) 99); + + private final short value; + + DescriptionTemplateTypeStatus(short value) { + this.value = value; + } + + public short getValue() { + return value; + } + + public static DescriptionTemplateTypeStatus fromInteger(int value) { + switch (value) { + case 0: + return SAVED; + case 1: + return FINALIZED; + case 99: + return DELETED; + default: + throw new RuntimeException("Unsupported Description Template Type Status"); + } + } + + public static DescriptionTemplateTypeStatus fromLabel(String value) { + switch (value) { + case "SAVED": + return SAVED; + case "FINALISED": + return FINALIZED; + case "DELETED": + return DELETED; + default: + throw new RuntimeException("Unsupported Description Template Type Status"); + } + } + +} diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/typedefinition/DataType.java b/dmp-backend/core/src/main/java/eu/eudat/configurations/typedefinition/DataType.java similarity index 100% rename from dmp-backend/web/src/main/java/eu/eudat/configurations/typedefinition/DataType.java rename to dmp-backend/core/src/main/java/eu/eudat/configurations/typedefinition/DataType.java diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/typedefinition/DatabaseColumnType.java b/dmp-backend/core/src/main/java/eu/eudat/configurations/typedefinition/DatabaseColumnType.java similarity index 100% rename from dmp-backend/web/src/main/java/eu/eudat/configurations/typedefinition/DatabaseColumnType.java rename to dmp-backend/core/src/main/java/eu/eudat/configurations/typedefinition/DatabaseColumnType.java diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/typedefinition/PostgreSQLDatabaseColumnType.java b/dmp-backend/core/src/main/java/eu/eudat/configurations/typedefinition/PostgreSQLDatabaseColumnType.java similarity index 100% rename from dmp-backend/web/src/main/java/eu/eudat/configurations/typedefinition/PostgreSQLDatabaseColumnType.java rename to dmp-backend/core/src/main/java/eu/eudat/configurations/typedefinition/PostgreSQLDatabaseColumnType.java diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/typedefinition/PostgreSQLEnumType.java b/dmp-backend/core/src/main/java/eu/eudat/configurations/typedefinition/PostgreSQLEnumType.java similarity index 100% rename from dmp-backend/web/src/main/java/eu/eudat/configurations/typedefinition/PostgreSQLEnumType.java rename to dmp-backend/core/src/main/java/eu/eudat/configurations/typedefinition/PostgreSQLEnumType.java diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/typedefinition/UUIDType.java b/dmp-backend/core/src/main/java/eu/eudat/configurations/typedefinition/UUIDType.java similarity index 68% rename from dmp-backend/web/src/main/java/eu/eudat/configurations/typedefinition/UUIDType.java rename to dmp-backend/core/src/main/java/eu/eudat/configurations/typedefinition/UUIDType.java index 551a8d6c0..2a1fb5cbe 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/typedefinition/UUIDType.java +++ b/dmp-backend/core/src/main/java/eu/eudat/configurations/typedefinition/UUIDType.java @@ -14,7 +14,7 @@ import java.util.UUID; /** * Currently not used */ -public class UUIDType implements UserType { +public class UUIDType implements UserType { private final int[] sqlTypesSupported = new int[]{Types.NUMERIC}; private final String CAST_EXCEPTION_TEXT = " cannot be cast to a java.util.UUID"; @@ -22,18 +22,27 @@ public class UUIDType implements UserType { return sqlTypesSupported; } - @SuppressWarnings("rawtypes") - public Class returnedClass() { + @Override + public int getSqlType() { + return sqlTypesSupported[0]; + } + + public Class returnedClass() { return UUID.class; } - public boolean equals(Object x, Object y) throws HibernateException { + public boolean equals(UUID x, UUID y) throws HibernateException { if (x == null) return y == null; else return x.equals(y); } - public int hashCode(Object x) throws HibernateException { - return x == null ? null : x.hashCode(); + public int hashCode(UUID x) throws HibernateException { + return x == null ? -1 : x.hashCode(); + } + + @Override + public UUID nullSafeGet(ResultSet rs, int position, SharedSessionContractImplementor session, Object owner) throws SQLException { + return null; } public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException { @@ -58,25 +67,24 @@ public class UUIDType implements UserType { st.setObject(index, uuid, Types.OTHER); } - public Object deepCopy(Object value) throws HibernateException { + public UUID deepCopy(UUID value) throws HibernateException { if (value == null) return null; - UUID uuid = (UUID) value; - return new UUID(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits()); + return new UUID(value.getMostSignificantBits(), value.getLeastSignificantBits()); } public boolean isMutable() { return false; } - public Serializable disassemble(Object value) throws HibernateException { - return (Serializable) value; + public Serializable disassemble(UUID value) throws HibernateException { + return value; } - public Object assemble(Serializable cached, Object owner) throws HibernateException { - return cached; + public UUID assemble(Serializable cached, Object owner) throws HibernateException { + return (UUID) cached; } - public Object replace(Object original, Object target, Object owner) throws HibernateException { + public UUID replace(UUID original, Object target, Object owner) throws HibernateException { return original; } @@ -98,7 +106,7 @@ public class UUIDType implements UserType { return nullSafeGet(rs, names, owner); } - public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) + public void nullSafeSet(PreparedStatement st, UUID value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { nullSafeSet(st, value, index); } diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/typedefinition/XMLType.java b/dmp-backend/core/src/main/java/eu/eudat/configurations/typedefinition/XMLType.java similarity index 66% rename from dmp-backend/web/src/main/java/eu/eudat/configurations/typedefinition/XMLType.java rename to dmp-backend/core/src/main/java/eu/eudat/configurations/typedefinition/XMLType.java index 8ac8be93a..bd825ae3c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/typedefinition/XMLType.java +++ b/dmp-backend/core/src/main/java/eu/eudat/configurations/typedefinition/XMLType.java @@ -13,7 +13,7 @@ import java.sql.Types; /** * Store and retrieve a PostgreSQL "xml" column as a Java string. */ -public class XMLType implements UserType { +public class XMLType implements UserType { private final int[] sqlTypesSupported = new int[]{Types.VARCHAR}; @@ -21,11 +21,16 @@ public class XMLType implements UserType { return sqlTypesSupported; } - public Class returnedClass() { + @Override + public int getSqlType() { + return sqlTypesSupported[0]; + } + + public Class returnedClass() { return String.class; } - public boolean equals(Object x, Object y) throws HibernateException { + public boolean equals(String x, String y) throws HibernateException { if (x == null) { return y == null; } else { @@ -33,8 +38,13 @@ public class XMLType implements UserType { } } - public int hashCode(Object x) throws HibernateException { - return x == null ? null : x.hashCode(); + public int hashCode(String x) throws HibernateException { + return x == null ? -1 : x.hashCode(); + } + + @Override + public String nullSafeGet(ResultSet resultSet, int i, SharedSessionContractImplementor sharedSessionContractImplementor, Object o) throws SQLException { + return null; } public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException { @@ -51,25 +61,23 @@ public class XMLType implements UserType { } } - public Object deepCopy(Object value) throws HibernateException { - if (value == null) - return null; - return new String((String) value); + public String deepCopy(String value) throws HibernateException { + return value; } public boolean isMutable() { return false; } - public Serializable disassemble(Object value) throws HibernateException { - return (String) value; + public Serializable disassemble(String value) throws HibernateException { + return value; } - public Object assemble(Serializable cached, Object owner) throws HibernateException { + public String assemble(Serializable cached, Object owner) throws HibernateException { return (String) cached; } - public Object replace(Object original, Object target, Object owner) throws HibernateException { + public String replace(String original, String target, Object owner) throws HibernateException { return original; } @@ -78,9 +86,8 @@ public class XMLType implements UserType { return nullSafeGet(rs, names, owner); } - public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { + public void nullSafeSet(PreparedStatement st, String value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { nullSafeSet(st, value, index); - } } \ No newline at end of file diff --git a/dmp-backend/core/src/main/java/eu/eudat/convention/ConventionService.java b/dmp-backend/core/src/main/java/eu/eudat/convention/ConventionService.java new file mode 100644 index 000000000..fc051a956 --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/convention/ConventionService.java @@ -0,0 +1,40 @@ +package eu.eudat.convention; + +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.function.Function; + +public interface ConventionService { + + Boolean isValidId(Integer id); + + Boolean isValidGuid(UUID guid); + + Boolean isValidUUID(String str); + UUID parseUUIDSafe(String str); + + Boolean isValidHash(String hash); + + String hashValue(Object value); + + String limit(String text, int maxLength); + + String truncate(String text, int maxLength); + + UUID getEmptyUUID(); + + boolean isNullOrEmpty(String value); + + boolean isListNullOrEmpty(List value); + + String stringEmpty(); + + String asPrefix(String name); + + String asIndexerPrefix(String part); + + String asIndexer(String... names); + + Map> toDictionaryOfList(List items, Function keySelector); +} diff --git a/dmp-backend/core/src/main/java/eu/eudat/convention/ConventionServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/convention/ConventionServiceImpl.java new file mode 100644 index 000000000..a57333284 --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/convention/ConventionServiceImpl.java @@ -0,0 +1,150 @@ +package eu.eudat.convention; + +import eu.eudat.errorcode.ErrorThesaurusProperties; +import gr.cite.tools.exception.MyApplicationException; +import gr.cite.tools.logging.LoggerService; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; + +import java.time.Instant; +import java.util.*; +import java.util.function.Function; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +@Component +@Scope(value = ConfigurableBeanFactory.SCOPE_SINGLETON) +public class ConventionServiceImpl implements ConventionService { + private final static Pattern UUID_REGEX_PATTERN = Pattern.compile("^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$"); + + private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(ConventionServiceImpl.class)); + private final ErrorThesaurusProperties errors; + + @Autowired + public ConventionServiceImpl(ErrorThesaurusProperties errors) { + this.errors = errors; + } + + @Override + public Boolean isValidId(Integer id) { + return id != null && id > 0; + } + + @Override + public Boolean isValidGuid(UUID guid) { + return guid != null && !guid.equals(this.getEmptyUUID()); + } + + @Override + public Boolean isValidUUID(String str) { + if (this.isNullOrEmpty(str)) { + return false; + } + return UUID_REGEX_PATTERN.matcher(str).matches(); + } + + @Override + public UUID parseUUIDSafe(String str) { + if (!this.isValidUUID(str)) { + return null; + } + try { + return UUID.fromString(str); + } catch (Exception ex){ + logger.warn("invalid uuid" + str, ex); + return null; + } + } + + @Override + public Boolean isValidHash(String hash) { + return !this.isNullOrEmpty(hash); + } + + @Override + public String hashValue(Object value) throws MyApplicationException { + if (value == null) return this.stringEmpty(); + if (value instanceof Instant) return String.format("%ts", (Instant) value); + throw new MyApplicationException(this.errors.getSystemError().getCode(), this.errors.getSystemError().getMessage()); + } + + @Override + public String limit(String text, int maxLength) { + if (this.isNullOrEmpty(text)) return text; + if (text.length() > maxLength) return String.format("%s...", text.substring(0, maxLength)); + else return text; + } + + @Override + public String truncate(String text, int maxLength) { + String truncated = text; + if (text.length() < maxLength) return text; + + truncated = truncated.trim(); + truncated = truncated.replaceAll("\\s+", " ");//remove multiple spaces + if (truncated.length() < maxLength) return truncated; + truncated = truncated.replaceAll("([.!@#$%^&-=':;,<>?*\"/|])+", "");//remove multiple spaces + if (truncated.length() < maxLength) return truncated; + truncated = truncated.replaceAll("([aeiou])+", "");//remove multiple spaces + if (truncated.length() < maxLength) return truncated; + truncated = truncated.replaceAll("([AEIOU])+", "");//remove multiple spaces + if (truncated.length() < maxLength) return truncated; + + if (text.length() > maxLength) return String.format("%s...", text.substring(0, maxLength)); + return text; + + } + + @Override + public UUID getEmptyUUID() { + return new UUID(0L, 0L); + } + + @Override + public boolean isNullOrEmpty(String value) { + return value == null || value.isEmpty(); + } + + @Override + public boolean isListNullOrEmpty(List value) { + if(value == null) return true; + return value.isEmpty(); + } + + @Override + public String stringEmpty() { + return ""; + } + + @Override + public String asPrefix(String name) { + if (name == null) return null; + return name + "."; + } + + @Override + public String asIndexer(String... names) { + if (names == null) return null; + return String.join(".", Arrays.stream(names).filter(x -> !this.isNullOrEmpty(x)).collect(Collectors.toList())); + } + + @Override + public String asIndexerPrefix(String part) { + if (part == null) return null; + return part + "."; + } + + @Override + public Map> toDictionaryOfList(List items, Function keySelector) { + Map> map = new HashMap<>(); + for (V model : items) { + K key = keySelector.apply(model); + if (!map.containsKey(key)) map.put(key, new ArrayList()); + map.get(key).add(model); + } + return map; + } +} diff --git a/dmp-backend/core/src/main/java/eu/eudat/data/BaseEntity.java b/dmp-backend/core/src/main/java/eu/eudat/data/BaseEntity.java new file mode 100644 index 000000000..df00c3311 --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/data/BaseEntity.java @@ -0,0 +1,5 @@ +package eu.eudat.data; + +public interface BaseEntity { + +} diff --git a/dmp-backend/core/src/main/java/eu/eudat/data/DescriptionTemplateTypeEntity.java b/dmp-backend/core/src/main/java/eu/eudat/data/DescriptionTemplateTypeEntity.java new file mode 100644 index 000000000..be7a2477f --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/data/DescriptionTemplateTypeEntity.java @@ -0,0 +1,54 @@ +package eu.eudat.data; + +import org.hibernate.annotations.GenericGenerator; + +import jakarta.persistence.*; +import java.util.UUID; + +@Entity +@Table(name = "DescriptionTemplateType") +public class DescriptionTemplateTypeEntity implements BaseEntity { + + @Id + @GeneratedValue + @GenericGenerator(name = "uuid2", strategy = "uuid2") + @Column(name = "ID", updatable = false, nullable = false, columnDefinition = "BINARY(16)") + private UUID id; + + public static final String _id = "ID"; + + @Column(name = "Name", nullable = false) + private String name; + + public static final String _name = "Name"; + + @Column(name = "Status", nullable = false) + private Short status; + + public static final String _status = "Status"; + + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Short getStatus() { + return status; + } + + public void setStatus(Short status) { + this.status = status; + } + +} diff --git a/dmp-backend/core/src/main/java/eu/eudat/errorcode/ErrorDescription.java b/dmp-backend/core/src/main/java/eu/eudat/errorcode/ErrorDescription.java new file mode 100644 index 000000000..a7387ec9f --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/errorcode/ErrorDescription.java @@ -0,0 +1,25 @@ +package eu.eudat.errorcode; + +public class ErrorDescription { + + private int code; + + private String message; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/dmp-backend/core/src/main/java/eu/eudat/errorcode/ErrorThesaurusConfiguration.java b/dmp-backend/core/src/main/java/eu/eudat/errorcode/ErrorThesaurusConfiguration.java new file mode 100644 index 000000000..3aaa16690 --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/errorcode/ErrorThesaurusConfiguration.java @@ -0,0 +1,12 @@ +package eu.eudat.errorcode; + +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Configuration +@EnableConfigurationProperties(ErrorThesaurusProperties.class) +public class ErrorThesaurusConfiguration { + + + +} diff --git a/dmp-backend/core/src/main/java/eu/eudat/errorcode/ErrorThesaurusProperties.java b/dmp-backend/core/src/main/java/eu/eudat/errorcode/ErrorThesaurusProperties.java new file mode 100644 index 000000000..536391a02 --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/errorcode/ErrorThesaurusProperties.java @@ -0,0 +1,48 @@ +package eu.eudat.errorcode; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +@ConfigurationProperties(prefix = "error-thesaurus") +public class ErrorThesaurusProperties { + + private ErrorDescription systemError; + + public ErrorDescription getSystemError() { + return systemError; + } + + public void setSystemError(ErrorDescription systemError) { + this.systemError = systemError; + } + + private ErrorDescription forbidden; + + public ErrorDescription getForbidden() { + return forbidden; + } + + public void setForbidden(ErrorDescription forbidden) { + this.forbidden = forbidden; + } + + private ErrorDescription hashConflict; + + public ErrorDescription getHashConflict() { + return hashConflict; + } + + public void setHashConflict(ErrorDescription hashConflict) { + this.hashConflict = hashConflict; + } + + private ErrorDescription modelValidation; + + public ErrorDescription getModelValidation() { + return modelValidation; + } + + public void setModelValidation(ErrorDescription modelValidation) { + this.modelValidation = modelValidation; + } + +} diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/DescriptionTemplateType.java b/dmp-backend/core/src/main/java/eu/eudat/model/DescriptionTemplateType.java new file mode 100644 index 000000000..1350eb689 --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/model/DescriptionTemplateType.java @@ -0,0 +1,37 @@ +package eu.eudat.model; + +import java.util.UUID; + +public class DescriptionTemplateType { + + private UUID id; + + private String name; + + private short status; + + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public short getStatus() { + return status; + } + + public void setStatus(short status) { + this.status = status; + } + +} diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/builder/BaseBuilder.java b/dmp-backend/core/src/main/java/eu/eudat/model/builder/BaseBuilder.java new file mode 100644 index 000000000..4d6b584ab --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/model/builder/BaseBuilder.java @@ -0,0 +1,97 @@ +package eu.eudat.model.builder; + +import eu.eudat.convention.ConventionService; +import gr.cite.tools.data.builder.Builder; +import gr.cite.tools.data.query.QueryBase; +import gr.cite.tools.fieldset.BaseFieldSet; +import gr.cite.tools.fieldset.FieldSet; +import gr.cite.tools.logging.LoggerService; + +import java.time.Instant; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +public abstract class BaseBuilder implements Builder { + + protected final LoggerService logger; + + protected final ConventionService conventionService; + + public BaseBuilder( + ConventionService conventionService, + LoggerService logger + ) { + this.conventionService = conventionService; + this.logger = logger; + } + + public M build(FieldSet directives, D data) { + if (data == null) { + return null; + } + List models = this.build(directives == null ? getFullFieldSet() : directives, List.of(data)); + return models.stream().findFirst().orElse(null); + } + + public abstract List build(FieldSet directives, List data); + + public abstract FieldSet getFullFieldSet(); + + public Map asForeignKey(QueryBase query, FieldSet directives, Function keySelector) { + this.logger.trace("Building references from query"); + List data = query.collectAs(directives); + this.logger.trace("collected {} items to build", Optional.ofNullable(data).map(List::size).orElse(0)); + return this.asForeignKey(data, directives, keySelector); + } + + public Map asForeignKey(List data, FieldSet directives, Function keySelector) { + this.logger.trace("building references"); + List models = this.build(directives, data); + this.logger.trace("mapping {} build items from {} requested", Optional.ofNullable(models).map(List::size).orElse(0), Optional.ofNullable(data).map(List::size).orElse(0)); + assert models != null; + return models.stream().collect(Collectors.toMap(keySelector, o -> o)); + } + + public Map> asMasterKey(QueryBase query, FieldSet directives, Function keySelector) { + this.logger.trace("Building details from query"); + List data = query.collectAs(directives); + this.logger.trace("collected {} items to build", Optional.ofNullable(data).map(List::size).orElse(0)); + return this.asMasterKey(data, directives, keySelector); + } + + public Map> asMasterKey(List data, FieldSet directives, Function keySelector) { + this.logger.trace("building details"); + List models = this.build(directives, data); + this.logger.trace("mapping {} build items from {} requested", Optional.ofNullable(models).map(List::size).orElse(0), Optional.ofNullable(data).map(List::size).orElse(0)); + Map> map = new HashMap<>(); + assert models != null; + for (M model : models) { + K key = keySelector.apply(model); + if (!map.containsKey(key)) + map.put(key, new ArrayList()); + map.get(key).add(model); + } + return map; + } + + public Map asEmpty(List keys, Function mapper, Function keySelector) { + this.logger.trace("building static references"); + List models = keys.stream().map(mapper).collect(Collectors.toList()); + this.logger.trace("mapping {} build items from {} requested", Optional.of(models).map(List::size).orElse(0), Optional.of(keys).map(List::size)); + return models.stream().collect(Collectors.toMap(keySelector, o -> o)); + } + + protected String hashValue(Instant value) { + return this.conventionService.hashValue(value); + } + + protected String asPrefix(String name) { + return this.conventionService.asPrefix(name); + } + + protected String asIndexer(String... names) { + return this.conventionService.asIndexer(names); + } + +} diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/builder/DescriptionTemplateTypeBuilder.java b/dmp-backend/core/src/main/java/eu/eudat/model/builder/DescriptionTemplateTypeBuilder.java new file mode 100644 index 000000000..edafeb799 --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/model/builder/DescriptionTemplateTypeBuilder.java @@ -0,0 +1,56 @@ +package eu.eudat.model.builder; + +import eu.eudat.convention.ConventionService; +import eu.eudat.data.DescriptionTemplateTypeEntity; +import eu.eudat.model.DescriptionTemplateType; +import gr.cite.tools.fieldset.BaseFieldSet; +import gr.cite.tools.fieldset.FieldSet; +import gr.cite.tools.logging.LoggerService; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +@Component +public class DescriptionTemplateTypeBuilder extends BaseBuilder { + + public DescriptionTemplateTypeBuilder(ConventionService conventionService) { + super(conventionService, new LoggerService(LoggerFactory.getLogger(DescriptionTemplateTypeBuilder.class))); + } + + @Override + public List build(FieldSet directives, List data) { + if (directives == null || directives.isEmpty()) + return new ArrayList<>(); + + List models = new ArrayList<>(100); + + if (data == null) + return models; + for (DescriptionTemplateTypeEntity d : data) { + DescriptionTemplateType m = new DescriptionTemplateType(); + if (directives.hasField(this.asIndexer(DescriptionTemplateTypeEntity._id))) + m.setId(d.getId()); + if (directives.hasField(this.asIndexer(DescriptionTemplateTypeEntity._name))) + m.setName(d.getName()); + if (directives.hasField(this.asIndexer(DescriptionTemplateTypeEntity._status))) + m.setStatus(d.getStatus()); + models.add(m); + } + + return models; + } + + @Override + public FieldSet getFullFieldSet() { + BaseFieldSet fieldSet = new BaseFieldSet(); + fieldSet.setFields(Set.of( + DescriptionTemplateTypeEntity._id, + DescriptionTemplateTypeEntity._name, + DescriptionTemplateTypeEntity._status + )); + return fieldSet; + } +} diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/result/QueryResult.java b/dmp-backend/core/src/main/java/eu/eudat/model/result/QueryResult.java new file mode 100644 index 000000000..84cfa612a --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/model/result/QueryResult.java @@ -0,0 +1,71 @@ +package eu.eudat.model.result; + +import java.util.ArrayList; +import java.util.List; + +public class QueryResult { + + public QueryResult() { + } + + public QueryResult(List items, long count, long countOverride) { + this.items = items; + this.count = count; + this.countOverride = countOverride; + } + + public QueryResult(List items, long count) { + this.items = items; + this.count = count; + this.countOverride = 0; + } + + public QueryResult(M item) { + this.items = List.of(item); + this.count = 1; + this.countOverride = 0; + } + + public QueryResult(List items) { + this.items = items; + if (items != null) + this.count = items.size(); + else + this.count = 0; + } + + private List items; + + private long count; + + private long countOverride; + + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public long getCount() { + return count; + } + + public void setCount(long count) { + this.count = count; + } + + public long getCountOverride() { + return countOverride; + } + + public void setCountOverride(long countOverride) { + this.countOverride = countOverride; + } + + public static QueryResult empty() { + return new QueryResult<>(new ArrayList<>(), 0L); + } + +} diff --git a/dmp-backend/core/src/main/java/eu/eudat/query/DescriptionTemplateTypeQuery.java b/dmp-backend/core/src/main/java/eu/eudat/query/DescriptionTemplateTypeQuery.java new file mode 100644 index 000000000..8476fb6b6 --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/query/DescriptionTemplateTypeQuery.java @@ -0,0 +1,132 @@ +package eu.eudat.query; + +import eu.eudat.commons.enums.DescriptionTemplateTypeStatus; +import eu.eudat.data.DescriptionTemplateTypeEntity; +import eu.eudat.query.lookup.DescriptionTemplateTypeLookup; +import eu.eudat.query.lookup.LookupAware; +import gr.cite.tools.data.query.FieldResolver; +import gr.cite.tools.data.query.QueryBase; +import gr.cite.tools.data.query.QueryContext; +import jakarta.persistence.Tuple; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.Predicate; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; + +import java.util.*; + +@Component +@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) +public class DescriptionTemplateTypeQuery extends QueryBase implements LookupAware { + + private Collection ids; + + private Collection names; + + private Collection statuses; + + public DescriptionTemplateTypeQuery ids(UUID value) { + this.ids = List.of(value); + return this; + } + + public DescriptionTemplateTypeQuery ids(UUID... value) { + this.ids = Arrays.asList(value); + return this; + } + + public DescriptionTemplateTypeQuery ids(List value) { + this.ids = value; + return this; + } + + public DescriptionTemplateTypeQuery names(String value) { + this.names = List.of(value); + return this; + } + + public DescriptionTemplateTypeQuery names(String... value) { + this.names = Arrays.asList(value); + return this; + } + + public DescriptionTemplateTypeQuery names(List value) { + this.names = value; + return this; + } + + public DescriptionTemplateTypeQuery statuses(Short value) { + this.statuses = List.of(value); + return this; + } + + public DescriptionTemplateTypeQuery statuses(Short... value) { + this.statuses = Arrays.asList(value); + return this; + } + + public DescriptionTemplateTypeQuery statuses(List value) { + this.statuses = value; + return this; + } + + @Override + public DescriptionTemplateTypeQuery fromLookup(DescriptionTemplateTypeLookup lookup) { + if (lookup == null) return this; + if (lookup.getName() != null) names(lookup.getName()); + if (lookup.getStatus() != null) statuses(DescriptionTemplateTypeStatus.fromLabel(lookup.getStatus()).getValue()); + return this; + } + + @Override + protected Boolean isFalseQuery() { + return Boolean.FALSE; + } + + @Override + protected Class entityClass() { + return DescriptionTemplateTypeEntity.class; + } + + @Override + protected Predicate applyFilters(QueryContext queryContext) { + List predicates = new ArrayList<>(); + + if (this.ids != null) { + CriteriaBuilder.In inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DescriptionTemplateTypeEntity._id)); + for (UUID item : this.ids) inClause.value(item); + predicates.add(inClause); + } + + if (this.names != null) { + CriteriaBuilder.In inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DescriptionTemplateTypeEntity._name)); + for (String item : this.names) inClause.value(item); + predicates.add(inClause); + } + + if (this.statuses != null) { + CriteriaBuilder.In inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DescriptionTemplateTypeEntity._status)); + for (Short item : this.statuses) inClause.value(item); + predicates.add(inClause); + } + + if (!predicates.isEmpty()) { + Predicate[] predicatesArray = predicates.toArray(new Predicate[0]); + return queryContext.CriteriaBuilder.and(predicatesArray); + } else { + return queryContext.CriteriaBuilder.and(); + } + } + + @Override + protected String fieldNameOf(FieldResolver item) { + return null; + } + + @Override + protected DescriptionTemplateTypeEntity convert(Tuple tuple, Set columns) { + return null; + } + +} diff --git a/dmp-backend/core/src/main/java/eu/eudat/query/lookup/DescriptionTemplateTypeLookup.java b/dmp-backend/core/src/main/java/eu/eudat/query/lookup/DescriptionTemplateTypeLookup.java new file mode 100644 index 000000000..0c928c99e --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/query/lookup/DescriptionTemplateTypeLookup.java @@ -0,0 +1,25 @@ +package eu.eudat.query.lookup; + +import gr.cite.tools.data.query.Lookup; + +public class DescriptionTemplateTypeLookup extends Lookup { + + private String name, status; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + +} diff --git a/dmp-backend/core/src/main/java/eu/eudat/query/lookup/LookupAware.java b/dmp-backend/core/src/main/java/eu/eudat/query/lookup/LookupAware.java new file mode 100644 index 000000000..993c6b137 --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/query/lookup/LookupAware.java @@ -0,0 +1,12 @@ +package eu.eudat.query.lookup; + +public interface LookupAware { + + /** + * Every query that supports building from a lookup object should implement this interface + * @param lookup The object containing all the lookup options + * @return The query built from all the set options + */ + Q fromLookup(L lookup); + +} diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/DescriptionTemplateTypeService.java b/dmp-backend/core/src/main/java/eu/eudat/service/DescriptionTemplateTypeService.java new file mode 100644 index 000000000..3f8ebef88 --- /dev/null +++ b/dmp-backend/core/src/main/java/eu/eudat/service/DescriptionTemplateTypeService.java @@ -0,0 +1,101 @@ +package eu.eudat.service; + +import eu.eudat.commons.enums.DescriptionTemplateTypeStatus; +import eu.eudat.data.DescriptionTemplateTypeEntity; +import eu.eudat.model.DescriptionTemplateType; +import eu.eudat.model.builder.DescriptionTemplateTypeBuilder; +import eu.eudat.query.DescriptionTemplateTypeQuery; +import eu.eudat.query.lookup.DescriptionTemplateTypeLookup; +import gr.cite.tools.data.builder.BuilderFactory; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Service; +import org.springframework.transaction.PlatformTransactionManager; +import org.springframework.transaction.TransactionDefinition; +import org.springframework.transaction.TransactionStatus; +import org.springframework.transaction.support.DefaultTransactionDefinition; + +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; +import java.util.List; +import java.util.UUID; + +@Service +public class DescriptionTemplateTypeService { + + private final ApplicationContext applicationContext; + + private final BuilderFactory builderFactory; + + private final PlatformTransactionManager transactionManager; + + @PersistenceContext + private EntityManager entityManager; + + public DescriptionTemplateTypeService(ApplicationContext applicationContext, BuilderFactory builderFactory, PlatformTransactionManager platformTransactionManager) { + this.applicationContext = applicationContext; + this.builderFactory = builderFactory; + this.transactionManager = platformTransactionManager; + } + + public List getAll(DescriptionTemplateTypeLookup lookup) { + DescriptionTemplateTypeQuery query = applicationContext.getBean(DescriptionTemplateTypeQuery.class); + return builderFactory + .builder(DescriptionTemplateTypeBuilder.class) + .build(lookup.getProject(), query.fromLookup(lookup).collect()); + } + + public DescriptionTemplateType getById(UUID id) { + DescriptionTemplateTypeQuery query = applicationContext.getBean(DescriptionTemplateTypeQuery.class); + return builderFactory + .builder(DescriptionTemplateTypeBuilder.class) + .build(null, query.ids(id).first()); + } + + public DescriptionTemplateType create(DescriptionTemplateType payload) { + DescriptionTemplateTypeEntity created = new DescriptionTemplateTypeEntity(); + created.setId(UUID.randomUUID()); + created.setName(payload.getName()); + created.setStatus(DescriptionTemplateTypeStatus.SAVED.getValue()); + + DefaultTransactionDefinition definition = new DefaultTransactionDefinition(); + definition.setName(UUID.randomUUID().toString()); + definition.setIsolationLevel(TransactionDefinition.ISOLATION_READ_COMMITTED); + definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); + TransactionStatus status = null; + try { + status = transactionManager.getTransaction(definition); + entityManager.persist(created); + + entityManager.flush(); + transactionManager.commit(status); + } catch (Exception ex) { + if (status != null) + transactionManager.rollback(status); + throw ex; + } + + DescriptionTemplateTypeQuery query = applicationContext.getBean(DescriptionTemplateTypeQuery.class); + return builderFactory + .builder(DescriptionTemplateTypeBuilder.class) + .build(null, query.ids(created.getId()).first()); + } + + public DescriptionTemplateType update(DescriptionTemplateType payload) { + DescriptionTemplateTypeEntity entity = entityManager.find(DescriptionTemplateTypeEntity.class, payload.getId()); + entity.setName(payload.getName()); + entity.setStatus(payload.getStatus()); + entityManager.merge(entity); + entityManager.flush(); + return builderFactory.builder(DescriptionTemplateTypeBuilder.class).build(null, entity); + } + + public boolean delete (UUID id) { + DescriptionTemplateTypeEntity entity = entityManager.find(DescriptionTemplateTypeEntity.class, id); + if (entity == null) return false; + entity.setStatus(DescriptionTemplateTypeStatus.DELETED.getValue()); + entityManager.merge(entity); + entityManager.flush(); + return true; + } + +} diff --git a/dmp-backend/data/pom.xml b/dmp-backend/data/pom.xml index 6c162868f..59d45c51d 100644 --- a/dmp-backend/data/pom.xml +++ b/dmp-backend/data/pom.xml @@ -15,6 +15,13 @@ + + + eu.eudat + core + 1.0.0-SNAPSHOT + + dmp-backend queryable diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/converters/DateToUTCConverter.java b/dmp-backend/data/src/main/java/eu/eudat/data/converters/DateToUTCConverter.java index e0fd8e070..3a9207eb2 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/converters/DateToUTCConverter.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/converters/DateToUTCConverter.java @@ -4,8 +4,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.format.datetime.DateFormatter; -import javax.persistence.AttributeConverter; -import javax.persistence.Converter; +import jakarta.persistence.AttributeConverter; +import jakarta.persistence.Converter; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/databaselayer/context/DatabaseContext.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/databaselayer/context/DatabaseContext.java index 49f823d63..6857e4ffd 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/databaselayer/context/DatabaseContext.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/databaselayer/context/DatabaseContext.java @@ -8,9 +8,9 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.PersistenceContext; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; +import jakarta.persistence.PersistenceContext; @Repository("databaseCtx") diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/databaselayer/service/DatabaseService.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/databaselayer/service/DatabaseService.java index 6355da0e2..6ef82d736 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/databaselayer/service/DatabaseService.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/databaselayer/service/DatabaseService.java @@ -7,7 +7,7 @@ import eu.eudat.queryable.queryableentity.DataEntity; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Set; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java index ac8ce47d7..ab9c07b93 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java @@ -10,13 +10,13 @@ import eu.eudat.queryable.QueryableList; import eu.eudat.queryable.types.FieldSelectionType; import eu.eudat.queryable.types.SelectionField; import eu.eudat.types.grant.GrantStateType; +import jakarta.persistence.criteria.Join; +import jakarta.persistence.criteria.JoinType; +import jakarta.transaction.Transactional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; -import javax.persistence.criteria.Join; -import javax.persistence.criteria.JoinType; -import javax.transaction.Transactional; import java.util.Arrays; import java.util.Date; import java.util.List; @@ -26,41 +26,41 @@ import java.util.concurrent.CompletableFuture; @Component("dMPDao") public class DMPDaoImpl extends DatabaseAccess implements DMPDao { - @Autowired - public DMPDaoImpl(DatabaseService databaseService) { - super(databaseService); - } + @Autowired + public DMPDaoImpl(DatabaseService databaseService) { + super(databaseService); + } - @Override - public QueryableList getWithCriteria(DataManagementPlanCriteria criteria) { - QueryableList query = getDatabaseService().getQueryable(DMP.getHints(), DMP.class); - if (criteria.getLike() != null && !criteria.getLike().isEmpty()) - query.where((builder, root) -> builder.or( - builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%"), - builder.like(builder.upper(root.get("description")), "%" + criteria.getLike().toUpperCase() + "%"))); - if (criteria.getPeriodEnd() != null) - query.where((builder, root) -> builder.lessThan(root.get("created"), criteria.getPeriodEnd())); - if (criteria.getPeriodStart() != null) - query.where((builder, root) -> builder.greaterThan(root.get("created"), criteria.getPeriodStart())); - if (criteria.getGrants() != null && !criteria.getGrants().isEmpty()) - query.where(((builder, root) -> root.get("grant").in(criteria.getGrants()))); - if (!criteria.getAllVersions()) - query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("version"), - query.subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.and( - builder1.equal(externalRoot.get("groupId"), nestedRoot.get("groupId")), - builder1.notEqual(nestedRoot.get("status"), DMP.DMPStatus.DELETED.getValue())), Arrays.asList(new SelectionField(FieldSelectionType.FIELD, "version")), String.class))); - if (criteria.getGroupIds() != null && !criteria.getGroupIds().isEmpty()) - query.where((builder, root) -> root.get("groupId").in(criteria.getGroupIds())); - if (criteria.getStatus() != null) { - if (criteria.getStatus() == DMP.DMPStatus.FINALISED.getValue()) { - query.where((builder, root) -> builder.equal(root.get("status"), DMP.DMPStatus.FINALISED.getValue())); - } else if (criteria.getStatus() == DMP.DMPStatus.ACTIVE.getValue()) { - query.where((builder, root) -> builder.equal(root.get("status"), DMP.DMPStatus.ACTIVE.getValue())); - } - } - if (criteria.getIsPublic()) { - query.where(((builder, root) -> builder.equal(root.get("isPublic"), criteria.getIsPublic()))); - } + @Override + public QueryableList getWithCriteria(DataManagementPlanCriteria criteria) { + QueryableList query = getDatabaseService().getQueryable(DMP.getHints(), DMP.class); + if (criteria.getLike() != null && !criteria.getLike().isEmpty()) + query.where((builder, root) -> builder.or( + builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%"), + builder.like(builder.upper(root.get("description")), "%" + criteria.getLike().toUpperCase() + "%"))); + if (criteria.getPeriodEnd() != null) + query.where((builder, root) -> builder.lessThan(root.get("created"), criteria.getPeriodEnd())); + if (criteria.getPeriodStart() != null) + query.where((builder, root) -> builder.greaterThan(root.get("created"), criteria.getPeriodStart())); + if (criteria.getGrants() != null && !criteria.getGrants().isEmpty()) + query.where(((builder, root) -> root.get("grant").in(criteria.getGrants()))); + if (!criteria.getAllVersions()) + query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("version"), + query.subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.and( + builder1.equal(externalRoot.get("groupId"), nestedRoot.get("groupId")), + builder1.notEqual(nestedRoot.get("status"), DMP.DMPStatus.DELETED.getValue())), Arrays.asList(new SelectionField(FieldSelectionType.FIELD, "version")), Integer.class))); + if (criteria.getGroupIds() != null && !criteria.getGroupIds().isEmpty()) + query.where((builder, root) -> root.get("groupId").in(criteria.getGroupIds())); + if (criteria.getStatus() != null) { + if (criteria.getStatus() == DMP.DMPStatus.FINALISED.getValue()) { + query.where((builder, root) -> builder.equal(root.get("status"), DMP.DMPStatus.FINALISED.getValue())); + } else if (criteria.getStatus() == DMP.DMPStatus.ACTIVE.getValue()) { + query.where((builder, root) -> builder.equal(root.get("status"), DMP.DMPStatus.ACTIVE.getValue())); + } + } + if (criteria.getIsPublic()) { + query.where(((builder, root) -> builder.equal(root.get("isPublic"), criteria.getIsPublic()))); + } /*if (criteria.getRole() != null) { if (criteria.getRole().equals(UserDMP.UserDMPRoles.OWNER.getValue())) { query.where((builder, root) -> builder.equal(root.join("users", JoinType.LEFT).get("role"), UserDMP.UserDMPRoles.OWNER.getValue())); @@ -68,82 +68,82 @@ public class DMPDaoImpl extends DatabaseAccess implements DMPDao { query.where((builder, root) -> builder.equal(root.join("users", JoinType.LEFT).get("role"), UserDMP.UserDMPRoles.USER.getValue())); } }*/ - if (criteria.getOrganisations() != null && !criteria.getOrganisations().isEmpty()) { - query.where((builder, root) -> root.join("organisations").get("reference").in(criteria.getOrganisations())); - } - if (criteria.getCollaborators() != null && !criteria.getCollaborators().isEmpty()) { - query.where((builder, root) -> root.join("users", JoinType.LEFT).join("user", JoinType.LEFT).get("id").in(criteria.getCollaborators())); - } - if (criteria.getDatasetTemplates() != null && !criteria.getDatasetTemplates().isEmpty()) { - query.where((builder, root) -> root.join("associatedDmps", JoinType.LEFT).get("id").in(criteria.getDatasetTemplates())); - } - if (criteria.getGrantStatus() != null) { - if (criteria.getGrantStatus().equals(GrantStateType.FINISHED.getValue().shortValue())) - query.where((builder, root) -> builder.lessThan(root.get("grant").get("enddate"), new Date())); - if (criteria.getGrantStatus().equals(GrantStateType.ONGOING.getValue().shortValue())) - query.where((builder, root) -> - builder.or(builder.greaterThan(root.get("grant").get("enddate"), new Date()) - , builder.isNull(root.get("grant").get("enddate")))); - } + if (criteria.getOrganisations() != null && !criteria.getOrganisations().isEmpty()) { + query.where((builder, root) -> root.join("organisations").get("reference").in(criteria.getOrganisations())); + } + if (criteria.getCollaborators() != null && !criteria.getCollaborators().isEmpty()) { + query.where((builder, root) -> root.join("users", JoinType.LEFT).join("user", JoinType.LEFT).get("id").in(criteria.getCollaborators())); + } + if (criteria.getDatasetTemplates() != null && !criteria.getDatasetTemplates().isEmpty()) { + query.where((builder, root) -> root.join("associatedDmps", JoinType.LEFT).get("id").in(criteria.getDatasetTemplates())); + } + if (criteria.getGrantStatus() != null) { + if (criteria.getGrantStatus().equals(GrantStateType.FINISHED.getValue().shortValue())) + query.where((builder, root) -> builder.lessThan(root.get("grant").get("enddate"), new Date())); + if (criteria.getGrantStatus().equals(GrantStateType.ONGOING.getValue().shortValue())) + query.where((builder, root) -> + builder.or(builder.greaterThan(root.get("grant").get("enddate"), new Date()) + , builder.isNull(root.get("grant").get("enddate")))); + } - if (criteria.hasDoi()) { - query.where((builder, root) -> builder.not(builder.isNull(root.join("dois").get("id")))); - } - query.where((builder, root) -> builder.notEqual(root.get("status"), DMP.DMPStatus.DELETED.getValue())); - return query; - } + if (criteria.hasDoi()) { + query.where((builder, root) -> builder.not(builder.isNull(root.join("dois").get("id")))); + } + query.where((builder, root) -> builder.notEqual(root.get("status"), DMP.DMPStatus.DELETED.getValue())); + return query; + } - public QueryableList getAuthenticated(QueryableList query, UUID principal, List roles) { - if (roles != null && !roles.isEmpty()) { - query.where((builder, root) -> { - Join userJoin = root.join("users", JoinType.LEFT); - return builder.and(builder.equal(userJoin.join("user", JoinType.LEFT).get("id"), principal), userJoin.get("role").in(roles)); - }); - } else { - query.where((builder, root) -> builder.equal(root.join("users", JoinType.LEFT).join("user", JoinType.LEFT).get("id"), principal)); - } + public QueryableList getAuthenticated(QueryableList query, UUID principal, List roles) { + if (roles != null && !roles.isEmpty()) { + query.where((builder, root) -> { + Join userJoin = root.join("users", JoinType.LEFT); + return builder.and(builder.equal(userJoin.join("user", JoinType.LEFT).get("id"), principal), userJoin.get("role").in(roles)); + }); + } else { + query.where((builder, root) -> builder.equal(root.join("users", JoinType.LEFT).join("user", JoinType.LEFT).get("id"), principal)); + } - return query; - } + return query; + } - @Override - @Transactional - public DMP createOrUpdate(DMP item) { - return this.getDatabaseService().createOrUpdate(item, DMP.class); - } + @Override + @Transactional + public DMP createOrUpdate(DMP item) { + return this.getDatabaseService().createOrUpdate(item, DMP.class); + } - @Override - public DMP find(UUID id) { - return getDatabaseService().getQueryable(DMP.class).where((builder, root) -> builder.equal((root.get("id")), id)).getSingle(); - } + @Override + public DMP find(UUID id) { + return getDatabaseService().getQueryable(DMP.class).where((builder, root) -> builder.equal((root.get("id")), id)).getSingle(); + } - @Override - public QueryableList getUserDmps(DatasetWizardUserDmpCriteria datasetWizardUserDmpCriteria, UserInfo userInfo) { - QueryableList query = getDatabaseService().getQueryable(DMP.class).where((builder, root) -> builder.or(builder.equal(root.get("creator"), userInfo), builder.isMember(userInfo, root.get("users")))); - if (datasetWizardUserDmpCriteria.getLike() != null && !datasetWizardUserDmpCriteria.getLike().isEmpty()) { - query.where((builder, root) -> builder.like(root.get("label"), "%" + datasetWizardUserDmpCriteria.getLike() + "%")); - } - return query; - } + @Override + public QueryableList getUserDmps(DatasetWizardUserDmpCriteria datasetWizardUserDmpCriteria, UserInfo userInfo) { + QueryableList query = getDatabaseService().getQueryable(DMP.class).where((builder, root) -> builder.or(builder.equal(root.get("creator"), userInfo), builder.isMember(userInfo, root.get("users")))); + if (datasetWizardUserDmpCriteria.getLike() != null && !datasetWizardUserDmpCriteria.getLike().isEmpty()) { + query.where((builder, root) -> builder.like(root.get("label"), "%" + datasetWizardUserDmpCriteria.getLike() + "%")); + } + return query; + } - @Override - public void delete(DMP item) { - this.getDatabaseService().delete(item); - } + @Override + public void delete(DMP item) { + this.getDatabaseService().delete(item); + } - @Override - public QueryableList asQueryable() { - return this.getDatabaseService().getQueryable(DMP.class); - } + @Override + public QueryableList asQueryable() { + return this.getDatabaseService().getQueryable(DMP.class); + } - @Async - @Override - public CompletableFuture createOrUpdateAsync(DMP item) { - return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item)); - } + @Async + @Override + public CompletableFuture createOrUpdateAsync(DMP item) { + return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item)); + } - @Override - public DMP find(UUID id, String hint) { - throw new UnsupportedOperationException(); - } + @Override + public DMP find(UUID id, String hint) { + throw new UnsupportedOperationException(); + } } diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetDaoImpl.java index d996ea95e..841c2c08c 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetDaoImpl.java @@ -15,8 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; -import javax.persistence.criteria.Join; -import javax.persistence.criteria.JoinType; +import jakarta.persistence.criteria.Join; +import jakarta.persistence.criteria.JoinType; import java.util.Arrays; import java.util.Date; import java.util.List; @@ -52,7 +52,7 @@ public class DatasetDaoImpl extends DatabaseAccess implements DatasetDa if (criteria.getPeriodStart() != null) query.where((builder, root) -> builder.greaterThan(root.get("created"), criteria.getPeriodStart())); if (!criteria.getAllVersions()) - query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("dmp").get("version"), query.subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.and(builder1.equal(externalRoot.get("dmp").get("groupId"), nestedRoot.get("dmp").get("groupId")), builder1.notEqual(nestedRoot.get("dmp").get("status"), DMP.DMPStatus.DELETED.getValue())), Arrays.asList(new SelectionField(FieldSelectionType.COMPOSITE_FIELD, "dmp:version")), String.class))); + query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("dmp").get("version"), query.subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.and(builder1.equal(externalRoot.get("dmp").get("groupId"), nestedRoot.get("dmp").get("groupId")), builder1.notEqual(nestedRoot.get("dmp").get("status"), DMP.DMPStatus.DELETED.getValue())), Arrays.asList(new SelectionField(FieldSelectionType.COMPOSITE_FIELD, "dmp:version")), Integer.class))); if (criteria.getGroupIds() != null && !criteria.getGroupIds().isEmpty()) query.where((builder, root) -> root.get("dmp").get("groupId").in(criteria.getGroupIds())); if (criteria.getDmpIds() != null && !criteria.getDmpIds().isEmpty()) diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetProfileDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetProfileDaoImpl.java index 3ba9fe758..d0d77b877 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetProfileDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetProfileDaoImpl.java @@ -12,8 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; -import javax.persistence.criteria.Join; -import javax.persistence.criteria.JoinType; +import jakarta.persistence.criteria.Join; +import jakarta.persistence.criteria.JoinType; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -35,8 +35,8 @@ public class DatasetProfileDaoImpl extends DatabaseAccess i query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%")); if (!criteria.getAllVersions()) query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("version"), - query.subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.equal(externalRoot.get("groupId"), - nestedRoot.get("groupId")), Arrays.asList(new SelectionField(FieldSelectionType.FIELD, "version")), String.class))); + query.subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.equal(externalRoot.get("groupId"), + nestedRoot.get("groupId")), Arrays.asList(new SelectionField(FieldSelectionType.FIELD, "version")), Integer.class))); if (criteria.getGroupIds() != null && !criteria.getGroupIds().isEmpty()) query.where((builder, root) -> root.get("groupId").in(criteria.getGroupIds())); if (criteria.getFilter() != null && criteria.getUserId() != null) { diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DescriptionTemplateTypeDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DescriptionTemplateTypeDaoImpl.java index f93afb383..518332c01 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DescriptionTemplateTypeDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DescriptionTemplateTypeDaoImpl.java @@ -8,7 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.UUID; import java.util.concurrent.CompletableFuture; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/GrantDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/GrantDaoImpl.java index 84674491b..a148f3644 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/GrantDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/GrantDaoImpl.java @@ -13,7 +13,7 @@ import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; import schemasMicrosoftComOfficeOffice.LeftDocument; -import javax.persistence.criteria.JoinType; +import jakarta.persistence.criteria.JoinType; import java.util.Date; import java.util.UUID; import java.util.concurrent.CompletableFuture; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/OrganisationDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/OrganisationDaoImpl.java index 3892e7a04..82e6e7076 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/OrganisationDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/OrganisationDaoImpl.java @@ -11,7 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; -import javax.persistence.criteria.JoinType; +import jakarta.persistence.criteria.JoinType; import java.util.UUID; import java.util.concurrent.CompletableFuture; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ProjectDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ProjectDaoImpl.java index 935bfe9de..cc9afd444 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ProjectDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ProjectDaoImpl.java @@ -8,7 +8,7 @@ import eu.eudat.data.entities.UserInfo; import eu.eudat.queryable.QueryableList; import org.springframework.stereotype.Service; -import javax.persistence.criteria.JoinType; +import jakarta.persistence.criteria.JoinType; import java.util.UUID; import java.util.concurrent.CompletableFuture; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Content.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Content.java index bb08a574e..973ccbc80 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Content.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Content.java @@ -4,7 +4,7 @@ import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Credential.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Credential.java index ec6784281..69a5e2b46 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Credential.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Credential.java @@ -4,7 +4,7 @@ import eu.eudat.data.converters.DateToUTCConverter; import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.queryable.queryableentity.DataEntity; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.Date; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMP.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMP.java index 60277ead5..e982d74ec 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMP.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMP.java @@ -5,7 +5,7 @@ import eu.eudat.data.converters.DateToUTCConverter; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.*; import java.util.stream.Collectors; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPDatasetProfile.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPDatasetProfile.java index 816ec0410..358a886f4 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPDatasetProfile.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPDatasetProfile.java @@ -3,7 +3,7 @@ package eu.eudat.data.entities; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPOrganisation.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPOrganisation.java index f0c23604b..6cbd8d1a1 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPOrganisation.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPOrganisation.java @@ -3,7 +3,7 @@ package eu.eudat.data.entities; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.*; +import jakarta.persistence.*; import java.io.Serializable; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPProfile.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPProfile.java index ea48c196a..85261b21a 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPProfile.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPProfile.java @@ -7,7 +7,7 @@ import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.Date; import java.util.List; import java.util.Set; @@ -59,7 +59,7 @@ public class DMPProfile implements DataEntity { @Column(name = "\"Label\"") private String label; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true) private String definition; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPResearcher.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPResearcher.java index 5c3e7e11e..eb1f08108 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPResearcher.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DMPResearcher.java @@ -4,7 +4,7 @@ package eu.eudat.data.entities; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.UUID; @@ -18,11 +18,9 @@ public class DMPResearcher { @Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)") private UUID id; - @Type(type = "org.hibernate.type.PostgresUUIDType") @Column(name = "\"DMP\"") private UUID dmp; - @Type(type = "org.hibernate.type.PostgresUUIDType") @Column(name = "\"Researcher\"") private UUID researcher; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DataRepository.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DataRepository.java index 81ad45035..7f13aa58a 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DataRepository.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DataRepository.java @@ -5,7 +5,7 @@ import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.io.Serializable; import java.util.Date; import java.util.List; @@ -32,7 +32,7 @@ public class DataRepository implements Serializable, DataEntity { @Column(name = "\"Uri\"") private String uri; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Properties\"", columnDefinition = "xml") private String properties; @@ -115,7 +115,7 @@ public class Dataset implements DataEntity { @JoinColumn(name = "\"Profile\"") private DescriptionTemplate profile; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Reference\"", columnDefinition = "xml") private String reference; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetDataRepository.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetDataRepository.java index b99483a13..4142e4c02 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetDataRepository.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetDataRepository.java @@ -4,7 +4,7 @@ import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetExternalDataset.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetExternalDataset.java index dbcf75b4c..dbabee5ec 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetExternalDataset.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetExternalDataset.java @@ -4,7 +4,7 @@ import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetProfileRuleset.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetProfileRuleset.java index b235cf7d2..a97ba3a34 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetProfileRuleset.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetProfileRuleset.java @@ -4,7 +4,7 @@ package eu.eudat.data.entities; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.io.Serializable; import java.util.UUID; @@ -23,7 +23,7 @@ public class DatasetProfileRuleset { @Column(name = "\"Label\"") private String label; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false) private String definition; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetProfileViewstyle.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetProfileViewstyle.java index 03eac7b4c..1ffcfd7f2 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetProfileViewstyle.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetProfileViewstyle.java @@ -4,7 +4,7 @@ package eu.eudat.data.entities; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.UUID; @@ -23,7 +23,7 @@ public class DatasetProfileViewstyle { @Column(name = "\"Label\"") private String label; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false) private String definition; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetRegistry.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetRegistry.java index 271c2d685..1523db218 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetRegistry.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetRegistry.java @@ -4,7 +4,7 @@ package eu.eudat.data.entities; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.io.Serializable; import java.util.UUID; @@ -19,12 +19,11 @@ public class DatasetRegistry { @Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)") private UUID id; - - @Type(type = "org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL + //DEPWARN dependency to Hibernate and PostgreSQL @Column(name = "\"Dataset\"", nullable = false) private UUID dataset; - @Type(type = "org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL + //DEPWARN dependency to Hibernate and PostgreSQL @Column(name = "\"Registry\"", nullable = false) private UUID registry; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetService.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetService.java index 401c13cf4..c9c52999d 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetService.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetService.java @@ -4,7 +4,7 @@ package eu.eudat.data.entities; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DescriptionTemplate.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DescriptionTemplate.java index 958934c72..993fc155c 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DescriptionTemplate.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DescriptionTemplate.java @@ -6,7 +6,7 @@ import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.Date; import java.util.List; import java.util.Set; @@ -55,7 +55,7 @@ public class DescriptionTemplate implements DataEntity @OneToMany(fetch = FetchType.LAZY, mappedBy = "profile") private Set dataset; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false) private String definition; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DescriptionTemplateType.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DescriptionTemplateType.java index 40a755c2f..9b466f862 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DescriptionTemplateType.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DescriptionTemplateType.java @@ -3,7 +3,7 @@ package eu.eudat.data.entities; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/EmailConfirmation.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/EmailConfirmation.java index 9bbee2886..2f891c627 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/EmailConfirmation.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/EmailConfirmation.java @@ -4,7 +4,7 @@ import eu.eudat.data.converters.DateToUTCConverter; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.Date; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/EntityDoi.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/EntityDoi.java index a0b86c6c5..c153a7502 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/EntityDoi.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/EntityDoi.java @@ -5,7 +5,7 @@ import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.Arrays; import java.util.Date; import java.util.List; @@ -24,7 +24,6 @@ public class EntityDoi implements DataEntity { private UUID id; @Enumerated(EnumType.STRING) - @Type(type = "eu.eudat.configurations.typedefinition.PostgreSQLEnumType") @Column(name = "\"EntityType\"", nullable = false) private EntityType entityType; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/ExternalDataset.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/ExternalDataset.java index 199bacff3..42a322fa2 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/ExternalDataset.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/ExternalDataset.java @@ -5,7 +5,7 @@ import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.Date; import java.util.List; import java.util.Set; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/FileUpload.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/FileUpload.java index 394bebfe5..81204dfe4 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/FileUpload.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/FileUpload.java @@ -5,7 +5,7 @@ import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.Date; import java.util.List; import java.util.UUID; @@ -32,7 +32,6 @@ public class FileUpload implements DataEntity { private UUID entityId; @Enumerated(EnumType.STRING) - @Type(type = "eu.eudat.configurations.typedefinition.PostgreSQLEnumType") @Column(name = "\"EntityType\"", nullable = false) private EntityType entityType; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Funder.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Funder.java index d57e91136..8ccfa3b9a 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Funder.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Funder.java @@ -4,7 +4,7 @@ import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.Date; import java.util.List; import java.util.UUID; @@ -74,11 +74,11 @@ public class Funder implements DataEntity { @Column(name = "\"Label\"") private String label; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true) private String reference; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true) private String definition; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Grant.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Grant.java index fd5c77164..705748a21 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Grant.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Grant.java @@ -7,7 +7,7 @@ import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.*; import java.util.stream.Collectors; @@ -102,7 +102,7 @@ public class Grant implements DataEntity { @Column(name = "\"Uri\"") private String uri; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true) private String definition; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Invitation.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Invitation.java index 10ffc769b..015b50f62 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Invitation.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Invitation.java @@ -5,7 +5,7 @@ import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.List; import java.util.UUID; @@ -37,7 +37,7 @@ public class Invitation implements DataEntity { @Column(name = "\"AcceptedInvitation\"", nullable = false) private boolean acceptedInvitation; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Properties\"", columnDefinition = "xml", nullable = true) private String properties; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Lock.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Lock.java index 769ceff26..de4232f76 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Lock.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Lock.java @@ -5,7 +5,7 @@ import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.Date; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Notification.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Notification.java index 39eb094a8..65647f617 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Notification.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Notification.java @@ -7,7 +7,7 @@ import eu.eudat.data.enumeration.notification.NotifyState; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.Date; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Organisation.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Organisation.java index 94a8c8f33..0fa52bbac 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Organisation.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Organisation.java @@ -6,7 +6,7 @@ import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.io.Serializable; import java.util.Date; import java.util.List; @@ -35,14 +35,14 @@ public class Organisation implements Serializable, DataEntity @Column(name = "\"Abbreviation\"") private String abbreviation; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true) private String reference; @Column(name = "\"Uri\"") private String uri; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true) private String definition; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Project.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Project.java index 04c9d662c..6a815172f 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Project.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Project.java @@ -6,7 +6,7 @@ import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.*; import java.util.stream.Collectors; @@ -87,7 +87,7 @@ public class Project implements DataEntity { @Column(name = "\"Uri\"") private String uri; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true) private String definition; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Registry.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Registry.java index f1295d6ef..b61201bc8 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Registry.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Registry.java @@ -6,7 +6,7 @@ import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.Date; import java.util.List; import java.util.Set; @@ -33,7 +33,7 @@ public class Registry implements DataEntity { @Column(name = "\"Uri\"") private String uri; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true) private String definition; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Researcher.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Researcher.java index 0c5d853ba..f28f26394 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Researcher.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Researcher.java @@ -7,7 +7,7 @@ import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.Date; import java.util.List; import java.util.Set; @@ -33,11 +33,11 @@ public class Researcher implements DataEntity { @Column(name = "\"PrimaryEmail\"") private String primaryEmail; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true) private String definition; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true) private String reference; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Service.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Service.java index b3d43fba8..9f7b87144 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Service.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Service.java @@ -5,7 +5,7 @@ import eu.eudat.data.converters.DateToUTCConverter; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.Date; import java.util.List; import java.util.Set; @@ -32,7 +32,7 @@ public class Service implements DataEntity { @Column(name = "\"Uri\"") private String uri; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false) private String definition; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserDMP.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserDMP.java index 217b81821..060c83ad1 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserDMP.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserDMP.java @@ -4,7 +4,7 @@ import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.LinkedList; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserDatasetProfile.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserDatasetProfile.java index 4af7c2799..9369f0569 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserDatasetProfile.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserDatasetProfile.java @@ -4,7 +4,7 @@ import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserInfo.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserInfo.java index 7c243b3a5..18e4f9949 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserInfo.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserInfo.java @@ -6,7 +6,7 @@ import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Type; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.*; @@ -55,7 +55,7 @@ public class UserInfo implements DataEntity { private Date lastloggedin = null; - @Type(type = "eu.eudat.configurations.typedefinition.XMLType") + @Type(eu.eudat.configurations.typedefinition.XMLType.class) @Column(name = "additionalinfo", nullable = true) private String additionalinfo; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserRole.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserRole.java index 43633c237..1d00d08c4 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserRole.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserRole.java @@ -4,7 +4,7 @@ import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.queryable.queryableentity.DataEntity; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserToken.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserToken.java index ec49d0bbb..f668ebbee 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserToken.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/UserToken.java @@ -4,7 +4,7 @@ import eu.eudat.data.converters.DateToUTCConverter; import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.queryable.queryableentity.DataEntity; -import javax.persistence.*; +import jakarta.persistence.*; import java.util.Date; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/helpers/EntityBinder.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/helpers/EntityBinder.java index 775c17ce2..c640e6d42 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/helpers/EntityBinder.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/helpers/EntityBinder.java @@ -1,6 +1,6 @@ package eu.eudat.data.entities.helpers; -import javax.persistence.Tuple; +import jakarta.persistence.Tuple; import java.util.List; public class EntityBinder { diff --git a/dmp-backend/data/src/main/java/eu/eudat/query/DMPQuery.java b/dmp-backend/data/src/main/java/eu/eudat/query/DMPQuery.java index 0c96b700b..d47412e99 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/query/DMPQuery.java +++ b/dmp-backend/data/src/main/java/eu/eudat/query/DMPQuery.java @@ -9,7 +9,7 @@ import eu.eudat.queryable.QueryableList; import eu.eudat.queryable.types.FieldSelectionType; import eu.eudat.queryable.types.SelectionField; -import javax.persistence.criteria.Subquery; +import jakarta.persistence.criteria.Subquery; import java.util.Arrays; import java.util.Date; import java.util.List; diff --git a/dmp-backend/data/src/main/java/eu/eudat/query/DatasetQuery.java b/dmp-backend/data/src/main/java/eu/eudat/query/DatasetQuery.java index 7dce8d313..aecf08155 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/query/DatasetQuery.java +++ b/dmp-backend/data/src/main/java/eu/eudat/query/DatasetQuery.java @@ -7,7 +7,7 @@ import eu.eudat.queryable.QueryableList; import eu.eudat.queryable.types.FieldSelectionType; import eu.eudat.queryable.types.SelectionField; -import javax.persistence.criteria.Subquery; +import jakarta.persistence.criteria.Subquery; import java.util.Arrays; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/data/src/main/java/eu/eudat/query/GrantQuery.java b/dmp-backend/data/src/main/java/eu/eudat/query/GrantQuery.java index 9c19dfc4c..d48365036 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/query/GrantQuery.java +++ b/dmp-backend/data/src/main/java/eu/eudat/query/GrantQuery.java @@ -7,7 +7,7 @@ import eu.eudat.queryable.QueryableList; import eu.eudat.queryable.types.FieldSelectionType; import eu.eudat.queryable.types.SelectionField; -import javax.persistence.criteria.Subquery; +import jakarta.persistence.criteria.Subquery; import java.util.Arrays; import java.util.Date; import java.util.List; diff --git a/dmp-backend/data/src/main/java/eu/eudat/query/LockQuery.java b/dmp-backend/data/src/main/java/eu/eudat/query/LockQuery.java index b0f28676d..8f58687de 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/query/LockQuery.java +++ b/dmp-backend/data/src/main/java/eu/eudat/query/LockQuery.java @@ -7,7 +7,7 @@ import eu.eudat.queryable.QueryableList; import eu.eudat.queryable.types.FieldSelectionType; import eu.eudat.queryable.types.SelectionField; -import javax.persistence.criteria.Subquery; +import jakarta.persistence.criteria.Subquery; import java.util.Arrays; import java.util.Date; import java.util.List; diff --git a/dmp-backend/pom.xml b/dmp-backend/pom.xml index 56aad0165..5d693e51f 100644 --- a/dmp-backend/pom.xml +++ b/dmp-backend/pom.xml @@ -10,7 +10,7 @@ org.springframework.boot spring-boot-starter-parent - 2.5.2 + 3.1.2 @@ -18,36 +18,24 @@ web data elastic + core 1.19.0 1.19.0 0.2.0 - 1.8 + 17 0.0.1-SNAPSHOT - 5.3.8 - - 5.3.10.RELEASE - - - - - 5.5.3.Final 1.9 4.11 1.2.17 2.15.0 - 1.7.15 - - 1.2.3 - - + + 17 + 17 @@ -55,12 +43,11 @@ org.json json - 20160810 + 20230227 org.springframework spring-context-support - ${org.springframework.version} org.springframework.boot @@ -89,15 +76,13 @@ - org.apache.httpcomponents - httpclient - 4.5.12 + org.apache.httpcomponents.client5 + httpclient5 org.apache.httpcomponents httpcore-nio - 4.4.13 @@ -112,22 +97,20 @@ 7.6.0 - org.hibernate + org.hibernate.orm hibernate-core - ${hibernate.version} - org.hibernate + org.hibernate.orm hibernate-c3p0 - ${hibernate.version} com.google.api-client google-api-client - 1.23.0 + 1.35.2 @@ -141,7 +124,6 @@ com.fasterxml.jackson.dataformat jackson-dataformat-xml - 2.12.3 @@ -149,13 +131,16 @@ com.fasterxml.jackson.core jackson-core - 2.12.3 com.fasterxml.jackson.core jackson-databind - 2.12.3 + + + + com.fasterxml.jackson.module + jackson-module-jaxb-annotations @@ -173,13 +158,13 @@ org.apache.poi poi-ooxml - 4.1.1 + 4.1.2 org.apache.poi poi - 4.1.1 + 4.1.2 @@ -192,7 +177,7 @@ org.jsoup jsoup - 1.14.3 + 1.15.3 @@ -210,7 +195,7 @@ fr.opensagres.xdocreport fr.opensagres.xdocreport.itext.extension - 2.0.1 + 2.0.4 @@ -236,7 +221,7 @@ 2.8.2 --> - + javax.xml.bind jaxb-api @@ -247,62 +232,66 @@ org.glassfish.jaxb jaxb-core - 2.3.0 + 4.0.3 org.glassfish.jaxb jaxb-runtime - 2.3.1 + 4.0.3 - + - javax.annotation - javax.annotation-api - 1.3.1 + jakarta.annotation + jakarta.annotation-api - + - javax.validation - validation-api - 2.0.1.Final + jakarta.validation + jakarta.validation-api + + + + jakarta.persistence + jakarta.persistence-api + 3.1.0 - - - io.prometheus - simpleclient - 0.11.0 - - - - io.prometheus - simpleclient_hotspot - 0.11.0 - - - - io.prometheus - simpleclient_httpserver - 0.11.0 - - - - io.prometheus - simpleclient_pushgateway - 0.11.0 - + + + + + + + + + + + + + + + + + + + + + + + + io.micrometer micrometer-registry-prometheus - 1.7.1 + 1.11.2 org.springframework.boot @@ -314,8 +303,19 @@ micrometer-core - + + + gr.cite + data-tools + 2.1.0 + + + gr.cite + exceptions + 2.1.0 + + @@ -327,18 +327,17 @@ jar - - intellij-properties-launcher + + - - - org.springframework.boot - spring-boot-loader - 2.5.2 - - + + + + + + - + production diff --git a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/QueryableList.java b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/QueryableList.java index 9d36e802c..45858815a 100644 --- a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/QueryableList.java +++ b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/QueryableList.java @@ -4,9 +4,9 @@ import eu.eudat.queryable.jpa.predicates.*; import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.types.SelectionField; -import javax.persistence.criteria.Join; -import javax.persistence.criteria.JoinType; -import javax.persistence.criteria.Subquery; +import jakarta.persistence.criteria.Join; +import jakarta.persistence.criteria.JoinType; +import jakarta.persistence.criteria.Subquery; import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; diff --git a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/collector/Collector.java b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/collector/Collector.java index a6d710b11..e3b654418 100644 --- a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/collector/Collector.java +++ b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/collector/Collector.java @@ -2,7 +2,7 @@ package eu.eudat.queryable.collector; import com.fasterxml.jackson.databind.ObjectMapper; -import javax.persistence.Tuple; +import jakarta.persistence.Tuple; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; diff --git a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/collector/ProjectionField.java b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/collector/ProjectionField.java index d76e33c0c..96aff8a79 100644 --- a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/collector/ProjectionField.java +++ b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/collector/ProjectionField.java @@ -2,7 +2,7 @@ package eu.eudat.queryable.collector; import com.google.common.collect.Lists; -import javax.persistence.Tuple; +import jakarta.persistence.Tuple; import java.util.*; import java.util.stream.Collectors; diff --git a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/hibernatequeryablelist/QueryableHibernateList.java b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/hibernatequeryablelist/QueryableHibernateList.java index 54800f43a..0e46d9df5 100644 --- a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/hibernatequeryablelist/QueryableHibernateList.java +++ b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/hibernatequeryablelist/QueryableHibernateList.java @@ -8,500 +8,568 @@ import eu.eudat.queryable.jpa.predicates.*; import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.types.FieldSelectionType; import eu.eudat.queryable.types.SelectionField; +import jakarta.persistence.EntityManager; +import jakarta.persistence.Tuple; +import jakarta.persistence.TypedQuery; +import jakarta.persistence.criteria.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.scheduling.annotation.Async; -import javax.persistence.EntityManager; -import javax.persistence.Tuple; -import javax.persistence.TypedQuery; -import javax.persistence.criteria.*; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; public class QueryableHibernateList implements QueryableList { - private static final Logger logger = LoggerFactory.getLogger(QueryableHibernateList.class); - private Collector collector = new Collector(); - private EntityManager manager; - private CriteriaQuery query; - private Class tClass; - private Root root; - private Root nestedQueryRoot; - private Subquery subquery; - private List> singlePredicates = new LinkedList<>(); - private List> nestedPredicates = new LinkedList<>(); - private boolean distinct = false; - private List> orderings = new LinkedList<>(); - private List> groupings = new LinkedList<>(); - private List fields = new LinkedList<>(); - private Integer length; - private Integer offset; - private Set hints; - private String hint; - private Map joinsMap = new HashMap<>(); + private static final Logger logger = LoggerFactory.getLogger(QueryableHibernateList.class); - public QueryableHibernateList(EntityManager manager, Class tClass) { - this.manager = manager; - this.tClass = tClass; - } + private Collector collector = new Collector(); - public QueryableHibernateList setManager(EntityManager manager) { - this.manager = manager; - return this; - } + private EntityManager manager; - public QueryableList withHint(String hint) { - this.hint = hint; - return this; - } + private CriteriaQuery query; - @Override - public QueryableList withFields(List fields) { - this.fields = fields; - return this; - } + private Class tClass; - private QueryableList selectFields() { - List rootFields = fields.stream().map(this::convertFieldToPath).filter(Objects::nonNull).collect(Collectors.toList()); - this.query.select(this.manager.getCriteriaBuilder().tuple(rootFields.toArray(new Selection[rootFields.size()]))); - return this; - } + private Root root; - private Path convertFieldToPath(String field) { - if (!field.contains(".")) { - Path path = this.root.get(field); - path.alias(field); - return path; - } else { - String[] fields = field.split("\\."); - Path path = this.root.get(fields[0]); - Join join = null; - path.alias(fields[0]); - for (int i = 1; i < fields.length; i++) { - join = join != null ? join.join(fields[i - 1], JoinType.LEFT) : this.getJoin(fields[i - 1], JoinType.LEFT); - path = join.get(fields[i]); - path.alias(String.join(".", Arrays.asList(fields).subList(0, i + 1))); - } - return path; - } - } + private Root nestedQueryRoot; - private Join getJoin(String field, String path, Join joined, JoinType type) { - if (this.joinsMap.containsKey(path)) return this.joinsMap.get(path); - Join join = joined.join(path, type); - this.joinsMap.put(path, join); - return join; - } + private Subquery subquery; - public Join getJoin(String field, JoinType type) { - if (this.joinsMap.containsKey(field)) return this.joinsMap.get(field); - Join join = this.root.join(field, type); - this.joinsMap.put(field, join); - return join; - } + private List> singlePredicates = new LinkedList<>(); - public QueryableHibernateList setEntity(Class type) { + private List> nestedPredicates = new LinkedList<>(); - return this; - } + private boolean distinct = false; - public void initiateQueryableList(Class type) { - CriteriaBuilder builder = this.manager.getCriteriaBuilder(); - this.query = builder.createQuery(type); - } + private List> orderings = new LinkedList<>(); - @Override - public QueryableList skip(Integer offset) { - this.offset = offset; - return this; - } + private List> groupings = new LinkedList<>(); - @Override - public QueryableList take(Integer length) { - this.length = length; - return this; - } + private List fields = new LinkedList<>(); - public QueryableList where(SinglePredicate predicate) { - this.singlePredicates.add(predicate); - return this; - } + private Integer length; - public QueryableList where(NestedQuerySinglePredicate predicate) { - this.nestedPredicates.add(predicate); - return this; - } + private Integer offset; - public List select(SelectPredicate predicate) { - return this.toList().stream().map(predicate::applySelection).collect(Collectors.toList()); - } + private Set hints; - public CompletableFuture> selectAsync(SelectPredicate predicate) { - return this.toListAsync().thenApplyAsync(items -> items.stream().map(predicate::applySelection).collect(Collectors.toList())); - } + private String hint; - public QueryableList distinct() { - this.distinct = true; - return this; - } + private Map joinsMap = new HashMap<>(); - public QueryableList orderBy(OrderByPredicate predicate) { - this.orderings.add(predicate); - return this; - } + public QueryableHibernateList(EntityManager manager, Class tClass) { + this.manager = manager; + this.tClass = tClass; + } - public QueryableList groupBy(GroupByPredicate predicate) { - this.groupings.add(predicate); - return this; - } + public QueryableHibernateList setManager(EntityManager manager) { + this.manager = manager; + return this; + } - public Long count() { - CriteriaBuilder criteriaBuilder = this.manager.getCriteriaBuilder(); - CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Long.class); - this.root = criteriaQuery.from(tClass); - if (distinct) criteriaQuery.select(criteriaBuilder.countDistinct(this.root.get("id"))); - else criteriaQuery.select(criteriaBuilder.count(this.root)); - criteriaQuery.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); - if (!this.groupings.isEmpty()) criteriaQuery.groupBy(this.generateGroupPredicates(this.groupings, this.root)); - //if (distinct) criteriaQuery.distinct(true); + public QueryableList withHint(String hint) { + this.hint = hint; + return this; + } - //GK: Group By special case. When group by is used, since it will result in a list of how many elements have the grouped field common - // then it will instead return the number of the distinct values of the grouped field - if (this.groupings.isEmpty()) { - return this.manager.createQuery(criteriaQuery).getSingleResult(); - } else { - return (long) this.manager.createQuery(criteriaQuery).getResultList().size(); - } - } + @Override + public QueryableList withFields(List fields) { + this.fields = fields; + return this; + } - @Async - public CompletableFuture countAsync() { - CriteriaBuilder criteriaBuilder = this.manager.getCriteriaBuilder(); - CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Long.class); - this.root = criteriaQuery.from(tClass); - if (distinct) criteriaQuery.select(criteriaBuilder.countDistinct(this.root.get("id"))); - else criteriaQuery.select(criteriaBuilder.count(this.root)); - criteriaQuery.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); - if (!this.groupings.isEmpty()) criteriaQuery.groupBy(this.generateGroupPredicates(this.groupings, this.root)); - //if (distinct) criteriaQuery.distinct(true); - return CompletableFuture.supplyAsync(() -> { - if (this.groupings.isEmpty()) { - return this.manager.createQuery(criteriaQuery).getSingleResult(); - } else { - return (long) this.manager.createQuery(criteriaQuery).getResultList().size(); - } - }); - } + private QueryableList selectFields() { + List rootFields = fields.stream().map(this::convertFieldToPath).filter(Objects::nonNull).collect(Collectors.toList()); + this.query.select(this.manager.getCriteriaBuilder().tuple(rootFields.toArray(new Selection[rootFields.size()]))); + return this; + } + private Path convertFieldToPath(String field) { + if (!field.contains(".")) { + Path path = this.root.get(field); + path.alias(field); + return path; + } else { + String[] fields = field.split("\\."); + Path path = this.root.get(fields[0]); + Join join = null; + path.alias(fields[0]); + for (int i = 1; i < fields.length; i++) { + join = join != null ? join.join(fields[i - 1], JoinType.LEFT) : this.getJoin(fields[i - 1], JoinType.LEFT); + path = join.get(fields[i]); + path.alias(String.join(".", Arrays.asList(fields).subList(0, i + 1))); + } + return path; + } + } - private Predicate[] generateWherePredicates(List> singlePredicates, Root root, List> nestedPredicates, Root nestedQueryRoot) { - List predicates = new LinkedList<>(); - predicates.addAll(Arrays.asList(this.generateSingleWherePredicates(singlePredicates, root))); - predicates.addAll(Arrays.asList(this.generateNestedWherePredicates(nestedPredicates, root, nestedQueryRoot))); - return predicates.toArray(new Predicate[predicates.size()]); - } + private Join getJoin(String field, String path, Join joined, JoinType type) { + if (this.joinsMap.containsKey(path)) + return this.joinsMap.get(path); + Join join = joined.join(path, type); + this.joinsMap.put(path, join); + return join; + } - private Predicate[] generateSingleWherePredicates(List> singlePredicates, Root root) { - List predicates = new LinkedList<>(); - for (SinglePredicate singlePredicate : singlePredicates) { - predicates.add(singlePredicate.applyPredicate(this.manager.getCriteriaBuilder(), root)); - } - return predicates.toArray(new Predicate[predicates.size()]); - } + public Join getJoin(String field, JoinType type) { + if (this.joinsMap.containsKey(field)) + return this.joinsMap.get(field); + Join join = this.root.join(field, type); + this.joinsMap.put(field, join); + return join; + } - private Predicate[] generateNestedWherePredicates(List> nestedPredicates, Root root, Root nestedQueryRoot) { - List predicates = new LinkedList<>(); - for (NestedQuerySinglePredicate singlePredicate : nestedPredicates) { - predicates.add(singlePredicate.applyPredicate(this.manager.getCriteriaBuilder(), root, nestedQueryRoot)); - } - return predicates.toArray(new Predicate[predicates.size()]); - } + public QueryableHibernateList setEntity(Class type) { - private Order[] generateOrderPredicates(List> orderByPredicates, Root root) { - List predicates = new LinkedList<>(); - for (OrderByPredicate orderPredicate : orderByPredicates) { - predicates.add(orderPredicate.applyPredicate(this.manager.getCriteriaBuilder(), root)); - } - return predicates.toArray(new Order[predicates.size()]); - } + return this; + } - private Expression[] generateGroupPredicates(List> groupByPredicates, Root root) { - List predicates = new LinkedList<>(); - for (GroupByPredicate groupPredicate : groupByPredicates) { - predicates.add(groupPredicate.applyPredicate(this.manager.getCriteriaBuilder(), root)); - } - return predicates.toArray(new Expression[predicates.size()]); - } + public void initiateQueryableList(Class type) { + CriteriaBuilder builder = this.manager.getCriteriaBuilder(); + this.query = builder.createQuery(type); + } - public List toList() { - CriteriaBuilder builder = this.manager.getCriteriaBuilder(); - if (!this.fields.isEmpty()) this.query = builder.createTupleQuery(); - else this.query = builder.createQuery(this.tClass); - this.root = this.query.from(this.tClass); - this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); - if (!this.orderings.isEmpty()) this.query.orderBy(this.generateOrderPredicates(this.orderings, this.root)); - if (!this.groupings.isEmpty()) this.query.groupBy(this.generateGroupPredicates(this.groupings, this.root)); - if (!this.fields.isEmpty()) this.selectFields(); - if (distinct) this.query.distinct(true); - //if (!this.fields.isEmpty()) this.query.multiselect(this.parseFields(this.fields)); - ObjectMapper mapper = new ObjectMapper(); - if (!this.fields.isEmpty()) return this.toListWithFields().stream().map(m -> mapper.convertValue(m, this.tClass)).collect(Collectors.toList()); - return this.toListWithOutFields(); - } + @Override + public QueryableList skip(Integer offset) { + this.offset = offset; + return this; + } - public List toListWithFields() { - TypedQuery typedQuery = this.manager.createQuery(this.query); - if (this.offset != null) typedQuery.setFirstResult(this.offset); - if (this.length != null) typedQuery.setMaxResults(this.length); - List results = typedQuery.getResultList(); - Map> groupedResults = results.stream() - .collect(Collectors.groupingBy(x -> x.get("id"))); - return this.collector.buildFromTuple(results, groupedResults, this.fields, "id"); - } + @Override + public QueryableList take(Integer length) { + this.length = length; + return this; + } - private List toListWithOutFields() { - TypedQuery typedQuery = this.manager.createQuery(this.query); - if (this.offset != null) typedQuery.setFirstResult(this.offset); - if (this.length != null) typedQuery.setMaxResults(this.length); - if (this.hint != null) { - List ids = typedQuery.getResultList().stream().map(item -> item.getKeys()).collect(Collectors.toList()); - if (ids != null && !ids.isEmpty()) typedQuery = queryWithHint(ids); - } - return typedQuery.getResultList(); - } + public QueryableList where(SinglePredicate predicate) { + this.singlePredicates.add(predicate); + return this; + } - @Async - public CompletableFuture> toListAsync() { - CriteriaBuilder builder = this.manager.getCriteriaBuilder(); - if (!this.fields.isEmpty()) this.query = builder.createTupleQuery(); - else this.query = builder.createQuery(this.tClass); - this.root = this.query.from(this.tClass); - this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); - if (!this.orderings.isEmpty()) this.query.orderBy(this.generateOrderPredicates(this.orderings, this.root)); - if (!this.groupings.isEmpty()) this.query.groupBy(this.generateGroupPredicates(this.groupings, this.root)); - if (!this.fields.isEmpty()) this.selectFields(); - if (distinct) this.query.distinct(true); - if (!this.fields.isEmpty()) return this.toListAsyncWithFields(); - else return this.toListAsyncWithOutFields(); - } + public QueryableList where(NestedQuerySinglePredicate predicate) { + this.nestedPredicates.add(predicate); + return this; + } - @Async - private CompletableFuture> toListAsyncWithFields() { - List results = this.manager.createQuery(query).getResultList(); - Map> groupedResults = results.stream() - .collect(Collectors.groupingBy(x -> x.get("id"))); - return CompletableFuture.supplyAsync(() -> results.stream().map(x -> { - try { - return (T) this.tClass.newInstance().buildFromTuple(groupedResults.get(x.get("id")), this.fields, ""); - } catch (InstantiationException | IllegalAccessException e) { - logger.error(e.getMessage(), e); - } - return null; - }).collect(Collectors.toList())); - } + public List select(SelectPredicate predicate) { + return this.toList().stream().map(predicate::applySelection).collect(Collectors.toList()); + } - @Async - private CompletableFuture> toListAsyncWithOutFields() { - TypedQuery typedQuery = this.manager.createQuery(this.query); - if (this.offset != null) typedQuery.setFirstResult(this.offset); - if (this.length != null) typedQuery.setMaxResults(this.length); - return CompletableFuture.supplyAsync(() -> { - if (this.hint != null) { - List ids = typedQuery.getResultList().stream().map(item -> item.getKeys()).collect(Collectors.toList()); - if (ids != null && !ids.isEmpty()) return queryWithHint(ids).getResultList(); - } - return typedQuery.getResultList(); - }); - } + public CompletableFuture> selectAsync(SelectPredicate predicate) { + return this.toListAsync().thenApplyAsync(items -> items.stream().map(predicate::applySelection).collect(Collectors.toList())); + } - public T getSingle() { - CriteriaBuilder builder = this.manager.getCriteriaBuilder(); - if (!this.fields.isEmpty()) this.query = builder.createTupleQuery(); - else this.query = builder.createQuery(this.tClass); - this.root = this.query.from(this.tClass); - this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); - if (!this.fields.isEmpty()) this.selectFields(); - TypedQuery typedQuery = this.manager.createQuery(this.query); - if (this.hint != null) - typedQuery.setHint("javax.persistence.fetchgraph", this.manager.getEntityGraph(this.hint)); - return typedQuery.getSingleResult(); - } + public QueryableList distinct() { + this.distinct = true; + return this; + } - @Async - public CompletableFuture getSingleAsync() { - CriteriaBuilder builder = this.manager.getCriteriaBuilder(); - if (!this.fields.isEmpty()) this.query = builder.createTupleQuery(); - else this.query = builder.createQuery(this.tClass); - this.root = this.query.from(this.tClass); - this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); - if (!this.fields.isEmpty()) this.selectFields(); - TypedQuery typedQuery = this.manager.createQuery(this.query); - if (this.hint != null) - typedQuery.setHint("javax.persistence.fetchgraph", this.manager.getEntityGraph(this.hint)); - return CompletableFuture.supplyAsync(() -> typedQuery.getSingleResult()); - } + public QueryableList orderBy(OrderByPredicate predicate) { + this.orderings.add(predicate); + return this; + } - public T getSingleOrDefault() { - CriteriaBuilder builder = this.manager.getCriteriaBuilder(); - if (!this.fields.isEmpty()) this.query = builder.createTupleQuery(); - else this.query = builder.createQuery(this.tClass); - this.root = this.query.from(this.tClass); - this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); - if (!this.fields.isEmpty()) this.selectFields(); - TypedQuery typedQuery = this.manager.createQuery(this.query); - if (this.hint != null) - typedQuery.setHint("javax.persistence.fetchgraph", this.manager.getEntityGraph(this.hint)); - List results = typedQuery.getResultList(); - if (results.size() == 0) return null; - if (results.size() == 1) return results.get(0); - else throw new NotSingleResultException("Query returned more than one items"); - } + public QueryableList groupBy(GroupByPredicate predicate) { + this.groupings.add(predicate); + return this; + } - @Async - public CompletableFuture getSingleOrDefaultAsync() { - CriteriaBuilder builder = this.manager.getCriteriaBuilder(); - if (!this.fields.isEmpty()) this.query = builder.createTupleQuery(); - else this.query = builder.createQuery(this.tClass); - this.root = this.query.from(this.tClass); - this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); - if (!this.fields.isEmpty()) this.selectFields(); - TypedQuery typedQuery = this.manager.createQuery(this.query); - if (this.hint != null) - typedQuery.setHint("javax.persistence.fetchgraph", this.manager.getEntityGraph(this.hint)); - return CompletableFuture.supplyAsync(() -> typedQuery.getResultList()).thenApply(list -> { - if (list.size() == 0) return null; - if (list.size() == 1) return list.get(0); - else throw new NotSingleResultException("Query returned more than one items"); - }); - } + public Long count() { + CriteriaBuilder criteriaBuilder = this.manager.getCriteriaBuilder(); + CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Long.class); + this.root = criteriaQuery.from(tClass); + if (distinct) + criteriaQuery.select(criteriaBuilder.countDistinct(this.root.get("id"))); + else + criteriaQuery.select(criteriaBuilder.count(this.root)); + criteriaQuery.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); + if (!this.groupings.isEmpty()) + criteriaQuery.groupBy(this.generateGroupPredicates(this.groupings, this.root)); + //if (distinct) criteriaQuery.distinct(true); - private TypedQuery queryWithHint(List ids) { - CriteriaBuilder criteriaBuilder = this.manager.getCriteriaBuilder(); - CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(tClass); - Root criteriaRoot = criteriaQuery.from(this.tClass); - criteriaQuery.where(criteriaRoot.get("id").in(ids)); - if (!this.orderings.isEmpty()) - criteriaQuery.orderBy(this.generateOrderPredicates(this.orderings, criteriaRoot)); + //GK: Group By special case. When group by is used, since it will result in a list of how many elements have the grouped field common + // then it will instead return the number of the distinct values of the grouped field + if (this.groupings.isEmpty()) { + return this.manager.createQuery(criteriaQuery).getSingleResult(); + } else { + return (long) this.manager.createQuery(criteriaQuery).getResultList().size(); + } + } - if (!this.groupings.isEmpty()) criteriaQuery.groupBy(this.generateGroupPredicates(this.groupings, this.root)); + @Async + public CompletableFuture countAsync() { + CriteriaBuilder criteriaBuilder = this.manager.getCriteriaBuilder(); + CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Long.class); + this.root = criteriaQuery.from(tClass); + if (distinct) + criteriaQuery.select(criteriaBuilder.countDistinct(this.root.get("id"))); + else + criteriaQuery.select(criteriaBuilder.count(this.root)); + criteriaQuery.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); + if (!this.groupings.isEmpty()) + criteriaQuery.groupBy(this.generateGroupPredicates(this.groupings, this.root)); + //if (distinct) criteriaQuery.distinct(true); + return CompletableFuture.supplyAsync(() -> { + if (this.groupings.isEmpty()) { + return this.manager.createQuery(criteriaQuery).getSingleResult(); + } else { + return (long) this.manager.createQuery(criteriaQuery).getResultList().size(); + } + }); + } - TypedQuery typedQuery = this.manager.createQuery(criteriaQuery); - typedQuery.setHint("javax.persistence.fetchgraph", this.manager.getEntityGraph(this.hint)); - return typedQuery; - } + private Predicate[] generateWherePredicates(List> singlePredicates, Root root, List> nestedPredicates, Root nestedQueryRoot) { + List predicates = new LinkedList<>(); + predicates.addAll(Arrays.asList(this.generateSingleWherePredicates(singlePredicates, root))); + predicates.addAll(Arrays.asList(this.generateNestedWherePredicates(nestedPredicates, root, nestedQueryRoot))); + return predicates.toArray(new Predicate[predicates.size()]); + } - @Override - public Subquery subQuery(SinglePredicate predicate, List fields) { - Subquery subquery = this.manager.getCriteriaBuilder().createQuery().subquery(this.tClass); - this.nestedQueryRoot = subquery.from(this.tClass); - subquery.where(predicate.applyPredicate(this.manager.getCriteriaBuilder(), this.nestedQueryRoot)); - if (fields.get(0).getType() == FieldSelectionType.FIELD) - subquery.select(this.nestedQueryRoot.get(fields.get(0).getField())); - else if (fields.get(0).getType() == FieldSelectionType.COMPOSITE_FIELD) { - subquery.select(this.nestedQueryRoot.join(fields.get(0).getField().split(":")[0]).get(fields.get(0).getField().split(":")[1])); - } - return subquery; - } + private Predicate[] generateSingleWherePredicates(List> singlePredicates, Root root) { + List predicates = new LinkedList<>(); + for (SinglePredicate singlePredicate : singlePredicates) { + predicates.add(singlePredicate.applyPredicate(this.manager.getCriteriaBuilder(), root)); + } + return predicates.toArray(new Predicate[predicates.size()]); + } - @Override - public Subquery subQuery(NestedQuerySinglePredicate predicate, List fields) { - Subquery subquery = this.manager.getCriteriaBuilder().createQuery().subquery(this.tClass); - this.nestedQueryRoot = subquery.from(this.tClass); - subquery.where(predicate.applyPredicate(this.manager.getCriteriaBuilder(), this.root, this.nestedQueryRoot)); - if (fields.get(0).getType() == FieldSelectionType.FIELD) - subquery.select(this.nestedQueryRoot.get(fields.get(0).getField())); - else if (fields.get(0).getType() == FieldSelectionType.COMPOSITE_FIELD) { - subquery.select(this.nestedQueryRoot.get(fields.get(0).getField().split(":")[0]).get(fields.get(0).getField().split(":")[1])); - } - return subquery; - } + private Predicate[] generateNestedWherePredicates(List> nestedPredicates, Root root, Root nestedQueryRoot) { + List predicates = new LinkedList<>(); + for (NestedQuerySinglePredicate singlePredicate : nestedPredicates) { + predicates.add(singlePredicate.applyPredicate(this.manager.getCriteriaBuilder(), root, nestedQueryRoot)); + } + return predicates.toArray(new Predicate[predicates.size()]); + } - @Override - public Subquery subQueryCount(SinglePredicate predicate, List fields) { - Subquery subquery = this.manager.getCriteriaBuilder().createQuery().subquery(Long.class); - this.nestedQueryRoot = subquery.from(this.tClass); - subquery.where(predicate.applyPredicate(this.manager.getCriteriaBuilder(), this.nestedQueryRoot)); - subquery.select(this.manager.getCriteriaBuilder().count(this.nestedQueryRoot.get(fields.get(0).getField()))); - return subquery; - } + private Order[] generateOrderPredicates(List> orderByPredicates, Root root) { + List predicates = new LinkedList<>(); + for (OrderByPredicate orderPredicate : orderByPredicates) { + predicates.add(orderPredicate.applyPredicate(this.manager.getCriteriaBuilder(), root)); + } + return predicates.toArray(new Order[predicates.size()]); + } - @Override - public Subquery subQueryCount(NestedQuerySinglePredicate predicate, List fields) { - Subquery subquery = this.manager.getCriteriaBuilder().createQuery().subquery(Long.class); - this.nestedQueryRoot = subquery.from(this.tClass); - subquery.where(predicate.applyPredicate(this.manager.getCriteriaBuilder(), this.root, this.nestedQueryRoot)); - subquery.select(this.manager.getCriteriaBuilder().count(this.nestedQueryRoot.get(fields.get(0).getField()))); - return subquery; - } + private Expression[] generateGroupPredicates(List> groupByPredicates, Root root) { + List predicates = new LinkedList<>(); + for (GroupByPredicate groupPredicate : groupByPredicates) { + predicates.add(groupPredicate.applyPredicate(this.manager.getCriteriaBuilder(), root)); + } + return predicates.toArray(new Expression[predicates.size()]); + } - @Override - public Subquery subQueryMax(SinglePredicate predicate, List fields, Class uClass) { - Subquery subquery = this.manager.getCriteriaBuilder().createQuery().subquery(uClass); - this.nestedQueryRoot = subquery.from(this.tClass); - subquery.where(predicate.applyPredicate(this.manager.getCriteriaBuilder(), this.nestedQueryRoot)); - if (fields.get(0).getType() == FieldSelectionType.FIELD) - subquery.select(this.manager.getCriteriaBuilder().greatest(this.nestedQueryRoot.get(fields.get(0).getField()))); - else if (fields.get(0).getType() == FieldSelectionType.COMPOSITE_FIELD) { - subquery.select(this.manager.getCriteriaBuilder().greatest(this.nestedQueryRoot.get(fields.get(0).getField().split(":")[0]).get(fields.get(0).getField().split(":")[1]))); - } - return subquery; - } + public List toList() { + CriteriaBuilder builder = this.manager.getCriteriaBuilder(); + if (!this.fields.isEmpty()) + this.query = builder.createTupleQuery(); + else + this.query = builder.createQuery(this.tClass); + this.root = this.query.from(this.tClass); + this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); + if (!this.orderings.isEmpty()) + this.query.orderBy(this.generateOrderPredicates(this.orderings, this.root)); + if (!this.groupings.isEmpty()) + this.query.groupBy(this.generateGroupPredicates(this.groupings, this.root)); + if (!this.fields.isEmpty()) + this.selectFields(); + if (distinct) + this.query.distinct(true); + //if (!this.fields.isEmpty()) this.query.multiselect(this.parseFields(this.fields)); + ObjectMapper mapper = new ObjectMapper(); + if (!this.fields.isEmpty()) + return this.toListWithFields().stream().map(m -> mapper.convertValue(m, this.tClass)).collect(Collectors.toList()); + return this.toListWithOutFields(); + } - @Override - public Subquery subQueryMax(NestedQuerySinglePredicate predicate, List fields, Class uClass) { - //Subquery subquery = this.manager.getCriteriaBuilder().createQuery().subquery(uClass); - //this.nestedQueryRoot = subquery.from(this.tClass); - subquery.where(predicate.applyPredicate(this.manager.getCriteriaBuilder(), this.root, this.nestedQueryRoot)); - if (fields.get(0).getType() == FieldSelectionType.FIELD) - subquery.select(this.manager.getCriteriaBuilder().greatest(this.nestedQueryRoot.get(fields.get(0).getField()))); - else if (fields.get(0).getType() == FieldSelectionType.COMPOSITE_FIELD) { - subquery.select(this.manager.getCriteriaBuilder().greatest(this.nestedQueryRoot.get(fields.get(0).getField().split(":")[0]).get(fields.get(0).getField().split(":")[1]))); - } - return subquery; - } + public List toListWithFields() { + TypedQuery typedQuery = this.manager.createQuery(this.query); + if (this.offset != null) + typedQuery.setFirstResult(this.offset); + if (this.length != null) + typedQuery.setMaxResults(this.length); + List results = typedQuery.getResultList(); + Map> groupedResults = results.stream() + .collect(Collectors.groupingBy(x -> x.get("id"))); + return this.collector.buildFromTuple(results, groupedResults, this.fields, "id"); + } - public QueryableList initSubQuery(Class uClass) { - this.subquery = this.manager.getCriteriaBuilder().createQuery().subquery(uClass); - this.nestedQueryRoot = subquery.from(this.tClass); - return this; - } + private List toListWithOutFields() { + TypedQuery typedQuery = this.manager.createQuery(this.query); + if (this.offset != null) + typedQuery.setFirstResult(this.offset); + if (this.length != null) + typedQuery.setMaxResults(this.length); + if (this.hint != null) { + List ids = typedQuery.getResultList().stream().map(item -> item.getKeys()).collect(Collectors.toList()); + if (ids != null && !ids.isEmpty()) + typedQuery = queryWithHint(ids); + } + return typedQuery.getResultList(); + } - @Override - public Subquery query(List fields) { - CriteriaBuilder builder = this.manager.getCriteriaBuilder(); - Subquery query = builder.createQuery().subquery(this.tClass); - this.root = query.from(this.tClass); - query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); - if (fields.get(0).getType() == FieldSelectionType.FIELD) - query.select(this.root.get(fields.get(0).getField())); - else if (fields.get(0).getType() == FieldSelectionType.COMPOSITE_FIELD) { - query.select(this.root.get(fields.get(0).getField().split(":")[0]).get(fields.get(0).getField().split(":")[1])); - } - if (distinct) query.distinct(true); - return query; - } + @Async + public CompletableFuture> toListAsync() { + CriteriaBuilder builder = this.manager.getCriteriaBuilder(); + if (!this.fields.isEmpty()) + this.query = builder.createTupleQuery(); + else + this.query = builder.createQuery(this.tClass); + this.root = this.query.from(this.tClass); + this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); + if (!this.orderings.isEmpty()) + this.query.orderBy(this.generateOrderPredicates(this.orderings, this.root)); + if (!this.groupings.isEmpty()) + this.query.groupBy(this.generateGroupPredicates(this.groupings, this.root)); + if (!this.fields.isEmpty()) + this.selectFields(); + if (distinct) + this.query.distinct(true); + if (!this.fields.isEmpty()) + return this.toListAsyncWithFields(); + else + return this.toListAsyncWithOutFields(); + } - @Override - public void update(EntitySelectPredicate selectPredicate, V value) { - CriteriaBuilder builder = this.manager - .getCriteriaBuilder(); - CriteriaUpdate update = builder - .createCriteriaUpdate(tClass); - this.root = update.from(tClass); - update.set(selectPredicate.applyPredicate(root), value) - .where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); - this.manager - .createQuery(update) - .executeUpdate(); - } + @Async + private CompletableFuture> toListAsyncWithFields() { + List results = this.manager.createQuery(query).getResultList(); + Map> groupedResults = results.stream() + .collect(Collectors.groupingBy(x -> x.get("id"))); + return CompletableFuture.supplyAsync(() -> results.stream().map(x -> { + try { + return (T) this.tClass.newInstance().buildFromTuple(groupedResults.get(x.get("id")), this.fields, ""); + } catch (InstantiationException | IllegalAccessException e) { + logger.error(e.getMessage(), e); + } + return null; + }).collect(Collectors.toList())); + } - private Path[] parseFields(List selectedFields) { - List paths = new ArrayList<>(); - selectedFields.forEach(s -> paths.add(root.get(s))); + @Async + private CompletableFuture> toListAsyncWithOutFields() { + TypedQuery typedQuery = this.manager.createQuery(this.query); + if (this.offset != null) + typedQuery.setFirstResult(this.offset); + if (this.length != null) + typedQuery.setMaxResults(this.length); + return CompletableFuture.supplyAsync(() -> { + if (this.hint != null) { + List ids = typedQuery.getResultList().stream().map(item -> item.getKeys()).collect(Collectors.toList()); + if (ids != null && !ids.isEmpty()) + return queryWithHint(ids).getResultList(); + } + return typedQuery.getResultList(); + }); + } - return paths.toArray(new Path[0]); - } + public T getSingle() { + CriteriaBuilder builder = this.manager.getCriteriaBuilder(); + if (!this.fields.isEmpty()) + this.query = builder.createTupleQuery(); + else + this.query = builder.createQuery(this.tClass); + this.root = this.query.from(this.tClass); + this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); + if (!this.fields.isEmpty()) + this.selectFields(); + TypedQuery typedQuery = this.manager.createQuery(this.query); + if (this.hint != null) + typedQuery.setHint("jakarta.persistence.fetchgraph", this.manager.getEntityGraph(this.hint)); + return typedQuery.getSingleResult(); + } + + @Async + public CompletableFuture getSingleAsync() { + CriteriaBuilder builder = this.manager.getCriteriaBuilder(); + if (!this.fields.isEmpty()) + this.query = builder.createTupleQuery(); + else + this.query = builder.createQuery(this.tClass); + this.root = this.query.from(this.tClass); + this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); + if (!this.fields.isEmpty()) + this.selectFields(); + TypedQuery typedQuery = this.manager.createQuery(this.query); + if (this.hint != null) + typedQuery.setHint("jakarta.persistence.fetchgraph", this.manager.getEntityGraph(this.hint)); + return CompletableFuture.supplyAsync(() -> typedQuery.getSingleResult()); + } + + public T getSingleOrDefault() { + CriteriaBuilder builder = this.manager.getCriteriaBuilder(); + if (!this.fields.isEmpty()) + this.query = builder.createTupleQuery(); + else + this.query = builder.createQuery(this.tClass); + this.root = this.query.from(this.tClass); + this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); + if (!this.fields.isEmpty()) + this.selectFields(); + TypedQuery typedQuery = this.manager.createQuery(this.query); + if (this.hint != null) + typedQuery.setHint("jakarta.persistence.fetchgraph", this.manager.getEntityGraph(this.hint)); + List results = typedQuery.getResultList(); + if (results.size() == 0) + return null; + if (results.size() == 1) + return results.get(0); + else + throw new NotSingleResultException("Query returned more than one items"); + } + + @Async + public CompletableFuture getSingleOrDefaultAsync() { + CriteriaBuilder builder = this.manager.getCriteriaBuilder(); + if (!this.fields.isEmpty()) + this.query = builder.createTupleQuery(); + else + this.query = builder.createQuery(this.tClass); + this.root = this.query.from(this.tClass); + this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); + if (!this.fields.isEmpty()) + this.selectFields(); + TypedQuery typedQuery = this.manager.createQuery(this.query); + if (this.hint != null) + typedQuery.setHint("jakarta.persistence.fetchgraph", this.manager.getEntityGraph(this.hint)); + return CompletableFuture.supplyAsync(() -> typedQuery.getResultList()).thenApply(list -> { + if (list.size() == 0) + return null; + if (list.size() == 1) + return list.get(0); + else + throw new NotSingleResultException("Query returned more than one items"); + }); + } + + private TypedQuery queryWithHint(List ids) { + CriteriaBuilder criteriaBuilder = this.manager.getCriteriaBuilder(); + CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(tClass); + Root criteriaRoot = criteriaQuery.from(this.tClass); + criteriaQuery.where(criteriaRoot.get("id").in(ids)); + if (!this.orderings.isEmpty()) + criteriaQuery.orderBy(this.generateOrderPredicates(this.orderings, criteriaRoot)); + + if (!this.groupings.isEmpty()) + criteriaQuery.groupBy(this.generateGroupPredicates(this.groupings, this.root)); + + TypedQuery typedQuery = this.manager.createQuery(criteriaQuery); + typedQuery.setHint("jakarta.persistence.fetchgraph", this.manager.getEntityGraph(this.hint)); + return typedQuery; + } + + @Override + public Subquery subQuery(SinglePredicate predicate, List fields) { + Subquery subquery = this.manager.getCriteriaBuilder().createQuery().subquery(this.tClass); + this.nestedQueryRoot = subquery.from(this.tClass); + subquery.where(predicate.applyPredicate(this.manager.getCriteriaBuilder(), this.nestedQueryRoot)); + if (fields.get(0).getType() == FieldSelectionType.FIELD) + subquery.select(this.nestedQueryRoot.get(fields.get(0).getField())); + else if (fields.get(0).getType() == FieldSelectionType.COMPOSITE_FIELD) { + subquery.select(this.nestedQueryRoot.join(fields.get(0).getField().split(":")[0]).get(fields.get(0).getField().split(":")[1])); + } + return subquery; + } + + @Override + public Subquery subQuery(NestedQuerySinglePredicate predicate, List fields) { + Subquery subquery = this.manager.getCriteriaBuilder().createQuery().subquery(this.tClass); + this.nestedQueryRoot = subquery.from(this.tClass); + subquery.where(predicate.applyPredicate(this.manager.getCriteriaBuilder(), this.root, this.nestedQueryRoot)); + if (fields.get(0).getType() == FieldSelectionType.FIELD) + subquery.select(this.nestedQueryRoot.get(fields.get(0).getField())); + else if (fields.get(0).getType() == FieldSelectionType.COMPOSITE_FIELD) { + subquery.select(this.nestedQueryRoot.get(fields.get(0).getField().split(":")[0]).get(fields.get(0).getField().split(":")[1])); + } + return subquery; + } + + @Override + public Subquery subQueryCount(SinglePredicate predicate, List fields) { + Subquery subquery = this.manager.getCriteriaBuilder().createQuery().subquery(Long.class); + this.nestedQueryRoot = subquery.from(this.tClass); + subquery.where(predicate.applyPredicate(this.manager.getCriteriaBuilder(), this.nestedQueryRoot)); + subquery.select(this.manager.getCriteriaBuilder().count(this.nestedQueryRoot.get(fields.get(0).getField()))); + return subquery; + } + + @Override + public Subquery subQueryCount(NestedQuerySinglePredicate predicate, List fields) { + Subquery subquery = this.manager.getCriteriaBuilder().createQuery().subquery(Long.class); + this.nestedQueryRoot = subquery.from(this.tClass); + subquery.where(predicate.applyPredicate(this.manager.getCriteriaBuilder(), this.root, this.nestedQueryRoot)); + subquery.select(this.manager.getCriteriaBuilder().count(this.nestedQueryRoot.get(fields.get(0).getField()))); + return subquery; + } + + @Override + public Subquery subQueryMax(SinglePredicate predicate, List fields, Class uClass) { + Subquery subquery = this.manager.getCriteriaBuilder().createQuery().subquery(uClass); + this.nestedQueryRoot = subquery.from(this.tClass); + subquery.where(predicate.applyPredicate(this.manager.getCriteriaBuilder(), this.nestedQueryRoot)); + if (fields.get(0).getType() == FieldSelectionType.FIELD) + subquery.select(this.manager.getCriteriaBuilder().greatest(this.nestedQueryRoot.get(fields.get(0).getField()))); + else if (fields.get(0).getType() == FieldSelectionType.COMPOSITE_FIELD) { + subquery.select(this.manager.getCriteriaBuilder().greatest(this.nestedQueryRoot.get(fields.get(0).getField().split(":")[0]).get(fields.get(0).getField().split(":")[1]))); + } + return subquery; + } + + @Override + public Subquery subQueryMax(NestedQuerySinglePredicate predicate, List fields, Class uClass) { + Subquery subquery = this.manager.getCriteriaBuilder().createQuery().subquery(uClass); + this.nestedQueryRoot = subquery.from(this.tClass); + subquery.where(predicate.applyPredicate(this.manager.getCriteriaBuilder(), this.root, this.nestedQueryRoot)); + if (fields.get(0).getType() == FieldSelectionType.FIELD) + subquery.select(this.manager.getCriteriaBuilder().greatest(this.nestedQueryRoot.get(fields.get(0).getField()))); + else if (fields.get(0).getType() == FieldSelectionType.COMPOSITE_FIELD) { + subquery.select(this.manager.getCriteriaBuilder().greatest(this.nestedQueryRoot.get(fields.get(0).getField().split(":")[0]).get(fields.get(0).getField().split(":")[1]))); + } + return subquery; + } + + public QueryableList initSubQuery(Class uClass) { + this.subquery = this.manager.getCriteriaBuilder().createQuery().subquery(uClass); + this.nestedQueryRoot = subquery.from(this.tClass); + return this; + } + + @Override + public Subquery query(List fields) { + CriteriaBuilder builder = this.manager.getCriteriaBuilder(); + Subquery query = builder.createQuery().subquery(this.tClass); + this.root = query.from(this.tClass); + query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); + if (fields.get(0).getType() == FieldSelectionType.FIELD) + query.select(this.root.get(fields.get(0).getField())); + else if (fields.get(0).getType() == FieldSelectionType.COMPOSITE_FIELD) { + query.select(this.root.get(fields.get(0).getField().split(":")[0]).get(fields.get(0).getField().split(":")[1])); + } + if (distinct) + query.distinct(true); + return query; + } + + @Override + public void update(EntitySelectPredicate selectPredicate, V value) { + CriteriaBuilder builder = this.manager + .getCriteriaBuilder(); + CriteriaUpdate update = builder + .createCriteriaUpdate(tClass); + this.root = update.from(tClass); + update.set(selectPredicate.applyPredicate(root), value) + .where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); + this.manager + .createQuery(update) + .executeUpdate(); + } + + private Path[] parseFields(List selectedFields) { + List paths = new ArrayList<>(); + selectedFields.forEach(s -> paths.add(root.get(s))); + + return paths.toArray(new Path[0]); + } } diff --git a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/EntitySelectPredicate.java b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/EntitySelectPredicate.java index c6c3cb7b7..88ea75067 100644 --- a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/EntitySelectPredicate.java +++ b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/EntitySelectPredicate.java @@ -1,7 +1,7 @@ package eu.eudat.queryable.jpa.predicates; -import javax.persistence.criteria.Path; -import javax.persistence.criteria.Root; +import jakarta.persistence.criteria.Path; +import jakarta.persistence.criteria.Root; import java.util.function.Predicate; /** diff --git a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/GroupByPredicate.java b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/GroupByPredicate.java index 849878e4e..870a17a40 100644 --- a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/GroupByPredicate.java +++ b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/GroupByPredicate.java @@ -1,8 +1,8 @@ package eu.eudat.queryable.jpa.predicates; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.Expression; -import javax.persistence.criteria.Root; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.Expression; +import jakarta.persistence.criteria.Root; public interface GroupByPredicate { Expression applyPredicate(CriteriaBuilder builder, Root root); diff --git a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/NestedQuerySinglePredicate.java b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/NestedQuerySinglePredicate.java index 50eb825b0..e2b8813c1 100644 --- a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/NestedQuerySinglePredicate.java +++ b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/NestedQuerySinglePredicate.java @@ -1,8 +1,8 @@ package eu.eudat.queryable.jpa.predicates; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.Predicate; -import javax.persistence.criteria.Root; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.Predicate; +import jakarta.persistence.criteria.Root; /** * Created by ikalyvas on 2/7/2018. diff --git a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/OrderByPredicate.java b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/OrderByPredicate.java index 9a83730e4..8b236fdcf 100644 --- a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/OrderByPredicate.java +++ b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/OrderByPredicate.java @@ -1,8 +1,8 @@ package eu.eudat.queryable.jpa.predicates; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.Order; -import javax.persistence.criteria.Root; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.Order; +import jakarta.persistence.criteria.Root; public interface OrderByPredicate { Order applyPredicate(CriteriaBuilder builder, Root root); diff --git a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/SinglePredicate.java b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/SinglePredicate.java index cdfde4b99..88e886847 100644 --- a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/SinglePredicate.java +++ b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/jpa/predicates/SinglePredicate.java @@ -1,8 +1,8 @@ package eu.eudat.queryable.jpa.predicates; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.Predicate; -import javax.persistence.criteria.Root; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.Predicate; +import jakarta.persistence.criteria.Root; public interface SinglePredicate { Predicate applyPredicate(CriteriaBuilder builder, Root root); diff --git a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/queryableentity/DataEntity.java b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/queryableentity/DataEntity.java index 040d44ca1..0eca2836d 100644 --- a/dmp-backend/queryable/src/main/java/eu/eudat/queryable/queryableentity/DataEntity.java +++ b/dmp-backend/queryable/src/main/java/eu/eudat/queryable/queryableentity/DataEntity.java @@ -1,6 +1,6 @@ package eu.eudat.queryable.queryableentity; -import javax.persistence.Tuple; +import jakarta.persistence.Tuple; import java.util.List; public interface DataEntity { diff --git a/dmp-backend/web/pom.xml b/dmp-backend/web/pom.xml index 2e1e495d1..28c787460 100644 --- a/dmp-backend/web/pom.xml +++ b/dmp-backend/web/pom.xml @@ -16,6 +16,11 @@ + + eu.eudat + core + 1.0.0-SNAPSHOT + eu.eudat data @@ -53,7 +58,6 @@ com.fasterxml.jackson.core jackson-annotations - 2.12.3 @@ -215,8 +219,8 @@ maven-compiler-plugin 3.8.1 - 1.8 - 1.8 + 17 + 17 @@ -262,5 +266,7 @@ eu.eudat.EuDatApplication 4.0.1 + 17 + 17 \ No newline at end of file diff --git a/dmp-backend/web/src/main/java/eu/eudat/EuDatApplication.java b/dmp-backend/web/src/main/java/eu/eudat/EuDatApplication.java index 5ed228762..dc5a0de13 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/EuDatApplication.java +++ b/dmp-backend/web/src/main/java/eu/eudat/EuDatApplication.java @@ -1,17 +1,14 @@ package eu.eudat; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.scheduling.annotation.EnableAsync; -@SpringBootApplication(scanBasePackages = {"eu.eudat", "eu.eudat.depositinterface"}) +@SpringBootApplication(scanBasePackages = {"eu.eudat", "eu.eudat.depositinterface", "gr.cite"}) @EnableAsync public class EuDatApplication extends SpringBootServletInitializer { - private static final Logger logger = LoggerFactory.getLogger(EuDatApplication.class); @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/DevelDatabaseConfiguration.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/DevelDatabaseConfiguration.java index a1311f1f1..8e58dc5a6 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/DevelDatabaseConfiguration.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/DevelDatabaseConfiguration.java @@ -15,7 +15,7 @@ import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement; -import javax.persistence.EntityManagerFactory; +import jakarta.persistence.EntityManagerFactory; import javax.sql.DataSource; import java.util.Properties; @@ -66,8 +66,8 @@ public class DevelDatabaseConfiguration { private Properties additionalProperties() { Properties properties = new Properties(); - properties.setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQL92Dialect"); - properties.setProperty("hibernate.show_sql", "true"); + properties.setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect"); + properties.setProperty("hibernate.show_sql", "false"); properties.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false"); return properties; } diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/ProductionDatabaseConfiguration.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/ProductionDatabaseConfiguration.java index f293c5d06..55553633a 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/ProductionDatabaseConfiguration.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/ProductionDatabaseConfiguration.java @@ -15,7 +15,7 @@ import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement; -import javax.persistence.EntityManagerFactory; +import jakarta.persistence.EntityManagerFactory; import javax.sql.DataSource; import java.util.Properties; diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/WebMVCConfiguration.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/WebMVCConfiguration.java index 36d9c502c..eb7a7fc6f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/WebMVCConfiguration.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/WebMVCConfiguration.java @@ -10,14 +10,14 @@ import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import java.util.List; @EnableAsync @Configuration @EnableScheduling -public class WebMVCConfiguration extends WebMvcConfigurerAdapter { +public class WebMVCConfiguration implements WebMvcConfigurer { private ApiContext apiContext; diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfigurationDevelImpl.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfigurationDevelImpl.java index edad07650..eca3ab522 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfigurationDevelImpl.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfigurationDevelImpl.java @@ -10,8 +10,8 @@ import org.springframework.context.annotation.Profile; import org.springframework.core.env.Environment; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.Unmarshaller; import java.io.IOException; import java.io.InputStream; import java.net.URL; diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfigurationProdImpl.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfigurationProdImpl.java index 4e06d2d84..30f2124a5 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfigurationProdImpl.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfigurationProdImpl.java @@ -10,8 +10,8 @@ import org.springframework.context.annotation.Profile; import org.springframework.core.env.Environment; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.Unmarshaller; import java.io.IOException; import java.io.InputStream; import java.net.URL; diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Configuration.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Configuration.java index c1ac50408..3a65659c1 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Configuration.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Configuration.java @@ -1,8 +1,8 @@ package eu.eudat.configurations.dynamicfunder.entities; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Dependency.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Dependency.java index 7e99f487d..0d7288ec9 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Dependency.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Dependency.java @@ -1,6 +1,6 @@ package eu.eudat.configurations.dynamicfunder.entities; -import javax.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElement; public class Dependency { private String id; diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Language.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Language.java index 7ea254152..1dfd36c00 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Language.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Language.java @@ -1,6 +1,6 @@ package eu.eudat.configurations.dynamicfunder.entities; -import javax.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElement; public class Language { private String key; diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/MainProperty.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/MainProperty.java index 997dc4aff..f4a931510 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/MainProperty.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/MainProperty.java @@ -2,8 +2,8 @@ package eu.eudat.configurations.dynamicfunder.entities; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class MainProperty { diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Property.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Property.java index ade2c2e27..2f5172f0e 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Property.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Property.java @@ -1,8 +1,8 @@ package eu.eudat.configurations.dynamicfunder.entities; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class Property { diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfigurationDevelImpl.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfigurationDevelImpl.java index 13128d7d9..eb4fc308c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfigurationDevelImpl.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfigurationDevelImpl.java @@ -11,8 +11,8 @@ import org.springframework.context.annotation.Profile; import org.springframework.core.env.Environment; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.Unmarshaller; import java.io.IOException; import java.io.InputStream; import java.net.URL; diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfigurationProdImpl.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfigurationProdImpl.java index bdfc63b5b..e23dd1240 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfigurationProdImpl.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfigurationProdImpl.java @@ -11,8 +11,8 @@ import org.springframework.context.annotation.Profile; import org.springframework.core.env.Environment; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.Unmarshaller; import java.io.IOException; import java.io.InputStream; import java.net.URL; diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Configuration.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Configuration.java index 7b4bbe714..1fede94fa 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Configuration.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Configuration.java @@ -1,8 +1,8 @@ package eu.eudat.configurations.dynamicgrant.entities; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; /** diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Dependency.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Dependency.java index e256d1ab6..8eb96a9b1 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Dependency.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Dependency.java @@ -1,6 +1,6 @@ package eu.eudat.configurations.dynamicgrant.entities; -import javax.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElement; /** * Created by ikalyvas on 3/23/2018. diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Language.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Language.java index 0b22bee2d..47c024643 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Language.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Language.java @@ -1,6 +1,6 @@ package eu.eudat.configurations.dynamicgrant.entities; -import javax.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElement; /** * Created by ikalyvas on 3/28/2018. diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/MainProperty.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/MainProperty.java index fd0b8732f..9cde5d51a 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/MainProperty.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/MainProperty.java @@ -2,8 +2,8 @@ package eu.eudat.configurations.dynamicgrant.entities; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; /** diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Property.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Property.java index 431ac20ca..ec31ce285 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Property.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Property.java @@ -1,7 +1,7 @@ package eu.eudat.configurations.dynamicgrant.entities; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; /** diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfigurationDevelImpl.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfigurationDevelImpl.java index fb1c17787..f385580bf 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfigurationDevelImpl.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfigurationDevelImpl.java @@ -11,8 +11,8 @@ import org.springframework.context.annotation.Profile; import org.springframework.core.env.Environment; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.Unmarshaller; import java.io.IOException; import java.io.InputStream; import java.net.URL; diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfigurationProdImpl.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfigurationProdImpl.java index bd4cb625f..0d0aeb607 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfigurationProdImpl.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfigurationProdImpl.java @@ -11,8 +11,8 @@ import org.springframework.context.annotation.Profile; import org.springframework.core.env.Environment; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.Unmarshaller; import java.io.IOException; import java.io.InputStream; import java.net.URL; diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Configuration.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Configuration.java index ac09b4ad0..f207844c6 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Configuration.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Configuration.java @@ -1,9 +1,9 @@ package eu.eudat.configurations.dynamicproject.entities; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Dependency.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Dependency.java index f5a320b3f..889444402 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Dependency.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Dependency.java @@ -1,6 +1,6 @@ package eu.eudat.configurations.dynamicproject.entities; -import javax.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElement; public class Dependency { private String id; diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Language.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Language.java index 3039a96c9..89fed26d6 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Language.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Language.java @@ -1,6 +1,6 @@ package eu.eudat.configurations.dynamicproject.entities; -import javax.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElement; public class Language { private String key; diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/MainProperty.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/MainProperty.java index 9506b4d71..29ab31b22 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/MainProperty.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/MainProperty.java @@ -2,8 +2,8 @@ package eu.eudat.configurations.dynamicproject.entities; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class MainProperty { diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Property.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Property.java index 8dc4f4ae9..40b919a8a 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Property.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Property.java @@ -1,8 +1,8 @@ package eu.eudat.configurations.dynamicproject.entities; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class Property { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Admin.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Admin.java index b8604c456..469b9aaa3 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Admin.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Admin.java @@ -27,8 +27,8 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import javax.transaction.Transactional; -import javax.validation.Valid; +import jakarta.transaction.Transactional; +import jakarta.validation.Valid; import java.io.IOException; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/ContactEmail.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/ContactEmail.java index 38fe71c83..ed54fa55a 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/ContactEmail.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/ContactEmail.java @@ -12,7 +12,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @RestController @CrossOrigin diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPProfileController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPProfileController.java index 871c87bc2..c7eb69b90 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPProfileController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPProfileController.java @@ -23,7 +23,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import javax.validation.Valid; +import jakarta.validation.Valid; import javax.xml.xpath.XPathExpressionException; import java.io.IOException; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java index 2427314d6..edb3fac48 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java @@ -45,8 +45,8 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import javax.activation.MimetypesFileTypeMap; -import javax.validation.Valid; +import jakarta.activation.MimetypesFileTypeMap; +import jakarta.validation.Valid; import java.io.File; import java.io.FileInputStream; import java.io.IOException; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/DashBoardController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DashBoardController.java index 12a75d5be..ae69957d5 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/DashBoardController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DashBoardController.java @@ -17,7 +17,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.io.IOException; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java index 5364cf9f0..487f70d80 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java @@ -45,8 +45,8 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import javax.persistence.NoResultException; -import javax.transaction.Transactional; +import jakarta.persistence.NoResultException; +import jakarta.transaction.Transactional; import java.io.File; import java.io.FileInputStream; import java.io.IOException; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/DescriptionTemplateTypeController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DescriptionTemplateTypeController.java index 47c41eb77..456a9caaa 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/DescriptionTemplateTypeController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DescriptionTemplateTypeController.java @@ -15,7 +15,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.UUID; import static eu.eudat.types.Authorities.ADMIN; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailConfirmation.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailConfirmation.java index d1c9582aa..ce8545f60 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailConfirmation.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailConfirmation.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @RestController @CrossOrigin diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailMergeConfirmation.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailMergeConfirmation.java index 96f959078..ec04af59c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailMergeConfirmation.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailMergeConfirmation.java @@ -15,7 +15,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @RestController @CrossOrigin diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailUnlinkConfirmation.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailUnlinkConfirmation.java index 5dcc639bc..175e4cf21 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailUnlinkConfirmation.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailUnlinkConfirmation.java @@ -12,7 +12,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; @RestController @CrossOrigin diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/FileController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/FileController.java index a064145bc..cfaae57e9 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/FileController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/FileController.java @@ -29,7 +29,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.io.*; import java.nio.file.Files; import java.util.*; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Grants.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Grants.java index 8e8bbb56e..66e518417 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Grants.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Grants.java @@ -18,8 +18,8 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; -import javax.validation.Valid; +import jakarta.transaction.Transactional; +import jakarta.validation.Valid; import java.io.IOException; import java.text.ParseException; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Login.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Login.java index 4821a2b8a..4ea99e0ca 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Login.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Login.java @@ -44,7 +44,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.social.oauth1.OAuthToken; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.io.IOException; import java.security.GeneralSecurityException; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/ManagementController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/ManagementController.java index d72441595..7cbf9d197 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/ManagementController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/ManagementController.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import static eu.eudat.types.Authorities.ADMIN; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Organisations.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Organisations.java index 0d2d12a65..9a6cfdee1 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Organisations.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Organisations.java @@ -15,7 +15,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/QuickWizardController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/QuickWizardController.java index 970d95b28..d1df0cc55 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/QuickWizardController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/QuickWizardController.java @@ -20,8 +20,8 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.transaction.Transactional; -import javax.validation.Valid; +import jakarta.transaction.Transactional; +import jakarta.validation.Valid; @RestController @CrossOrigin diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/UserInvitationController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/UserInvitationController.java index 3838fee4a..fa92f5fc0 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/UserInvitationController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/UserInvitationController.java @@ -14,7 +14,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBException; import java.io.IOException; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Users.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Users.java index 88a020232..a715eaa6f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Users.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Users.java @@ -21,7 +21,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.io.IOException; import java.util.List; import java.util.Map; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/controllerhandler/ControllerErrorHandler.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/controllerhandler/ControllerErrorHandler.java index aed793614..a7cc8f88e 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/controllerhandler/ControllerErrorHandler.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/controllerhandler/ControllerErrorHandler.java @@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; -import javax.annotation.Priority; +import jakarta.annotation.Priority; /** * Created by ikalyvas on 6/12/2018. diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/controllerhandler/ControllerUnauthorisedHandler.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/controllerhandler/ControllerUnauthorisedHandler.java index 63bf582cf..731a3c9ed 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/controllerhandler/ControllerUnauthorisedHandler.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/controllerhandler/ControllerUnauthorisedHandler.java @@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; -import javax.annotation.Priority; +import jakarta.annotation.Priority; /** * Created by ikalyvas on 6/12/2018. diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/interceptors/RequestInterceptor.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/interceptors/RequestInterceptor.java index 183e79194..59f5652c1 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/interceptors/RequestInterceptor.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/interceptors/RequestInterceptor.java @@ -5,17 +5,18 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.web.servlet.HandlerInterceptor; + import java.util.Date; /** * Created by ikalyvas on 3/1/2018. */ @Component -public class RequestInterceptor extends HandlerInterceptorAdapter { +public class RequestInterceptor implements HandlerInterceptor { private static final Logger logger = LoggerFactory.getLogger(RequestInterceptor.class); @Autowired @@ -27,6 +28,6 @@ public class RequestInterceptor extends HandlerInterceptorAdapter { HttpServletResponse response, Object handler) throws Exception { String reqUri = request.getRequestURI(); logger.info("Call to " + reqUri + " method: " + request.getMethod() + " at: " + new Date(), WarningLevel.INFO); - return super.preHandle(request, response, handler); + return HandlerInterceptor.super.preHandle(request, response, handler); } } diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/BaseController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/BaseController.java new file mode 100644 index 000000000..cb3b26a4f --- /dev/null +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/BaseController.java @@ -0,0 +1,36 @@ +package eu.eudat.controllers.v2; + +import eu.eudat.model.result.QueryResult; +import gr.cite.tools.data.query.Lookup; + +import java.util.List; +import java.util.function.BiFunction; +import java.util.function.Function; + +public class BaseController { + + public static QueryResult extractQueryResultWithCount(Function> service, L lookup) { + return extractQueryResultWithCountWhen(service, lookup, null); + } + + public static QueryResult extractQueryResultWithCountWhen(Function> service, L lookup, Function when) { + List result = service.apply(lookup); + lookup.setPage(null); + List all = service.apply(lookup); + long count = all.size(); + if (when == null) return new QueryResult<>(result, count); + long countOverride = count; + for (T item : all) { + if (!when.apply(item)) countOverride--; + } + return new QueryResult<>(result, count, countOverride); + } + + public static QueryResult extractQueryResultWithCount(BiFunction> service, String name, L lookup) { + List result = service.apply(name, lookup); + lookup.setPage(null); + long count = service.apply(name, lookup).size(); + return new QueryResult<>(result, count); + } + +} diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DescriptionTemplateTypeV2Controller.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DescriptionTemplateTypeV2Controller.java new file mode 100644 index 000000000..9d8eef140 --- /dev/null +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DescriptionTemplateTypeV2Controller.java @@ -0,0 +1,59 @@ +package eu.eudat.controllers.v2; + +import eu.eudat.logic.security.claims.ClaimedAuthorities; +import eu.eudat.model.DescriptionTemplateType; +import eu.eudat.model.result.QueryResult; +import eu.eudat.models.data.security.Principal; +import eu.eudat.query.lookup.DescriptionTemplateTypeLookup; +import eu.eudat.service.DescriptionTemplateTypeService; +import eu.eudat.types.Authorities; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import java.util.UUID; + +import static eu.eudat.controllers.v2.BaseController.extractQueryResultWithCount; + +@RestController +@Transactional +@RequestMapping(path = "api/v2/descriptionTemplateType", produces = MediaType.APPLICATION_JSON_VALUE) +public class DescriptionTemplateTypeV2Controller { + + private final DescriptionTemplateTypeService descriptionTemplateTypeService; + + public DescriptionTemplateTypeV2Controller(DescriptionTemplateTypeService descriptionTemplateTypeService) { + this.descriptionTemplateTypeService = descriptionTemplateTypeService; + } + + @PostMapping("all") + public QueryResult getAll(@RequestBody DescriptionTemplateTypeLookup lookup, @ClaimedAuthorities(claims = {Authorities.ADMIN, Authorities.MANAGER, Authorities.USER, Authorities.ANONYMOUS}) Principal ignoredPrincipal) { + return extractQueryResultWithCount(descriptionTemplateTypeService::getAll, lookup); + } + + @GetMapping("{id}") + public QueryResult get(@PathVariable("id") UUID id, @ClaimedAuthorities(claims = {Authorities.ADMIN, Authorities.MANAGER, Authorities.USER, Authorities.ANONYMOUS}) Principal ignoredPrincipal) { + return new QueryResult<>(descriptionTemplateTypeService.getById(id)); + } + + @PostMapping("create") + public QueryResult create(@RequestBody DescriptionTemplateType payload, @ClaimedAuthorities(claims = {Authorities.ADMIN}) Principal ignoredPrincipal) { + return new QueryResult<>(descriptionTemplateTypeService.create(payload)); + } + + @PostMapping("update") + public QueryResult update(@RequestBody DescriptionTemplateType payload, @ClaimedAuthorities(claims = {Authorities.ADMIN}) Principal ignoredPrincipal) { + return new QueryResult<>(descriptionTemplateTypeService.update(payload)); + } + + @DeleteMapping("delete/{id}") + public ResponseEntity delete(@PathVariable(value = "id") UUID id, @ClaimedAuthorities(claims = {Authorities.ADMIN}) Principal ignoredPrincipal) { + if (descriptionTemplateTypeService.delete(id)) + return ResponseEntity.status(HttpStatus.OK).build(); + else + return ResponseEntity.status(HttpStatus.NOT_FOUND).build(); + } + +} diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/builders/BuilderFactoryImpl.java b/dmp-backend/web/src/main/java/eu/eudat/logic/builders/BuilderFactoryImpl.java index 9a99fcc9f..40921b4c2 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/builders/BuilderFactoryImpl.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/builders/BuilderFactoryImpl.java @@ -5,10 +5,11 @@ import eu.eudat.logic.builders.model.criteria.DataRepositoryCriteriaBuilder; import eu.eudat.logic.builders.model.criteria.ExternalDatasetCriteriaBuilder; import eu.eudat.logic.builders.model.criteria.RegistryCriteriaBuilder; import eu.eudat.logic.builders.model.models.*; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; -@Service("builderFactory") +@Service public class BuilderFactoryImpl implements BuilderFactory { public T getBuilder(Class tClass) { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/ContactEmailManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/ContactEmailManager.java index ae090cfd3..ea2ecce35 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/ContactEmailManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/ContactEmailManager.java @@ -10,7 +10,7 @@ import org.springframework.core.env.Environment; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import javax.mail.MessagingException; +import jakarta.mail.MessagingException; @Component public class ContactEmailManager { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DashBoardManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DashBoardManager.java index cab65310f..50421a683 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DashBoardManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DashBoardManager.java @@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.*; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java index 2a3941f35..9e19aaffd 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java @@ -81,10 +81,10 @@ import org.springframework.web.multipart.MultipartFile; import org.w3c.dom.Document; import org.w3c.dom.Element; -import javax.transaction.Transactional; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; +import jakarta.transaction.Transactional; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Unmarshaller; import java.io.*; import java.math.BigInteger; import java.nio.file.Files; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementProfileManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementProfileManager.java index 4b6d4dc6a..b3629af42 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementProfileManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementProfileManager.java @@ -30,7 +30,7 @@ import org.springframework.core.env.Environment; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; -import javax.activation.MimetypesFileTypeMap; +import jakarta.activation.MimetypesFileTypeMap; import javax.xml.xpath.*; import java.io.*; import java.nio.file.Files; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetManager.java index 5da228f05..00f8a65c0 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetManager.java @@ -73,13 +73,13 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import javax.activation.MimetypesFileTypeMap; -import javax.persistence.criteria.Join; -import javax.persistence.criteria.JoinType; -import javax.transaction.Transactional; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; +import jakarta.activation.MimetypesFileTypeMap; +import jakarta.persistence.criteria.Join; +import jakarta.persistence.criteria.JoinType; +import jakarta.transaction.Transactional; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Unmarshaller; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.xpath.XPath; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetProfileManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetProfileManager.java index faf184cf8..6c69469d4 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetProfileManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetProfileManager.java @@ -44,8 +44,9 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import javax.activation.MimetypesFileTypeMap; -import javax.transaction.Transactional; +import jakarta.activation.MimetypesFileTypeMap; +import jakarta.transaction.Transactional; + import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/InvitationsManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/InvitationsManager.java index 8b11369d7..0e6171ca5 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/InvitationsManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/InvitationsManager.java @@ -15,9 +15,9 @@ import eu.eudat.queryable.QueryableList; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Unmarshaller; import java.io.IOException; import java.io.StringReader; import java.util.*; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/LockManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/LockManager.java index d3f7308af..365cf7ec9 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/LockManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/LockManager.java @@ -8,7 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; -import javax.persistence.NoResultException; +import jakarta.persistence.NoResultException; import java.util.Comparator; import java.util.Date; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/MergeEmailConfirmationManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/MergeEmailConfirmationManager.java index 4a6b0ac56..1368c66f8 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/MergeEmailConfirmationManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/MergeEmailConfirmationManager.java @@ -26,7 +26,7 @@ import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.io.IOException; import java.util.*; import java.util.stream.Collectors; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/MetricsManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/MetricsManager.java index 2aacc8cc3..70f305028 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/MetricsManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/MetricsManager.java @@ -13,8 +13,8 @@ import org.springframework.core.env.Environment; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import javax.annotation.PostConstruct; -import javax.transaction.Transactional; +import jakarta.annotation.PostConstruct; +import jakarta.transaction.Transactional; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/NotificationManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/NotificationManager.java index a579d1870..1f3a57dfb 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/NotificationManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/NotificationManager.java @@ -14,8 +14,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; -import javax.mail.MessagingException; -import javax.transaction.Transactional; +import jakarta.mail.MessagingException; +import jakarta.transaction.Transactional; import java.io.IOException; import java.util.*; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/RDAManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/RDAManager.java index f277d98ac..dc81cc6bf 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/RDAManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/RDAManager.java @@ -9,7 +9,7 @@ import eu.eudat.models.rda.mapper.DmpRDAMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.io.IOException; import java.text.SimpleDateFormat; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UnlinkEmailConfirmationManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UnlinkEmailConfirmationManager.java index cf55ceaf9..c6fb24047 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UnlinkEmailConfirmationManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UnlinkEmailConfirmationManager.java @@ -17,7 +17,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.sql.Timestamp; import java.time.LocalDateTime; import java.util.*; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/DataFieldsUrlConfiguration.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/DataFieldsUrlConfiguration.java index d629a1503..bdc25ba6c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/DataFieldsUrlConfiguration.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/DataFieldsUrlConfiguration.java @@ -1,6 +1,6 @@ package eu.eudat.logic.proxy.config; -import javax.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElement; /** * Created by ikalyvas on 6/29/2018. diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/DataSearchConfiguration.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/DataSearchConfiguration.java index 8ec232197..aecf16e18 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/DataSearchConfiguration.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/DataSearchConfiguration.java @@ -1,6 +1,6 @@ package eu.eudat.logic.proxy.config; -import javax.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElement; public class DataSearchConfiguration { private String type; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/DataUrlConfiguration.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/DataUrlConfiguration.java index e787eafaa..ec6bccb04 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/DataUrlConfiguration.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/DataUrlConfiguration.java @@ -1,7 +1,7 @@ package eu.eudat.logic.proxy.config; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; /** diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/ExternalUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/ExternalUrls.java index e4f90e7a7..3bdf1dec0 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/ExternalUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/ExternalUrls.java @@ -4,9 +4,9 @@ package eu.eudat.logic.proxy.config; import eu.eudat.logic.proxy.config.entities.*; import eu.eudat.logic.proxy.config.prefilling.PrefillingConfigMapAdapter; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import java.io.Serializable; import java.util.Map; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/QueryConfig.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/QueryConfig.java index 64c550465..a4f2cd7af 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/QueryConfig.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/QueryConfig.java @@ -1,6 +1,6 @@ package eu.eudat.logic.proxy.config; -import javax.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElement; public class QueryConfig { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/UrlConfiguration.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/UrlConfiguration.java index 50f2093fa..2ed3f5999 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/UrlConfiguration.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/UrlConfiguration.java @@ -1,8 +1,8 @@ package eu.eudat.logic.proxy.config; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class UrlConfiguration { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/configloaders/DefaultConfigLoader.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/configloaders/DefaultConfigLoader.java index b9f7ddb0c..0dd43780a 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/configloaders/DefaultConfigLoader.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/configloaders/DefaultConfigLoader.java @@ -18,8 +18,8 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.Unmarshaller; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/configloaders/ProductionConfigLoader.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/configloaders/ProductionConfigLoader.java index 7f3c48109..e5b46362b 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/configloaders/ProductionConfigLoader.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/configloaders/ProductionConfigLoader.java @@ -15,8 +15,8 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.Unmarshaller; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/DatasetUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/DatasetUrls.java index f1aeb9a3b..830ed3851 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/DatasetUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/DatasetUrls.java @@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/DefaultPrefillingMapping.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/DefaultPrefillingMapping.java index 4346796af..722288c47 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/DefaultPrefillingMapping.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/DefaultPrefillingMapping.java @@ -1,7 +1,7 @@ package eu.eudat.logic.proxy.config.entities; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "mapping") public class DefaultPrefillingMapping implements PrefillingMapping{ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/FunderUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/FunderUrls.java index ede90c5ee..9dc910e90 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/FunderUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/FunderUrls.java @@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class FunderUrls extends GenericUrls{ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/GrantUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/GrantUrls.java index 3616d6726..ef5500236 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/GrantUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/GrantUrls.java @@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/JournalUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/JournalUrls.java index 9ed1f2e93..25c543dfe 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/JournalUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/JournalUrls.java @@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class JournalUrls extends GenericUrls{ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/LicenseUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/LicenseUrls.java index 55dadce4e..3937cb85a 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/LicenseUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/LicenseUrls.java @@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/OrganisationUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/OrganisationUrls.java index e45192806..232f9b245 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/OrganisationUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/OrganisationUrls.java @@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class OrganisationUrls extends GenericUrls{ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingConfig.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingConfig.java index fba62bab7..9bd9daed8 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingConfig.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingConfig.java @@ -1,8 +1,8 @@ package eu.eudat.logic.proxy.config.entities; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "config") public class PrefillingConfig { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingFixedMapping.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingFixedMapping.java index aa59f8386..e961b25ce 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingFixedMapping.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingFixedMapping.java @@ -1,7 +1,7 @@ package eu.eudat.logic.proxy.config.entities; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "fixedMapping") public class PrefillingFixedMapping implements PrefillingMapping{ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingGet.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingGet.java index ab73b6d5f..bf9cbb33c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingGet.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingGet.java @@ -1,7 +1,7 @@ package eu.eudat.logic.proxy.config.entities; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class PrefillingGet{ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingMapping.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingMapping.java index ae81f6176..d4f8c82fb 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingMapping.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingMapping.java @@ -1,6 +1,6 @@ package eu.eudat.logic.proxy.config.entities; -import javax.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlAttribute; public interface PrefillingMapping { String getTarget(); diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingSearch.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingSearch.java index d905a18dd..b031589fa 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingSearch.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PrefillingSearch.java @@ -3,7 +3,7 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElement; import java.util.ArrayList; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ProjectUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ProjectUrls.java index 0b6e7eaeb..909a036f7 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ProjectUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ProjectUrls.java @@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class ProjectUrls extends GenericUrls{ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PubRepositoryUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PubRepositoryUrls.java index 0ce26719f..29729c65c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PubRepositoryUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PubRepositoryUrls.java @@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class PubRepositoryUrls extends GenericUrls{ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PublicationsUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PublicationsUrls.java index ed4ae0fe0..e93e72d39 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PublicationsUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/PublicationsUrls.java @@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class PublicationsUrls extends GenericUrls{ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/RegistryUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/RegistryUrls.java index c9d062c75..842901b62 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/RegistryUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/RegistryUrls.java @@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class RegistryUrls extends GenericUrls{ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/RepositoryUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/RepositoryUrls.java index 5f0df351c..88dc7acc1 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/RepositoryUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/RepositoryUrls.java @@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class RepositoryUrls extends GenericUrls{ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ResearcherUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ResearcherUrls.java index af9346b50..ddbd0881c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ResearcherUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ResearcherUrls.java @@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class ResearcherUrls extends GenericUrls{ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ServiceUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ServiceUrls.java index 4af0df57b..6e171ad67 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ServiceUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ServiceUrls.java @@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class ServiceUrls extends GenericUrls{ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/TagUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/TagUrls.java index 56077214e..514a15d9c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/TagUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/TagUrls.java @@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; /** diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/TaxonomiesUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/TaxonomiesUrls.java index cd205f798..6f78c2e3f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/TaxonomiesUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/TaxonomiesUrls.java @@ -3,8 +3,8 @@ package eu.eudat.logic.proxy.config.entities; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import java.util.List; public class TaxonomiesUrls extends GenericUrls{ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ValidationUrls.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ValidationUrls.java index 8c6c00029..50abc8909 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ValidationUrls.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/entities/ValidationUrls.java @@ -2,8 +2,8 @@ package eu.eudat.logic.proxy.config.entities; import java.util.List; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; import eu.eudat.logic.proxy.config.FetchStrategy; import eu.eudat.logic.proxy.config.UrlConfiguration; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/prefilling/PrefillingConfigMapAdapter.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/prefilling/PrefillingConfigMapAdapter.java index 927587d18..161b3fe98 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/prefilling/PrefillingConfigMapAdapter.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/config/prefilling/PrefillingConfigMapAdapter.java @@ -3,9 +3,9 @@ package eu.eudat.logic.proxy.config.prefilling; import eu.eudat.logic.proxy.config.entities.PrefillingConfig; import org.w3c.dom.Element; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; -import javax.xml.bind.annotation.adapters.XmlAdapter; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.Unmarshaller; +import jakarta.xml.bind.annotation.adapters.XmlAdapter; import java.util.HashMap; import java.util.Map; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/LocalFetcher.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/LocalFetcher.java index 12514ad40..2e60b92c8 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/LocalFetcher.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/LocalFetcher.java @@ -6,8 +6,8 @@ import eu.eudat.logic.proxy.fetching.entities.ConfigSingle; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Component; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.Unmarshaller; import java.io.InputStream; import java.lang.reflect.Method; import java.util.*; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/RemoteFetcher.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/RemoteFetcher.java index 4d228e7b7..5b8ba3806 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/RemoteFetcher.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/RemoteFetcher.java @@ -19,8 +19,8 @@ import org.springframework.http.*; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.Unmarshaller; import java.io.File; import java.io.StringReader; import java.lang.reflect.Method; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/Config.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/Config.java index 1f9e8494d..bd4c01fc8 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/Config.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/Config.java @@ -1,8 +1,8 @@ package eu.eudat.logic.proxy.fetching.entities; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement(name = "fetchConfig") diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/ConfigSingle.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/ConfigSingle.java index 022cfec23..1158cca2e 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/ConfigSingle.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/ConfigSingle.java @@ -1,7 +1,7 @@ package eu.eudat.logic.proxy.fetching.entities; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "config") public class ConfigSingle { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencyModel.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencyModel.java index af8c02d8b..bd13b04ab 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencyModel.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencyModel.java @@ -1,8 +1,8 @@ package eu.eudat.logic.proxy.fetching.entities; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement(name = "ISO_4217") diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencySingleModel.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencySingleModel.java index 2259c902c..cd5e5393e 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencySingleModel.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencySingleModel.java @@ -1,7 +1,7 @@ package eu.eudat.logic.proxy.fetching.entities; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "CcyNtry") public class CurrencySingleModel { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/security/customproviders/B2Access/B2AccessCustomProviderImpl.java b/dmp-backend/web/src/main/java/eu/eudat/logic/security/customproviders/B2Access/B2AccessCustomProviderImpl.java index c986edb01..d6e4c6788 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/security/customproviders/B2Access/B2AccessCustomProviderImpl.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/security/customproviders/B2Access/B2AccessCustomProviderImpl.java @@ -1,7 +1,7 @@ package eu.eudat.logic.security.customproviders.B2Access; -import com.google.api.client.repackaged.org.apache.commons.codec.binary.Base64; import eu.eudat.logic.security.validators.b2access.helpers.B2AccessResponseToken; +import org.apache.commons.codec.binary.Base64; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.http.HttpEntity; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/security/validators/configurableProvider/Saml2SSOUtils.java b/dmp-backend/web/src/main/java/eu/eudat/logic/security/validators/configurableProvider/Saml2SSOUtils.java index 862996ea6..2b6e29187 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/security/validators/configurableProvider/Saml2SSOUtils.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/security/validators/configurableProvider/Saml2SSOUtils.java @@ -135,7 +135,7 @@ public class Saml2SSOUtils { features.put("http://xml.org/sax/features/external-parameter-entities", Boolean.FALSE); features.put("http://apache.org/xml/features/disallow-doctype-decl", Boolean.TRUE); features.put("http://apache.org/xml/features/validation/schema/normalized-value", Boolean.FALSE); - features.put("http://javax.xml.XMLConstants/feature/secure-processing", Boolean.TRUE); + features.put("http://jakarta.xml.XMLConstants/feature/secure-processing", Boolean.TRUE); parserPool.setBuilderFeatures(features); diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/security/validators/google/GoogleTokenValidator.java b/dmp-backend/web/src/main/java/eu/eudat/logic/security/validators/google/GoogleTokenValidator.java index add180486..82bb9f362 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/security/validators/google/GoogleTokenValidator.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/security/validators/google/GoogleTokenValidator.java @@ -5,7 +5,7 @@ import com.google.api.client.googleapis.auth.oauth2.GoogleIdToken.Payload; import com.google.api.client.googleapis.auth.oauth2.GoogleIdTokenVerifier; import com.google.api.client.http.HttpTransport; import com.google.api.client.http.javanet.NetHttpTransport; -import com.google.api.client.json.jackson2.JacksonFactory; +import com.google.api.client.json.gson.GsonFactory; import eu.eudat.logic.security.validators.TokenValidator; import eu.eudat.logic.security.validators.TokenValidatorFactoryImpl; import eu.eudat.logic.services.operations.authentication.AuthenticationService; @@ -29,7 +29,7 @@ public class GoogleTokenValidator implements TokenValidator { @Autowired public GoogleTokenValidator(Environment environment, AuthenticationService nonVerifiedUserAuthenticationService) { this.nonVerifiedUserAuthenticationService = nonVerifiedUserAuthenticationService; - verifier = new GoogleIdTokenVerifier.Builder(transport, JacksonFactory.getDefaultInstance()) + verifier = new GoogleIdTokenVerifier.Builder(transport, GsonFactory.getDefaultInstance()) .setAudience(Collections.singletonList(environment.getProperty("google.login.clientId"))) .build(); } diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepositoryImpl.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepositoryImpl.java index ccbb80304..ca713d432 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepositoryImpl.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepositoryImpl.java @@ -6,7 +6,7 @@ import eu.eudat.data.dao.entities.security.UserTokenDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; @Service("databaseRepository") diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/InvitationService.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/InvitationService.java index ee4ac3137..5c0ba9e37 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/InvitationService.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/InvitationService.java @@ -6,7 +6,7 @@ import eu.eudat.data.dao.entities.InvitationDao; import eu.eudat.data.entities.DMP; import eu.eudat.data.entities.Invitation; -import javax.mail.MessagingException; +import jakarta.mail.MessagingException; import java.util.List; import java.util.concurrent.CompletableFuture; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/InvitationServiceImpl.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/InvitationServiceImpl.java index 1fdca59fb..7aa4067aa 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/InvitationServiceImpl.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/InvitationServiceImpl.java @@ -14,9 +14,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Service; -import javax.mail.MessagingException; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; +import jakarta.mail.MessagingException; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.Marshaller; import java.io.StringWriter; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/MailService.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/MailService.java index d210f8422..63b293a4f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/MailService.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/MailService.java @@ -2,7 +2,7 @@ package eu.eudat.logic.services.utilities; import eu.eudat.models.data.mail.SimpleMail; -import javax.mail.MessagingException; +import jakarta.mail.MessagingException; public interface MailService { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/MailServiceImpl.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/MailServiceImpl.java index cde1f885a..28b06880c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/MailServiceImpl.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/MailServiceImpl.java @@ -11,12 +11,12 @@ import org.springframework.core.io.Resource; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.stereotype.Service; -import javax.mail.BodyPart; -import javax.mail.Message; -import javax.mail.MessagingException; -import javax.mail.internet.MimeBodyPart; -import javax.mail.internet.MimeMessage; -import javax.mail.internet.MimeMultipart; +import jakarta.mail.BodyPart; +import jakarta.mail.Message; +import jakarta.mail.MessagingException; +import jakarta.mail.internet.MimeBodyPart; +import jakarta.mail.internet.MimeMessage; +import jakarta.mail.internet.MimeMultipart; import java.io.*; import java.util.ArrayList; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/ImportXmlBuilderDatasetProfile.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/ImportXmlBuilderDatasetProfile.java index b7931bd74..586f0acde 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/ImportXmlBuilderDatasetProfile.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/ImportXmlBuilderDatasetProfile.java @@ -3,9 +3,9 @@ import eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileMo import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Unmarshaller; import java.io.*; public class ImportXmlBuilderDatasetProfile { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/DatasetProfile.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/DatasetProfile.java index a7d29e30e..f0fae29a4 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/DatasetProfile.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/DatasetProfile.java @@ -3,9 +3,9 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileM import eu.eudat.data.entities.DescriptionTemplate; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.LinkedList; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/FieldSet.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/FieldSet.java index 50af153e8..f04ecb37b 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/FieldSet.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/FieldSet.java @@ -2,9 +2,9 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileM import eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields.Fields; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "field-Set") public class FieldSet { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/FieldSets.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/FieldSets.java index 54b44f448..e9431de9d 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/FieldSets.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/FieldSets.java @@ -1,7 +1,7 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.LinkedList; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/DefaultValue.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/DefaultValue.java index 9d4354fbf..f06ddd98e 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/DefaultValue.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/DefaultValue.java @@ -1,7 +1,7 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "defaultValue") public class DefaultValue { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Field.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Field.java index f6436a446..dd6dde0e9 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Field.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Field.java @@ -4,9 +4,9 @@ import eu.eudat.logic.utilities.builders.ModelBuilder; import eu.eudat.models.data.components.commons.datafield.FieldData; import org.w3c.dom.Element; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.LinkedList; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Fields.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Fields.java index d0fbe4d0c..d60a03b84 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Fields.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Fields.java @@ -1,7 +1,7 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.LinkedList; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Rule.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Rule.java index e0daeeec2..b314edb11 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Rule.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Rule.java @@ -1,8 +1,8 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "rule") public class Rule{ diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Schematic.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Schematic.java index f960693e8..75a66b92e 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Schematic.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Schematic.java @@ -1,7 +1,7 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlValue; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlValue; @XmlRootElement(name = "schematic") public class Schematic { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Schematics.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Schematics.java index e098752ca..99b0caea8 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Schematics.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Schematics.java @@ -1,7 +1,7 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement(name = "schematics") diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Validation.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Validation.java index e999f3aa9..e12dcee9d 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Validation.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Validation.java @@ -1,7 +1,7 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "validation") public class Validation { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Value.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Value.java index 66d5e2686..59e77018f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Value.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Value.java @@ -1,8 +1,8 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlValue; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlValue; @XmlRootElement(name = "value") public class Value { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/ViewStyle.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/ViewStyle.java index 317ebc65a..97d6092fe 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/ViewStyle.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/ViewStyle.java @@ -1,8 +1,8 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "viewStyle") public class ViewStyle { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Visible.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Visible.java index 710e643f1..31a4317e1 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Visible.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/Visible.java @@ -1,8 +1,8 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.LinkedList; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/validations.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/validations.java index e63132622..55d188f15 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/validations.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Fields/validations.java @@ -1,7 +1,7 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "validations") public class validations { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Multiplicity.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Multiplicity.java index 13c01c684..fee53ef9c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Multiplicity.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Multiplicity.java @@ -1,7 +1,7 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "multiplicity") diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Page.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Page.java index 5ef139834..38886ca6b 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Page.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Page.java @@ -1,8 +1,8 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement(name = "page") diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Section.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Section.java index 8b9f26580..8cbfe01e9 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Section.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Section.java @@ -1,8 +1,8 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.LinkedList; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Sections.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Sections.java index 632f6c53e..a9db7dcf9 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Sections.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/datasetProfileXml/datasetProfileModel/Sections.java @@ -1,9 +1,9 @@ package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.LinkedList; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/ImportXmlBuilderDmpBlueprint.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/ImportXmlBuilderDmpBlueprint.java index 3f4628787..4df47cfae 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/ImportXmlBuilderDmpBlueprint.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/ImportXmlBuilderDmpBlueprint.java @@ -4,9 +4,9 @@ import eu.eudat.logic.utilities.documents.xml.dmpXml.dmpBlueprintModel.DmpBluepr import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Unmarshaller; import java.io.File; import java.io.IOException; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DescriptionTemplate.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DescriptionTemplate.java index 41d5dce25..4566a8c03 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DescriptionTemplate.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DescriptionTemplate.java @@ -2,8 +2,8 @@ package eu.eudat.logic.utilities.documents.xml.dmpXml.dmpBlueprintModel; import eu.eudat.models.data.entities.xmlmodels.dmpprofiledefinition.types.FieldCategory; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.UUID; @XmlRootElement(name = "descriptionTemplate") diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DescriptionTemplates.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DescriptionTemplates.java index e4f9390d3..16f3428ef 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DescriptionTemplates.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DescriptionTemplates.java @@ -1,7 +1,7 @@ package eu.eudat.logic.utilities.documents.xml.dmpXml.dmpBlueprintModel; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement(name = "descriptionTemplates") diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DmpBlueprint.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DmpBlueprint.java index ecb06cb71..bf21ffd08 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DmpBlueprint.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DmpBlueprint.java @@ -2,8 +2,8 @@ package eu.eudat.logic.utilities.documents.xml.dmpXml.dmpBlueprintModel; import eu.eudat.data.entities.DMPProfile; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.Date; @XmlRootElement(name = "root") diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DmpBlueprintDefinition.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DmpBlueprintDefinition.java index d3e8218a2..21f73e288 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DmpBlueprintDefinition.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DmpBlueprintDefinition.java @@ -1,7 +1,7 @@ package eu.eudat.logic.utilities.documents.xml.dmpXml.dmpBlueprintModel; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.LinkedList; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/ExtraField.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/ExtraField.java index 004b3c74d..d162dc343 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/ExtraField.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/ExtraField.java @@ -2,8 +2,8 @@ package eu.eudat.logic.utilities.documents.xml.dmpXml.dmpBlueprintModel; import eu.eudat.models.data.entities.xmlmodels.dmpprofiledefinition.types.FieldCategory; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.UUID; @XmlRootElement(name = "extraField") diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/ExtraFields.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/ExtraFields.java index 2a3d12d6f..e4a182ff9 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/ExtraFields.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/ExtraFields.java @@ -1,7 +1,7 @@ package eu.eudat.logic.utilities.documents.xml.dmpXml.dmpBlueprintModel; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement(name = "extraFields") diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/Section.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/Section.java index 551302325..ff9d989d7 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/Section.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/Section.java @@ -1,8 +1,8 @@ package eu.eudat.logic.utilities.documents.xml.dmpXml.dmpBlueprintModel; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.LinkedList; import java.util.List; import java.util.UUID; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/Sections.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/Sections.java index 3dd99293c..df8411e00 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/Sections.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/Sections.java @@ -1,7 +1,7 @@ package eu.eudat.logic.utilities.documents.xml.dmpXml.dmpBlueprintModel; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement(name = "sections") diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/SystemField.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/SystemField.java index eded49aa0..4e7df5fe3 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/SystemField.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/SystemField.java @@ -2,8 +2,8 @@ package eu.eudat.logic.utilities.documents.xml.dmpXml.dmpBlueprintModel; import eu.eudat.models.data.entities.xmlmodels.dmpprofiledefinition.types.FieldCategory; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.UUID; @XmlRootElement(name = "systemField") diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/SystemFields.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/SystemFields.java index 7ad5a27a3..f5d4dceb4 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/SystemFields.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/SystemFields.java @@ -1,7 +1,7 @@ package eu.eudat.logic.utilities.documents.xml.dmpXml.dmpBlueprintModel; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement(name = "systemFields") diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/schedule/notification/NotificationScheduleJob.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/schedule/notification/NotificationScheduleJob.java index 24c5b593a..60a6ef393 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/schedule/notification/NotificationScheduleJob.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/schedule/notification/NotificationScheduleJob.java @@ -11,7 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.LinkedList; import java.util.List; import java.util.concurrent.CompletableFuture; diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dashboard/recent/model/RecentDmpModel.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dashboard/recent/model/RecentDmpModel.java index 38fb10045..a8c62e188 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dashboard/recent/model/RecentDmpModel.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dashboard/recent/model/RecentDmpModel.java @@ -4,7 +4,7 @@ import eu.eudat.data.entities.DMP; import eu.eudat.models.data.listingmodels.UserInfoListingModel; import eu.eudat.models.data.urls.DatasetUrlListing; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.List; import java.util.Map; import java.util.UUID; diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportField.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportField.java index 442472d03..2169c863a 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportField.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportField.java @@ -1,9 +1,9 @@ package eu.eudat.models.data.datasetImport; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlValue; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlValue; import java.util.List; import java.util.stream.Collectors; diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportFieldSet.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportFieldSet.java index 9febfdf2d..6a9f767f4 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportFieldSet.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportFieldSet.java @@ -1,8 +1,8 @@ package eu.eudat.models.data.datasetImport; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.Collections; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportFieldSets.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportFieldSets.java index 682eb16aa..90943b50e 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportFieldSets.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportFieldSets.java @@ -1,7 +1,7 @@ package eu.eudat.models.data.datasetImport; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.Collections; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportFields.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportFields.java index 561689d75..b50274ffe 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportFields.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportFields.java @@ -1,7 +1,7 @@ package eu.eudat.models.data.datasetImport; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement(name = "fields") diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportPage.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportPage.java index 6d9d08f8c..4794e1d84 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportPage.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportPage.java @@ -1,8 +1,8 @@ package eu.eudat.models.data.datasetImport; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement(name = "page") diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportPagedDatasetProfile.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportPagedDatasetProfile.java index d7215b950..7552b8da8 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportPagedDatasetProfile.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportPagedDatasetProfile.java @@ -1,8 +1,8 @@ package eu.eudat.models.data.datasetImport; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement(name = "root") diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportSection.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportSection.java index 16732449c..b6ce7c4b7 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportSection.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportSection.java @@ -1,8 +1,8 @@ package eu.eudat.models.data.datasetImport; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.Collections; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportSections.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportSections.java index a43475244..d4072dc7b 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportSections.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/datasetImport/DatasetImportSections.java @@ -1,7 +1,7 @@ package eu.eudat.models.data.datasetImport; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.Collections; import java.util.List; diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/AssociatedProfileImportModels.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/AssociatedProfileImportModels.java index 25c0f6ffd..07d757802 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/AssociatedProfileImportModels.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/AssociatedProfileImportModels.java @@ -1,8 +1,8 @@ package eu.eudat.models.data.dmp; import java.util.UUID; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "profile") public class AssociatedProfileImportModels { diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DatasetImportModels.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DatasetImportModels.java index d496e7dbf..b2f7c4556 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DatasetImportModels.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DatasetImportModels.java @@ -2,11 +2,11 @@ package eu.eudat.models.data.dmp; import eu.eudat.models.data.dmp.adpter.PageAdapter; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DmpImportModel.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DmpImportModel.java index 231565c73..52b9a7971 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DmpImportModel.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DmpImportModel.java @@ -1,8 +1,8 @@ package eu.eudat.models.data.dmp; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement(name = "dmp") diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DmpProfileImportModel.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DmpProfileImportModel.java index 892fbea3a..04aec6abb 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DmpProfileImportModel.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DmpProfileImportModel.java @@ -1,7 +1,7 @@ package eu.eudat.models.data.dmp; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.UUID; @XmlRootElement(name = "dmpProfile") diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DynamicFieldWithValueImportModels.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DynamicFieldWithValueImportModels.java index faa8ac455..0acae369e 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DynamicFieldWithValueImportModels.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DynamicFieldWithValueImportModels.java @@ -1,6 +1,6 @@ package eu.eudat.models.data.dmp; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "dynamicFieldWithValue") public class DynamicFieldWithValueImportModels { diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/FieldImportModels.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/FieldImportModels.java index 76c8c4222..c2d5446ba 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/FieldImportModels.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/FieldImportModels.java @@ -1,8 +1,8 @@ package eu.eudat.models.data.dmp; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "field") public class FieldImportModels { diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/FunderImportModels.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/FunderImportModels.java index 3d672f135..42c4b3e51 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/FunderImportModels.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/FunderImportModels.java @@ -1,6 +1,6 @@ package eu.eudat.models.data.dmp; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.UUID; @XmlRootElement(name = "funder") diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/GrantImportModels.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/GrantImportModels.java index 7ee30845e..09b32df56 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/GrantImportModels.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/GrantImportModels.java @@ -1,6 +1,6 @@ package eu.eudat.models.data.dmp; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.UUID; @XmlRootElement(name = "grant") diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/OrganisationImportModel.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/OrganisationImportModel.java index 9dc4c6233..ec3f0f5ca 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/OrganisationImportModel.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/OrganisationImportModel.java @@ -1,7 +1,7 @@ package eu.eudat.models.data.dmp; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "organisation") public class OrganisationImportModel { diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/ProjectImportModels.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/ProjectImportModels.java index 6c3ce2cdd..ddfd1c2dc 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/ProjectImportModels.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/ProjectImportModels.java @@ -1,6 +1,6 @@ package eu.eudat.models.data.dmp; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.UUID; @XmlRootElement(name = "project") diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/ResearcherImportModels.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/ResearcherImportModels.java index 1eafef77e..dfbc1c68b 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/ResearcherImportModels.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/ResearcherImportModels.java @@ -1,7 +1,7 @@ package eu.eudat.models.data.dmp; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "researcher") public class ResearcherImportModels { diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/UserInfoImportModels.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/UserInfoImportModels.java index 47f1aef9b..708bef7ab 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/UserInfoImportModels.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/UserInfoImportModels.java @@ -1,6 +1,6 @@ package eu.eudat.models.data.dmp; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "userInfo") public class UserInfoImportModels { diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/adpter/PageAdapter.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/adpter/PageAdapter.java index d63628af6..ca62d7a8a 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/adpter/PageAdapter.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/adpter/PageAdapter.java @@ -5,7 +5,7 @@ import org.slf4j.LoggerFactory; import org.w3c.dom.Element; import org.w3c.dom.Node; -import javax.xml.bind.annotation.adapters.XmlAdapter; +import jakarta.xml.bind.annotation.adapters.XmlAdapter; import java.util.HashMap; import java.util.Map; diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/ExpandedResult.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/ExpandedResult.java index c247b5214..116c228db 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/ExpandedResult.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/ExpandedResult.java @@ -1,8 +1,8 @@ package eu.eudat.models.data.external.orcid; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "expanded-result", namespace = "http://www.orcid.org/ns/expanded-search") public class ExpandedResult { diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/ExpandedSearch.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/ExpandedSearch.java index d3a2cf6c6..dd8b1f88d 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/ExpandedSearch.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/ExpandedSearch.java @@ -1,7 +1,7 @@ package eu.eudat.models.data.external.orcid; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement(name = "expanded-search", namespace = "http://www.orcid.org/ns/expanded-search") diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/PersonalDetails.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/PersonalDetails.java index 3291e38ff..ac31c3254 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/PersonalDetails.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/PersonalDetails.java @@ -1,7 +1,7 @@ package eu.eudat.models.data.external.orcid; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.Arrays; @XmlRootElement(name = "personal-details", namespace = "http://www.orcid.org/ns/personal-details") diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/PersonalName.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/PersonalName.java index 4e97ec6d7..b57f48a19 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/PersonalName.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/external/orcid/PersonalName.java @@ -1,8 +1,8 @@ package eu.eudat.models.data.external.orcid; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement(name="name", namespace = "http://www.orcid.org/ns/personal-details") public class PersonalName { diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/invitation/Properties.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/invitation/Properties.java index f01def7f9..df87dada4 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/invitation/Properties.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/invitation/Properties.java @@ -1,7 +1,7 @@ package eu.eudat.models.data.invitation; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; @XmlRootElement public class Properties { diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DatasetRDAMapper.java b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DatasetRDAMapper.java index 256bdbe0a..71b7df1b0 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DatasetRDAMapper.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DatasetRDAMapper.java @@ -19,7 +19,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.time.Instant; import java.time.ZoneId; import java.time.format.DateTimeFormatter; diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DmpRDAMapper.java b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DmpRDAMapper.java index 420ebe5a3..219f3399f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DmpRDAMapper.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DmpRDAMapper.java @@ -11,8 +11,8 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import javax.persistence.NoResultException; -import javax.transaction.Transactional; +import jakarta.persistence.NoResultException; +import jakarta.transaction.Transactional; import java.io.IOException; import java.util.*; import java.util.stream.Collectors; diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/FundingRDAMapper.java b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/FundingRDAMapper.java index cc31766f3..2e692478f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/FundingRDAMapper.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/FundingRDAMapper.java @@ -6,7 +6,7 @@ import eu.eudat.data.entities.Grant; import eu.eudat.logic.services.ApiContext; import eu.eudat.models.rda.Funding; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.Date; import java.util.UUID; diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/ProjectRDAMapper.java b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/ProjectRDAMapper.java index add67c68e..2eccb27c7 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/ProjectRDAMapper.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/ProjectRDAMapper.java @@ -7,7 +7,7 @@ import eu.eudat.models.rda.Project; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.*; public class ProjectRDAMapper { diff --git a/dmp-backend/web/src/main/java/eu/eudat/publicapi/controllers/PublicDmpsDocumentation.java b/dmp-backend/web/src/main/java/eu/eudat/publicapi/controllers/PublicDmpsDocumentation.java index 98d7db4ac..b58c4bfec 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/publicapi/controllers/PublicDmpsDocumentation.java +++ b/dmp-backend/web/src/main/java/eu/eudat/publicapi/controllers/PublicDmpsDocumentation.java @@ -20,7 +20,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.validation.Valid; +import jakarta.validation.Valid; import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; diff --git a/dmp-backend/web/src/main/java/eu/eudat/publicapi/managers/DatasetPublicManager.java b/dmp-backend/web/src/main/java/eu/eudat/publicapi/managers/DatasetPublicManager.java index 7e88973c0..d2b27919d 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/publicapi/managers/DatasetPublicManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/publicapi/managers/DatasetPublicManager.java @@ -26,7 +26,7 @@ import org.springframework.stereotype.Component; import org.w3c.dom.Document; import org.w3c.dom.Element; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.*; import java.util.stream.Collectors; diff --git a/dmp-backend/web/src/main/java/eu/eudat/publicapi/request/dmp/DataManagmentPlanPublicTableRequest.java b/dmp-backend/web/src/main/java/eu/eudat/publicapi/request/dmp/DataManagmentPlanPublicTableRequest.java index 28b622afd..c28bf6040 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/publicapi/request/dmp/DataManagmentPlanPublicTableRequest.java +++ b/dmp-backend/web/src/main/java/eu/eudat/publicapi/request/dmp/DataManagmentPlanPublicTableRequest.java @@ -8,7 +8,7 @@ import eu.eudat.queryable.QueryableList; import eu.eudat.queryable.types.FieldSelectionType; import eu.eudat.queryable.types.SelectionField; -import javax.persistence.criteria.Predicate; +import jakarta.persistence.criteria.Predicate; import java.util.*; import java.util.stream.Collectors; diff --git a/dmp-frontend/package.json b/dmp-frontend/package.json index 3838fb831..20449d5be 100644 --- a/dmp-frontend/package.json +++ b/dmp-frontend/package.json @@ -4,7 +4,7 @@ "license": "MIT", "scripts": { "ng": "ng", - "start": "ng serve", + "start": "set NODE_OPTIONS=--openssl-legacy-provider && ng s -o", "build": "ng build --configuration production", "test": "ng test", "lint": "ng lint",