Renemed hibernate.schema.export to hibernate.schema.execute
authorKai Moritz <kai@juplo.de>
Sun, 6 Nov 2016 13:52:37 +0000 (14:52 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 13 Nov 2016 16:37:15 +0000 (17:37 +0100)
14 files changed:
src/it/dependency test/h4mp/pom.xml
src/it/h4mp-mod/pom.xml
src/it/hib-test/pom.xml
src/it/hibernate4-maven-plugin-envers-sample/README.md
src/it/hibernate4-maven-plugin-envers-sample/pom.xml
src/it/ignored-dependency/main/pom.xml
src/it/multimodule/shared/pom.xml
src/it/multiple-persistence-units/pom.xml
src/it/properties/pom.xml
src/it/tutorials/osgi/managed-jpa/pom.xml
src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java
src/site/xhtml/force.xhtml
src/site/xhtml/index.xhtml
src/site/xhtml/pitfalls.xhtml

index 8d548fd..6071105 100644 (file)
@@ -72,7 +72,7 @@
                                </executions>
                                <configuration>
                                        <persistenceUnit>primary</persistenceUnit>
-                                       <export>false</export>
+                                       <execute>false</execute>
                                        <envers>true</envers>
                                        <format>true</format>
                                        <delimiter>;</delimiter>
index 7220a74..948dbf5 100644 (file)
@@ -66,7 +66,7 @@
                                        </execution>
                                </executions>
                                <configuration>
-                                       <export>false</export>
+                                       <execute>false</execute>
                                        <envers>true</envers>
                                        <format>true</format>
                                        <delimiter>;</delimiter>
index 25ee7a9..b7bc4cb 100644 (file)
@@ -46,7 +46,7 @@
         <version>@project.version@</version>
         <configuration>
           <!-- Generat schema only, no DB connection needed -->
-          <export>false</export>
+          <execute>false</execute>
           <format>true</format>
         </configuration>
         <executions>
index 792ecc6..800e70e 100644 (file)
@@ -30,7 +30,7 @@ Usage
 
 __Rebuild the SQL-script using the Hibernate4-maven-plugin to create the database__
 
-    mvn -PcreateHsqlDbScript clean compile hibernate:export
+    mvn -PcreateHsqlDbScript clean compile hibernate:create
 
 __Build and run the integration tests__
 
index c77f3b3..9880d51 100644 (file)
                     </execution>
                 </executions>
                 <configuration>
-                    <export>false</export>
+                    <execute>false</execute>
                     <driver>org.hsqldb.jdbc.JDBCDriver</driver>
                     <dialect>org.hibernate.dialect.HSQLDialect</dialect>
                     <envers>true</envers>
index 1dab9a5..32603c3 100644 (file)
@@ -40,7 +40,7 @@
           </execution>
         </executions>
         <configuration>
-          <export>false</export>
+          <execute>false</execute>
           <format>true</format>
           <drop>false</drop>
           <dialect>org.hibernate.dialect.PostgreSQL9Dialect</dialect>
index 2323bd2..513633f 100644 (file)
                     <physicalNamingStrategy>ch.dvbern.demo.persistence.DemoPhysicalNamingStrategyImpl
                     </physicalNamingStrategy>
                     <!--verhindert, dass das Plugin versucht das schema physisch in eine DB zu schreiben-->
-                    <export>false</export>
+                    <execute>false</execute>
                     <format>true</format>
                     <force>true</force>
                     <!--File in welches das Schema exportiert wird (defaultist create.sql)-->
index 1ceb830..0bc972f 100644 (file)
@@ -68,7 +68,7 @@
           </execution>
         </executions>
         <configuration>
-          <export>false</export>
+          <execute>false</execute>
           <format>true</format>
         </configuration>
       </plugin>
index ac24f7f..833a43a 100644 (file)
@@ -36,7 +36,7 @@
         <version>@project.version@</version>
         <configuration>
           <!-- Gnerate schema only, no DB connection needed -->
-          <export>false</export>
+          <execute>false</execute>
         </configuration>
         <executions>
           <execution>
index 6aa0cc3..b1ac0d8 100644 (file)
@@ -82,7 +82,7 @@
                                <configuration>
                                        <url>jdbc:h2:mem:db1;MVCC=TRUE</url>
                                        <format>true</format>
-                                       <export>false</export>
+                                       <execute>false</execute>
                                </configuration>
                        </plugin>
                </plugins>
index 922b77d..6f224b0 100644 (file)
@@ -88,7 +88,7 @@ import org.scannotation.AnnotationDB;
  */
 public abstract class AbstractSchemaMojo extends AbstractMojo
 {
-  public final static String EXPORT = "hibernate.schema.export";
+  public final static String EXECUTE = "hibernate.schema.execute";
   public final static String OUTPUTDIRECTORY = "project.build.outputDirectory";
   public final static String SCAN_CLASSES = "hibernate.schema.scan.classes";
   public final static String SCAN_DEPENDENCIES = "hibernate.schema.scan.dependencies";
@@ -127,7 +127,7 @@ public abstract class AbstractSchemaMojo extends AbstractMojo
   /** Parameters to configure the genaration of the SQL *********************/
 
   /**
-   * Export the database-schma to the database.
+   * Excecute the generated SQL.
    * If set to <code>false</code>, only the SQL-script is created and the
    * database is not touched.
    * <p>
@@ -137,10 +137,10 @@ public abstract class AbstractSchemaMojo extends AbstractMojo
    * it is not known by Hibernate nor JPA and, hence, not picked up from
    * their configuration!
    *
-   * @parameter property="hibernate.schema.export" default-value="true"
+   * @parameter property="hibernate.schema.execute" default-value="true"
    * @since 2.0
    */
-  private Boolean export;
+  private Boolean execute;
 
   /**
    * Skip execution
@@ -165,10 +165,11 @@ public abstract class AbstractSchemaMojo extends AbstractMojo
   private boolean skip;
 
   /**
-   * Force execution
+   * Force generation/execution
    * <p>
-   * Force execution, even if no modified or newly added annotated classes
-   * where found and the dialect was not changed.
+   * Force the generation and (if configured) the execution of the SQL, even if
+   * no modified or newly added annotated classes where found and the
+   * configuration was not changed.
    * <p>
    * <code>skip</code> takes precedence over <code>force</code>.
    * <p>
@@ -627,11 +628,9 @@ public abstract class AbstractSchemaMojo extends AbstractMojo
       /** Skip execution, if mapping and configuration is unchanged */
       if (!tracker.modified())
       {
-        getLog().info(
-            "Mapping and configuration unchanged."
-            );
+        getLog().info("Mapping and configuration unchanged.");
         if (force)
-          getLog().info("Schema generation is forced!");
+          getLog().info("Generation/execution is forced!");
         else
         {
           getLog().info("Skipping schema generation!");
@@ -696,7 +695,7 @@ public abstract class AbstractSchemaMojo extends AbstractMojo
           SchemaManagementToolCoordinator
               .buildExecutionOptions(settings, handler);
       final EnumSet<TargetType> targetTypes = EnumSet.of(TargetType.SCRIPT);
-      if (export)
+      if (execute)
         targetTypes.add(TargetType.DATABASE);
       TargetDescriptor target = new TargetDescriptor()
       {
@@ -916,10 +915,10 @@ public abstract class AbstractSchemaMojo extends AbstractMojo
       throws MojoFailureException
   {
     /**
-     * Special treatment for the configuration-value "export": if it is
+     * Special treatment for the configuration-value "execute": if it is
      * switched to "true", the genearation fo the schema should be forced!
      */
-    if (tracker.check(EXPORT, export.toString()) && export)
+    if (tracker.check(EXECUTE, execute.toString()) && execute)
       tracker.touch();
 
     /**
index 4e4fdcb..ee3586f 100644 (file)
@@ -9,8 +9,9 @@
   The hibernate-maven-plugin computes MD5-sums for all found annotated
   classes and stores them together with the generated schema.
   If no classes were changed or added and the dialect wasn't changed too, it
-  automatically skips the configured schema-export, to speed up the development
-  cycle.
+  automatically skips the configured SQL-generation &mdash; and more
+  important in this respect &mdash; the execution of the generated SQL,
+  to speed up the development cycle.
   </p>
   <p>
   The plugin signals, that the execution was skipped by setting the maven
index ff1ca5e..6532475 100644 (file)
@@ -34,8 +34,8 @@
   </p>
   <p>
   Last but not least, in order to not slow down the development cycle, the
-  hibernate-maven-plugin only executes the schema-export, if the mapping
-  or the dialect changes (or if you force it to do so).
+  hibernate-maven-plugin only executes the generated SQL, if the mapping
+  or the configuration has changed (or if you force it to do so).
   </p>
   <p>
   For more information about the inspiration to write this tiny plugin,
@@ -52,8 +52,7 @@
    See <a href="./drop-mojo.html">hibernate:drop</a> and
    <a href="./plugin-info.html">Plugin Documentation</a> for the full
    autogenerated documentation. These are mostly configuration-options
-   of the Hibernate-Tools <code>SchemaExport</code> and <code>SchemaUpdate</code>, that do
-   the work in the background.
+   from the Hibernate-Tooling, that does the work in the background.
    </li>
   </ul>
   <h2>Releases</h2>
index 3d8c616..a8eb5ab 100644 (file)
   </p>
   <h2>hibernate-maven-plugin always needs a database-connection</h2>
   <p>
-  The default-configuration exports the created schema to the configured
-  database.
+  The default-configuration executes the created SQL.
   Therefore, it needs a valid database-connection and fails, if none is
   available.
-  If you do not need to export the created schema to a database,
-  you can set the property <code>hibernate.schema.export</code> to
+  If you do not need the generated SQL to be executed automatically,
+  you can set the property <code>hibernate.schema.execute</code> to
   <code>false</code>.
   This can be achieved with the command-line parameter
-  <code>-Dhibernate.schema.export=false</code> or with the following
+  <code>-Dhibernate.schema.execute=false</code> or with the following
   configuration:
   </p>
   <pre class="prettyprint linenums lang-html">
 &lt;configuration&gt;
-  &lt;export&gt;false&lt;/export&gt;
+  &lt;execute&gt;false&lt;/execute&gt;
 &lt;/configuration&gt;</pre>
   <p>
   But even when no database is to be created, hibernate always needs to know
   </p>
   <p>
   A quick fix to this problem is, to <a href="./force.html">force</a>
-  hibernate-maven-plugin to export the schema every time it is running.
+  hibernate-maven-plugin to generate and execute the SQL every time it is running.
   But to recreate the database on every testrun may noticeable slow down your
   development cycle, if you have to wait for slow IO.
   </p>