No configuration for hibernate.dialect might be a valid configuration too
authorKai Moritz <kai@juplo.de>
Wed, 18 Sep 2013 16:15:38 +0000 (18:15 +0200)
committerKai Moritz <kai@juplo.de>
Wed, 18 Sep 2013 16:15:38 +0000 (18:15 +0200)
src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java

index 6c4c31a..5c3b5c7 100644 (file)
@@ -552,15 +552,27 @@ public class Hbm2DdlMojo extends AbstractMojo
         getLog().debug("SQL-dialect unchanged.");
       else
       {
-        getLog().debug("SQL-dialect changed: " + dialect);
         modified = true;
-        md5s.put(DIALECT, dialect);
+        if (dialect == null)
+        {
+          getLog().debug("SQL-dialect was unset.");
+          md5s.remove(DIALECT);
+        }
+        else
+        {
+          getLog().debug("SQL-dialect changed: " + dialect);
+          md5s.put(DIALECT, dialect);
+        }
       }
     }
     else
     {
-      modified = true;
-      md5s.put(DIALECT, properties.getProperty(DIALECT));
+      String dialect = properties.getProperty(DIALECT);
+      if (dialect != null)
+      {
+        modified = true;
+        md5s.put(DIALECT, properties.getProperty(DIALECT));
+      }
     }
 
     /** The generated SQL varies with the envers-configuration */