]> juplo.de Git - hibernate-maven-plugin/commitdiff
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 8d548fd174c006f02e7fbc2db43f591a06eee22f..6071105d3f28eb3899f50e79f73b2381438f3486 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 7220a74d0c1a743a4c970883a1e2a7ca71e1178b..948dbf53633cb5bad0f8ff182782747262162b76 100644 (file)
@@ -66,7 +66,7 @@
                                        </execution>
                                </executions>
                                <configuration>
-                                       <export>false</export>
+                                       <execute>false</execute>
                                        <envers>true</envers>
                                        <format>true</format>
                                        <delimiter>;</delimiter>
index 25ee7a970044ad1272bf25f31101d5dd46d5f088..b7bc4cb9d016da28863c4ba74132a02894d87412 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 792ecc6d7e2cfc9acbfe4a1bca3f73e295b6bb10..800e70e7fa359a6fcababfbc5b71c99dd1f4487e 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 c77f3b3916abc3fe0ef9c0fd4c490fe29f2d7d32..9880d5135433d0b69eee45d8afa035f083242027 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 1dab9a54e576f2a084856bc856b2c5f530cb9064..32603c3be7820b2eae6deb9f62e0923ae1ed3e6b 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 2323bd214aa00e6846056e20e474c2f03de867e2..513633f16ad089f50ed838a4d94e31d711791d6a 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 1ceb830c882bf6a8bc40a711de93f6341d861937..0bc972ff72697e2bae64f6fd0ff7b1c67f9214c8 100644 (file)
@@ -68,7 +68,7 @@
           </execution>
         </executions>
         <configuration>
-          <export>false</export>
+          <execute>false</execute>
           <format>true</format>
         </configuration>
       </plugin>
index ac24f7f567d3da30593eaf71563d5dcab1c88d1b..833a43a467388f6a7abfaf503616ff8306c6d253 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 6aa0cc30deec2778a40f51e72be609c1f71c71dd..b1ac0d850d0431eeb2f0a135061eb9dd48b28d0d 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 922b77db69fdab1bf77ad09f732f7cfebe88c1f7..6f224b09668f5cde13426918d71a84b92162fce3 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 4e4fdcbb16b3bd7876576e30df63dff373c6d49c..ee3586f74a216676c2e01db19ce800449a4e5132 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 ff1ca5ef65c2818562f5e2dd86e8df2ed2e16390..65324755d34f93b22a87a338cbc15484ffd0f8ee 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 3d8c616406e1ddd97401d779c806dafc9b8cc0cc..a8eb5ab7c204aa82106b7d44ee5678fed57cf9ed 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>