From e53df8d3f8ab0464b0876bdb339fa91dc9085cd2 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Thu, 2 Feb 2023 14:43:12 +0000 Subject: Replace Eclipselink with Hibernate Issue-ID: POLICY-4533 Change-Id: I77a6c44c96013963e141265758629cae83e49876 Signed-off-by: liamfallon --- .../policy/models/provider/impl/ModelsProvider.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'models-provider/src/main') 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); -- cgit 1.2.3-korg