diff options
Diffstat (limited to 'models-provider/src')
6 files changed, 7 insertions, 18 deletions
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/impl/ModelsProvider.java b/models-provider/src/main/java/org/onap/policy/models/provider/impl/ModelsProvider.java index 527f0ddee..4d8869752 100644 --- a/models-provider/src/main/java/org/onap/policy/models/provider/impl/ModelsProvider.java +++ b/models-provider/src/main/java/org/onap/policy/models/provider/impl/ModelsProvider.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021, 2023 Nordix Foundation. + * Copyright (C) 2021, 2023-2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,16 +45,11 @@ public final class ModelsProvider { daoParameters.setPluginClass(DefaultPfDao.class.getName()); daoParameters.setPersistenceUnit(parameters.getPersistenceUnit()); - // @formatter:off var jdbcProperties = new Properties(); jdbcProperties.setProperty("jakarta.persistence.jdbc.driver", parameters.getDatabaseDriver()); jdbcProperties.setProperty("jakarta.persistence.jdbc.url", parameters.getDatabaseUrl()); jdbcProperties.setProperty("jakarta.persistence.jdbc.user", parameters.getDatabaseUser()); jdbcProperties.setProperty("jakarta.persistence.jdbc.password", parameters.getDatabasePassword()); - jdbcProperties.setProperty("hibernate.dialect", - (parameters.getDatabaseType() == null - ? "org.hibernate.dialect.MariaDBDialect" - : parameters.getDatabaseType())); // @formatter:on daoParameters.setJdbcProperties(jdbcProperties); diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java index 6cf56cb96..2af0f0cec 100644 --- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java +++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019-2023 Nordix Foundation. + * Copyright (C) 2019-2024 Nordix Foundation. * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2020, 2022 Bell Canada. All rights reserved. * ================================================================================ @@ -90,7 +90,6 @@ public class DatabasePolicyModelsProviderTest { parameters.setDatabaseUser("policy"); parameters.setDatabasePassword("P01icY"); parameters.setPersistenceUnit("ToscaConceptTest"); - parameters.setDatabaseType("org.hibernate.dialect.H2Dialect"); } /** diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyToscaPersistenceTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyToscaPersistenceTest.java index 1f9931678..3db058c27 100644 --- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyToscaPersistenceTest.java +++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyToscaPersistenceTest.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019-2021,2023 Nordix Foundation. + * Copyright (C) 2019-2021, 2023-2024 Nordix Foundation. * Modifications Copyright (C) 2020 Bell Canada. All rights reserved. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ @@ -81,11 +81,9 @@ public class PolicyToscaPersistenceTest { if (System.getProperty("USE-MARIADB") != null) { parameters.setDatabaseDriver("org.mariadb.jdbc.Driver"); parameters.setDatabaseUrl("jdbc:mariadb://localhost:3306/policy"); - parameters.setDatabaseType("org.hibernate.dialect.MariaDBDialect"); } else { parameters.setDatabaseDriver("org.h2.Driver"); parameters.setDatabaseUrl("jdbc:h2:mem:PolicyToscaPersistenceTest"); - parameters.setDatabaseType("org.hibernate.dialect.H2Dialect"); } parameters.setDatabaseUser("policy"); diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyTypePersistenceTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyTypePersistenceTest.java index 978a30346..11e8381af 100644 --- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyTypePersistenceTest.java +++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyTypePersistenceTest.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019-2021,2023 Nordix Foundation. + * Copyright (C) 2019-2021, 2023-2024 Nordix Foundation. * Modifications Copyright (C) 2020 Bell Canada. All rights reserved. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ @@ -66,11 +66,9 @@ public class PolicyTypePersistenceTest { if (System.getProperty("USE-MARIADB") != null) { parameters.setDatabaseDriver("org.mariadb.jdbc.Driver"); parameters.setDatabaseUrl("jdbc:mariadb://localhost:3306/policy"); - parameters.setDatabaseType("org.hibernate.dialect.MariaDBDialect"); } else { parameters.setDatabaseDriver("org.h2.Driver"); parameters.setDatabaseUrl("jdbc:h2:mem:PolicyToscaPersistenceTest"); - parameters.setDatabaseType("org.hibernate.dialect.H2Dialect"); } parameters.setDatabaseUser("policy"); diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/revisionhierarchy/HierarchyFetchTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/revisionhierarchy/HierarchyFetchTest.java index 2d2723f0f..015bbc552 100644 --- a/models-provider/src/test/java/org/onap/policy/models/provider/revisionhierarchy/HierarchyFetchTest.java +++ b/models-provider/src/test/java/org/onap/policy/models/provider/revisionhierarchy/HierarchyFetchTest.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2020-2021,2023 Nordix Foundation. + * Copyright (C) 2020-2021, 2023-2024 Nordix Foundation. * Modifications Copyright (C) 2020 Bell Canada. All rights reserved. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ @@ -55,7 +55,6 @@ public class HierarchyFetchTest { parameters.setDatabaseUser("policy"); parameters.setDatabasePassword("P01icY"); parameters.setPersistenceUnit("ToscaConceptTest"); - parameters.setDatabaseType("org.hibernate.dialect.H2Dialect"); } /** diff --git a/models-provider/src/test/resources/META-INF/persistence.xml b/models-provider/src/test/resources/META-INF/persistence.xml index 0e5a91844..18ad8e34a 100644 --- a/models-provider/src/test/resources/META-INF/persistence.xml +++ b/models-provider/src/test/resources/META-INF/persistence.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- ============LICENSE_START======================================================= - Copyright (C) 2019-2021,2023 Nordix Foundation. + Copyright (C) 2019-2021, 2023-2024 Nordix Foundation. Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. Modifications Copyright (C) 2023 Bell Canada. All rights reserved. ================================================================================ @@ -56,7 +56,7 @@ <class>org.onap.policy.models.tosca.simple.concepts.JpaToscaTrigger</class> <properties> - <property name="javax.persistence.schema-generation.database.action" value="drop-and-create" /> + <property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create" /> <property name="hibernate.enable_lazy_load_no_trans" value="true" /> <property name="hibernate.show_sql" value="false" /> </properties> |