*/
private String hibernateDialect;
+ /**
+ * Generate envers schema for auditing tables.
+ *
+ * @parameter expression="${hibernate.export.envers}" default-value="false"
+ */
+ private Boolean envers;
+
/**
* Path to Hibernate configuration file.
*
*/
private boolean format;
- /**
- * Generate envers schema for auditing tables.
- *
- * @parameter expression="${hibernate.export.envers}" default-value="false"
- */
- private Boolean envers;
@Override
public void execute()
getLog().debug("Using the value " + hibernateDialect);
properties.setProperty(DIALECT, hibernateDialect);
}
+ if (envers != null)
+ {
+ if (properties.containsKey(ENVERS))
+ getLog().debug(
+ "Overwriting property " +
+ ENVERS + "=" + properties.getProperty(ENVERS) +
+ " with the value " + envers
+ );
+ else
+ getLog().debug("Using the value " + envers);
+ properties.setProperty(ENVERS, envers.toString());
+ }
+
/** The generated SQL varies with the dialect! */
if (md5s.containsKey(DIALECT))
md5s.put(DIALECT, properties.getProperty(DIALECT));
}
+ /** The generated SQL varies with the envers-configuration! */
if (md5s.containsKey(ENVERS))
{
String envers = properties.getProperty(ENVERS);
if (md5s.get(ENVERS).equals(envers))
- getLog().debug("Envers unchanged.");
+ getLog().debug("Envers-configuration unchanged.");
else
{
- getLog().debug("Envers changed: " + envers);
+ getLog().debug("Envers-configuration changed: " + envers);
modified = true;
md5s.put(ENVERS, envers.toString());
}
md5s.put(ENVERS, properties.getProperty(ENVERS));
}
- if (envers != null) {
- if (properties.containsKey(ENVERS))
- getLog().debug(
- "Overwriting property " +
- ENVERS + "=" + properties.getProperty(ENVERS) +
- " with the value " + envers
- );
- else
- getLog().debug("Using the value " + envers);
- properties.setProperty(ENVERS, envers.toString());
- }
-
if (properties.isEmpty())
{
getLog().error("No properties set!");
getLog().debug("Class " + annotatedClass);
config.addAnnotatedClass(annotatedClass);
}
+ if ("true".equals(properties.getProperty(ENVERS)))
+ {
+ config.buildMappings();
+ getLog().debug("Using envers");
+ AuditConfiguration.getFor(config);
+ }
+
Target target = null;
try
*/
Thread.currentThread().setContextClassLoader(classLoader);
- config.buildMappings();
- if ("true".equals(properties.getProperty(ENVERS)))
- {
- getLog().debug("Using envers");
- AuditConfiguration.getFor(config);
- }
-
SchemaExport export = new SchemaExport(config, connection);
export.setOutputFile(outputFile);
export.setDelimiter(delimiter);