projects
/
hibernate4-maven-plugin
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c81cd2f
)
Renemed hibernate.schema.export to hibernate.schema.execute
author
Kai Moritz
<kai@juplo.de>
Sun, 6 Nov 2016 13:52:37 +0000
(14:52 +0100)
committer
Kai 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
patch
|
blob
|
history
src/it/h4mp-mod/pom.xml
patch
|
blob
|
history
src/it/hib-test/pom.xml
patch
|
blob
|
history
src/it/hibernate4-maven-plugin-envers-sample/README.md
patch
|
blob
|
history
src/it/hibernate4-maven-plugin-envers-sample/pom.xml
patch
|
blob
|
history
src/it/ignored-dependency/main/pom.xml
patch
|
blob
|
history
src/it/multimodule/shared/pom.xml
patch
|
blob
|
history
src/it/multiple-persistence-units/pom.xml
patch
|
blob
|
history
src/it/properties/pom.xml
patch
|
blob
|
history
src/it/tutorials/osgi/managed-jpa/pom.xml
patch
|
blob
|
history
src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java
patch
|
blob
|
history
src/site/xhtml/force.xhtml
patch
|
blob
|
history
src/site/xhtml/index.xhtml
patch
|
blob
|
history
src/site/xhtml/pitfalls.xhtml
patch
|
blob
|
history
diff --git
a/src/it/dependency test/h4mp/pom.xml
b/src/it/dependency test/h4mp/pom.xml
index
8d548fd
..
6071105
100644
(file)
--- a/
src/it/dependency test/h4mp/pom.xml
+++ b/
src/it/dependency test/h4mp/pom.xml
@@
-72,7
+72,7
@@
</executions>
<configuration>
<persistenceUnit>primary</persistenceUnit>
</executions>
<configuration>
<persistenceUnit>primary</persistenceUnit>
- <ex
port>false</export
>
+ <ex
ecute>false</execute
>
<envers>true</envers>
<format>true</format>
<delimiter>;</delimiter>
<envers>true</envers>
<format>true</format>
<delimiter>;</delimiter>
diff --git
a/src/it/h4mp-mod/pom.xml
b/src/it/h4mp-mod/pom.xml
index
7220a74
..
948dbf5
100644
(file)
--- a/
src/it/h4mp-mod/pom.xml
+++ b/
src/it/h4mp-mod/pom.xml
@@
-66,7
+66,7
@@
</execution>
</executions>
<configuration>
</execution>
</executions>
<configuration>
- <ex
port>false</export
>
+ <ex
ecute>false</execute
>
<envers>true</envers>
<format>true</format>
<delimiter>;</delimiter>
<envers>true</envers>
<format>true</format>
<delimiter>;</delimiter>
diff --git
a/src/it/hib-test/pom.xml
b/src/it/hib-test/pom.xml
index
25ee7a9
..
b7bc4cb
100644
(file)
--- a/
src/it/hib-test/pom.xml
+++ b/
src/it/hib-test/pom.xml
@@
-46,7
+46,7
@@
<version>@project.version@</version>
<configuration>
<!-- Generat schema only, no DB connection needed -->
<version>@project.version@</version>
<configuration>
<!-- Generat schema only, no DB connection needed -->
- <ex
port>false</export
>
+ <ex
ecute>false</execute
>
<format>true</format>
</configuration>
<executions>
<format>true</format>
</configuration>
<executions>
diff --git
a/src/it/hibernate4-maven-plugin-envers-sample/README.md
b/src/it/hibernate4-maven-plugin-envers-sample/README.md
index
792ecc6
..
800e70e
100644
(file)
--- a/
src/it/hibernate4-maven-plugin-envers-sample/README.md
+++ b/
src/it/hibernate4-maven-plugin-envers-sample/README.md
@@
-30,7
+30,7
@@
Usage
__Rebuild the SQL-script using the Hibernate4-maven-plugin to create the database__
__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__
__Build and run the integration tests__
diff --git
a/src/it/hibernate4-maven-plugin-envers-sample/pom.xml
b/src/it/hibernate4-maven-plugin-envers-sample/pom.xml
index
c77f3b3
..
9880d51
100644
(file)
--- a/
src/it/hibernate4-maven-plugin-envers-sample/pom.xml
+++ b/
src/it/hibernate4-maven-plugin-envers-sample/pom.xml
@@
-203,7
+203,7
@@
</execution>
</executions>
<configuration>
</execution>
</executions>
<configuration>
- <ex
port>false</export
>
+ <ex
ecute>false</execute
>
<driver>org.hsqldb.jdbc.JDBCDriver</driver>
<dialect>org.hibernate.dialect.HSQLDialect</dialect>
<envers>true</envers>
<driver>org.hsqldb.jdbc.JDBCDriver</driver>
<dialect>org.hibernate.dialect.HSQLDialect</dialect>
<envers>true</envers>
diff --git
a/src/it/ignored-dependency/main/pom.xml
b/src/it/ignored-dependency/main/pom.xml
index
1dab9a5
..
32603c3
100644
(file)
--- a/
src/it/ignored-dependency/main/pom.xml
+++ b/
src/it/ignored-dependency/main/pom.xml
@@
-40,7
+40,7
@@
</execution>
</executions>
<configuration>
</execution>
</executions>
<configuration>
- <ex
port>false</export
>
+ <ex
ecute>false</execute
>
<format>true</format>
<drop>false</drop>
<dialect>org.hibernate.dialect.PostgreSQL9Dialect</dialect>
<format>true</format>
<drop>false</drop>
<dialect>org.hibernate.dialect.PostgreSQL9Dialect</dialect>
diff --git
a/src/it/multimodule/shared/pom.xml
b/src/it/multimodule/shared/pom.xml
index
2323bd2
..
513633f
100644
(file)
--- a/
src/it/multimodule/shared/pom.xml
+++ b/
src/it/multimodule/shared/pom.xml
@@
-120,7
+120,7
@@
<physicalNamingStrategy>ch.dvbern.demo.persistence.DemoPhysicalNamingStrategyImpl
</physicalNamingStrategy>
<!--verhindert, dass das Plugin versucht das schema physisch in eine DB zu schreiben-->
<physicalNamingStrategy>ch.dvbern.demo.persistence.DemoPhysicalNamingStrategyImpl
</physicalNamingStrategy>
<!--verhindert, dass das Plugin versucht das schema physisch in eine DB zu schreiben-->
- <ex
port>false</export
>
+ <ex
ecute>false</execute
>
<format>true</format>
<force>true</force>
<!--File in welches das Schema exportiert wird (defaultist create.sql)-->
<format>true</format>
<force>true</force>
<!--File in welches das Schema exportiert wird (defaultist create.sql)-->
diff --git
a/src/it/multiple-persistence-units/pom.xml
b/src/it/multiple-persistence-units/pom.xml
index
1ceb830
..
0bc972f
100644
(file)
--- a/
src/it/multiple-persistence-units/pom.xml
+++ b/
src/it/multiple-persistence-units/pom.xml
@@
-68,7
+68,7
@@
</execution>
</executions>
<configuration>
</execution>
</executions>
<configuration>
- <ex
port>false</export
>
+ <ex
ecute>false</execute
>
<format>true</format>
</configuration>
</plugin>
<format>true</format>
</configuration>
</plugin>
diff --git
a/src/it/properties/pom.xml
b/src/it/properties/pom.xml
index
ac24f7f
..
833a43a
100644
(file)
--- a/
src/it/properties/pom.xml
+++ b/
src/it/properties/pom.xml
@@
-36,7
+36,7
@@
<version>@project.version@</version>
<configuration>
<!-- Gnerate schema only, no DB connection needed -->
<version>@project.version@</version>
<configuration>
<!-- Gnerate schema only, no DB connection needed -->
- <ex
port>false</export
>
+ <ex
ecute>false</execute
>
</configuration>
<executions>
<execution>
</configuration>
<executions>
<execution>
diff --git
a/src/it/tutorials/osgi/managed-jpa/pom.xml
b/src/it/tutorials/osgi/managed-jpa/pom.xml
index
6aa0cc3
..
b1ac0d8
100644
(file)
--- a/
src/it/tutorials/osgi/managed-jpa/pom.xml
+++ b/
src/it/tutorials/osgi/managed-jpa/pom.xml
@@
-82,7
+82,7
@@
<configuration>
<url>jdbc:h2:mem:db1;MVCC=TRUE</url>
<format>true</format>
<configuration>
<url>jdbc:h2:mem:db1;MVCC=TRUE</url>
<format>true</format>
- <ex
port>false</export
>
+ <ex
ecute>false</execute
>
</configuration>
</plugin>
</plugins>
</configuration>
</plugin>
</plugins>
diff --git
a/src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java
b/src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java
index
922b77d
..
6f224b0
100644
(file)
--- a/
src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java
+++ b/
src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java
@@
-88,7
+88,7
@@
import org.scannotation.AnnotationDB;
*/
public abstract class AbstractSchemaMojo extends AbstractMojo
{
*/
public abstract class AbstractSchemaMojo extends AbstractMojo
{
- public final static String EX
PORT = "hibernate.schema.export
";
+ public final static String EX
ECUTE = "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";
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 *********************/
/**
/** Parameters to configure the genaration of the SQL *********************/
/**
- * Ex
port the database-schma to the database
.
+ * Ex
cecute the generated SQL
.
* If set to <code>false</code>, only the SQL-script is created and the
* database is not touched.
* <p>
* 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!
*
* it is not known by Hibernate nor JPA and, hence, not picked up from
* their configuration!
*
- * @parameter property="hibernate.schema.ex
port
" default-value="true"
+ * @parameter property="hibernate.schema.ex
ecute
" default-value="true"
* @since 2.0
*/
* @since 2.0
*/
- private Boolean ex
port
;
+ private Boolean ex
ecute
;
/**
* Skip execution
/**
* Skip execution
@@
-165,10
+165,11
@@
public abstract class AbstractSchemaMojo extends AbstractMojo
private boolean skip;
/**
private boolean skip;
/**
- * Force execution
+ * Force
generation/
execution
* <p>
* <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>
* <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())
{
/** 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)
if (force)
- getLog().info("
Schema genera
tion is forced!");
+ getLog().info("
Generation/execu
tion is forced!");
else
{
getLog().info("Skipping schema generation!");
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);
SchemaManagementToolCoordinator
.buildExecutionOptions(settings, handler);
final EnumSet<TargetType> targetTypes = EnumSet.of(TargetType.SCRIPT);
- if (ex
port
)
+ if (ex
ecute
)
targetTypes.add(TargetType.DATABASE);
TargetDescriptor target = new TargetDescriptor()
{
targetTypes.add(TargetType.DATABASE);
TargetDescriptor target = new TargetDescriptor()
{
@@
-916,10
+915,10
@@
public abstract class AbstractSchemaMojo extends AbstractMojo
throws MojoFailureException
{
/**
throws MojoFailureException
{
/**
- * Special treatment for the configuration-value "ex
port
": if it is
+ * Special treatment for the configuration-value "ex
ecute
": if it is
* switched to "true", the genearation fo the schema should be forced!
*/
* switched to "true", the genearation fo the schema should be forced!
*/
- if (tracker.check(EX
PORT, export.toString()) && export
)
+ if (tracker.check(EX
ECUTE, execute.toString()) && execute
)
tracker.touch();
/**
tracker.touch();
/**
diff --git
a/src/site/xhtml/force.xhtml
b/src/site/xhtml/force.xhtml
index
4e4fdcb
..
ee3586f
100644
(file)
--- a/
src/site/xhtml/force.xhtml
+++ b/
src/site/xhtml/force.xhtml
@@
-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
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 — and more
+ important in this respect — 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
</p>
<p>
The plugin signals, that the execution was skipped by setting the maven
diff --git
a/src/site/xhtml/index.xhtml
b/src/site/xhtml/index.xhtml
index
ff1ca5e
..
6532475
100644
(file)
--- a/
src/site/xhtml/index.xhtml
+++ b/
src/site/xhtml/index.xhtml
@@
-34,8
+34,8
@@
</p>
<p>
Last but not least, in order to not slow down the development cycle, the
</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,
</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
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>
</li>
</ul>
<h2>Releases</h2>
diff --git
a/src/site/xhtml/pitfalls.xhtml
b/src/site/xhtml/pitfalls.xhtml
index
3d8c616
..
a8eb5ab
100644
(file)
--- a/
src/site/xhtml/pitfalls.xhtml
+++ b/
src/site/xhtml/pitfalls.xhtml
@@
-16,20
+16,19
@@
</p>
<h2>hibernate-maven-plugin always needs a database-connection</h2>
<p>
</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.
Therefore, it needs a valid database-connection and fails, if none is
available.
- If you do not need t
o export the created schema to a database
,
- you can set the property <code>hibernate.schema.ex
port
</code> to
+ If you do not need t
he generated SQL to be executed automatically
,
+ you can set the property <code>hibernate.schema.ex
ecute
</code> to
<code>false</code>.
This can be achieved with the command-line parameter
<code>false</code>.
This can be achieved with the command-line parameter
- <code>-Dhibernate.schema.ex
port
=false</code> or with the following
+ <code>-Dhibernate.schema.ex
ecute
=false</code> or with the following
configuration:
</p>
<pre class="prettyprint linenums lang-html">
<configuration>
configuration:
</p>
<pre class="prettyprint linenums lang-html">
<configuration>
- <ex
port>false</export
>
+ <ex
ecute>false</execute
>
</configuration></pre>
<p>
But even when no database is to be created, hibernate always needs to know
</configuration></pre>
<p>
But even when no database is to be created, hibernate always needs to know
@@
-124,7
+123,7
@@
</p>
<p>
A quick fix to this problem is, to <a href="./force.html">force</a>
</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>
But to recreate the database on every testrun may noticeable slow down your
development cycle, if you have to wait for slow IO.
</p>