summaryrefslogtreecommitdiffstats
path: root/models-provider/src/main/java
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2023-02-02 14:43:12 +0000
committerliamfallon <liam.fallon@est.tech>2023-02-07 09:17:33 +0000
commite53df8d3f8ab0464b0876bdb339fa91dc9085cd2 (patch)
treee01029186ff980f7e00901c28aba09b80a85f8e8 /models-provider/src/main/java
parente3938e43b8a1f02f74368ecb75c38530285feac0 (diff)
Replace Eclipselink with Hibernate
Issue-ID: POLICY-4533 Change-Id: I77a6c44c96013963e141265758629cae83e49876 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-provider/src/main/java')
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/impl/ModelsProvider.java18
1 files changed, 9 insertions, 9 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 36c762e01..d90847f56 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 Nordix Foundation.
+ * Copyright (C) 2021,2023 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@ import java.util.Properties;
import javax.ws.rs.core.Response;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.eclipse.persistence.config.PersistenceUnitProperties;
import org.onap.policy.models.base.PfModelException;
import org.onap.policy.models.dao.DaoParameters;
import org.onap.policy.models.dao.PfDao;
@@ -48,13 +47,14 @@ public final class ModelsProvider {
// @formatter:off
var jdbcProperties = new Properties();
- jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_DRIVER, parameters.getDatabaseDriver());
- jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_URL, parameters.getDatabaseUrl());
- jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_USER, parameters.getDatabaseUser());
- jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_PASSWORD, parameters.getDatabasePassword());
- jdbcProperties.setProperty(PersistenceUnitProperties.TARGET_DATABASE,
- (parameters.getDatabaseType() == null ? "MySQL" : parameters.getDatabaseType()));
- // @formatter:on
+ jdbcProperties.setProperty("javax.persistence.jdbc.driver", parameters.getDatabaseDriver());
+ jdbcProperties.setProperty("javax.persistence.jdbc.url", parameters.getDatabaseUrl());
+ jdbcProperties.setProperty("javax.persistence.jdbc.user", parameters.getDatabaseUser());
+ jdbcProperties.setProperty("javax.persistence.jdbc.password", parameters.getDatabasePassword());
+ jdbcProperties.setProperty("hibernate.dialect",
+ (parameters.getDatabaseType() == null
+ ? "org.hibernate.dialect.MariaDBDialect"
+ : parameters.getDatabaseType())); // @formatter:on
daoParameters.setJdbcProperties(jdbcProperties);