de.exalta:envers-schema-maven-plugin

Analyses the JPA entities in a specified package and generates DDL statements for schema generation. Besides the Entity annotation, this plugin processes the Hibernate Envers annotation Audited and generates AUD tables accordingly.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

de.exalta
ArtifactId

ArtifactId

envers-schema-maven-plugin
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Analyses the JPA entities in a specified package and generates DDL statements for schema generation. Besides the Entity annotation, this plugin processes the Hibernate Envers annotation Audited and generates AUD tables accordingly.

Download envers-schema-maven-plugin

How to add to project

<plugin>
    <groupId>de.exalta</groupId>
    <artifactId>envers-schema-maven-plugin</artifactId>
    <version>1.0.2</version>
</plugin>

Dependencies

compile (5)

Group / Artifact Type Version
org.hibernate : hibernate-envers jar 4.3.7.Final
org.reflections : reflections jar 0.9.9
org.apache.maven : maven-plugin-api jar 3.2.3
org.apache.maven : maven-settings jar 3.2.3
org.codehaus.plexus : plexus-component-annotations jar 1.5.5

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.3

Project Modules

There are no modules declared in this project.

envers-schema

Build Status

Analyses the JPA entities in a specified package and generates DDL statements for schema generation. Besides the Entity annotation, this plugin processes the Hibernate Envers annotation Audited and generates AUD tables accordingly.

Motivation

Based on JPA entities, database schemas need to be created frequently. Using Hibernate 4 in connection with enversthere is no built-in mechanism to generate both the data tables and the revision tables using a maven plugin. To overcome this gap, this plugin makes use of the EnversSchemaGenerator to create an overall DDL file.

Usage

Besides the plugin, this repository contains a sample project which generates the schema for a single JPA entity. Please refer to the POM of this sample. The plugin should be applied in the package phase of the maven build lifecycle as it makes use of the compiled classes. Basically, the plugin provides three properties:

  • dialect (required): the fully-qualified name of the hibernate class representing the SQL dialect (e.g. org.hibernate.dialect.MySQL5Dialect for the MySQL dialect)
  • packageName (required): the package in which the JPA entities are defined
  • destination (optional): the file name to which the schema will be generated, default value is target/schema.sql

Version History

1.0.0 2014-02-08 First release with all features described above. 1.0.2 2015-12-30 Upgraded version of Plexus Plugin

Versions

Version
1.0.2
1.0.1