src/main/kotlin/de/uapcore/lightpit/DataSourceProvider.kt

changeset 158
4f912cd42876
parent 151
b3f14cd4f3ab
child 167
3f30adba1c63
--- a/src/main/kotlin/de/uapcore/lightpit/DataSourceProvider.kt	Thu Nov 05 13:37:48 2020 +0100
+++ b/src/main/kotlin/de/uapcore/lightpit/DataSourceProvider.kt	Fri Nov 06 10:50:32 2020 +0100
@@ -34,23 +34,23 @@
 import javax.servlet.annotation.WebListener
 import javax.sql.DataSource
 
-enum class DatabaseDialect {
-    Postgres
-}
-
 /**
  * Provides access to the database.
  */
 @WebListener
 class DataSourceProvider : ServletContextListener, LoggingTrait {
 
+    enum class Dialect {
+        Postgres
+    }
+
     /**
      * The database dialect to use.
      * May be overridden by context parameter.
      *
      * @see Constants.CTX_ATTR_DB_DIALECT
      */
-    var dialect = DatabaseDialect.Postgres; private set
+    var dialect = Dialect.Postgres; private set
 
     /**
      * The data source, if available.
@@ -130,7 +130,7 @@
         val dbSchema = sc.getInitParameter(Constants.CTX_ATTR_DB_SCHEMA) ?: DB_DEFAULT_SCHEMA
         sc.getInitParameter(Constants.CTX_ATTR_DB_DIALECT)?.let {dbDialect ->
             try {
-                dialect = DatabaseDialect.valueOf(dbDialect)
+                dialect = Dialect.valueOf(dbDialect)
             } catch (ex: IllegalArgumentException) {
                 logger().error(
                     "Unknown or unsupported database dialect {}. Defaulting to {}.",

mercurial