Replace Eclipselink with Hibernate
[policy/drools-applications.git] / controlloop / common / eventmanager / src / main / java / org / onap / policy / controlloop / ophistory / OperationHistoryDataManagerParams.java
index c93ac8b..054f4b1 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 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.
@@ -41,7 +42,7 @@ import org.onap.policy.common.parameters.annotations.NotNull;
 public class OperationHistoryDataManagerParams {
     public static final String DEFAULT_PU = "OperationsHistoryPU";
     public static final String DEFAULT_DRIVER = "org.mariadb.jdbc.Driver";
-    public static final String DEFAULT_TYPE = "MySQL";
+    public static final String DEFAULT_TYPE = "MariaDB";
 
     @NotBlank
     private String url;
@@ -85,4 +86,12 @@ public class OperationHistoryDataManagerParams {
     public ValidationResult validate(String resultName) {
         return new BeanValidator().validateTop(resultName, this);
     }
+
+    /**
+     * Return the Hibernate dialect for the database type.
+     * @return the dialect
+     */
+    public Object getDbHibernateDialect() {
+        return "org.hibernate.dialect." + dbType + "Dialect";
+    }
 }