Frank Schimmel [Wed, 12 Feb 2014 14:16:18 +0000 (15:16 +0100)]
Properly support constraints expressed by bean validation (jsr303) annotations.
* Access public method of package-visible TypeSafeActivator class without reflection.
* Fix arguments to call of TypeSafeActivator.applyRelationalConstraints().
* Use hibernate version 4.3.1.Final for all components.
* Minor refactorings in exception handling.
Kai Moritz [Sat, 31 Aug 2013 07:01:43 +0000 (09:01 +0200)]
Fixed failure when target/classes does not exist when runnin mvn test phase
Thanks to Stephen Johnson <stejohns@redhat.com>
Details from the original email:
---------
The following patch stops builds failing when target/classes (or no main java exists), and target/test-classes and src/tests exist.
So for example calling
mvn test -> invokes compiler:compile and if you have export bound to process-classes phase in executions it will fail. Maybe better to give info and carry on. Say for example they want to leave the executions in place that deal with process-classes and also process-test-classes but they do not want it to fail if there is no java to annotate in src/classes. The other way would be to comment out the executions bound to process-classes. What about export being bound to process-class by default? Could this also cause issues?
In either case I think the plugin code did checks for src/classes directory existing, in which case even call "mvn test" would fail as src/classes would not exist as no java existed in src/main only in src/test. Have a look through the patch and see if its of any use.
Kai Moritz [Sat, 31 Aug 2013 06:51:03 +0000 (08:51 +0200)]
Fixed NPE when using nested classes in entities with @EmbeddedId/@Embeddable
Patch supplied by Eduard Szente <eduard.szente@gmail.com>
Details:
----------------
Hi,
when using your plugin for schema export the presence of nested classes
in entities (e.g. when using @EmbeddedId/@Embeddable and defining the Id
within the target entity class)
yields to NPEs.
public class Entity {
@EmbeddedId
private Id id;
@Embeddable
public static class Id implements Serializable {
....
}
}
Entity.Id.class.getSimplename == "Id", while the compiled class is named
"Entity$Id.class"
Kai Moritz [Tue, 15 Jan 2013 08:09:05 +0000 (09:09 +0100)]
Bugfix: database-parameters for connection were not taken from properties
The hibernate-propertiesfile was read and used for the configuration of
the SchemaExport-class, but the database-parameters from these source were
ignored, when the database-connection was opened.
When only the script is generated and no export is executed, no database-
connection is opend. Nevertheless, the code tried to close it in the
finally-block, which lead to a NPE.
Kai Moritz [Tue, 11 Dec 2012 16:30:19 +0000 (17:30 +0100)]
Skipping of unchanged scenarios is now based on MD5-sums of all classes
When working with Netbeans, the schema was often rebuild without need.
The cause of this behaviour was, that Netbeans (or Maven itself) sometimes
touches unchanged classes. To avoid this, hibernat4-maven-plugin now
calculates MD5-sums for all annotated classes and compares these instead of
the last-modified value.
Kai Moritz [Tue, 11 Dec 2012 16:02:14 +0000 (17:02 +0100)]
hibernate4:export is skipped, when annotated classes are unchanged
Hbm2DdlMojo now checks the last-modified-timestamp of all found annotated
classes and aborts the schema-generation, when no class has changed and no
new class was added since the last execution.
It then sets a maven-property, to indicate to other plugins, that the
generation was skipped.
Kai Moritz [Wed, 28 Nov 2012 16:05:10 +0000 (17:05 +0100)]
DriverProxy now implements Driver.getParentLogger()
Otherwise, the plugin would not run with database-drivers compiled for
Java 1.7.
This method must not be annotated with @Override, because otherwise, the
plugin won't compile under Java 1.6 (the method was added to the interface
Driver in Java 1.7).
Kai Moritz [Sat, 20 Oct 2012 13:55:30 +0000 (15:55 +0200)]
Attribute "skip" is no initialized with value of property maven.test.skip
If one runs hibernate4:export with the switch "-Dmaven.test.skip=true", the
configured database was droped, although the execution of the tests was
skipped.
This might lead to serious data-loss, if one builds a project on the
production-machine. Hence, the excecution of hibernate4:export is aborted
now, if maven.test.skip is true.