Package org.tentackle.maven.plugin.sql
package org.tentackle.maven.plugin.sql
Tentackle SQL maven plugin.
Turns the Tentackle model into backend-specific DDL (
Turns the Tentackle model into backend-specific DDL (
create), migration scripts
(migrate, validate) and cross-linked documentation (document),
runs SQL scripts (run), and reverse-engineers existing tables into model source (reveng).-
ClassDescriptionBase class of the SQL mojos working on the model.
Provides the shared configuration: model selection, backend selection, name checks, and the diagnostic dumps.
The defaultAbstractSqlMojo.executeImpl()processes the model files once per backend returned byAbstractSqlMojo.getBackendInfosToExecute()and dumps the model and bundles afterward, if configured.Maven parameter to create aBackendInfo.Generates an SQL script to create the database tables according to the model.
The script contains, in this order: theCreateSqlMojo.prependFilesets, the classpath model ifCreateSqlMojo.prependModelFromClassPath, the schemas, tables and indexes per entity, the foreign keys, the classpath model ifCreateSqlMojo.appendModelFromClassPath, theCreateSqlMojo.sequences, and finally theCreateSqlMojo.appendFilesets.Determines the database version in an application-specific way.
The implementing class must provide a no-args constructor.Renders the model as a set of cross-linked HTML or Markdown pages, one per entity, plus an index page.
Unlike theModelCommentwurblet's Javadoc comment block, entity names mentioned on a page are hyperlinks to that entity's own page, so the whole model can be browsed by following references, composite trees, and inheritance in a browser or Markdown viewer.Renders a migration file generated as a FreeMarker template into the final SQL file.Generates an SQL script to migrate the database tables according to the model.
Connects to each connectable backend, compares its metadata table by table against the model, and writes the SQL required to bring the database in line, optionally guided byMigrationHints.Holds the template model for the migration sql generator.Migration hints.Reverse-engineers tables of an existing database into Tentackle model source files.Runs an SQL script against every configured connectable backend.
The statements are executed in autocommit mode, i.e. without a transaction.Default semantic version filter.
Interprets the name of the directory holding a hint file as amajor.minor.hotfixversion (dots or underscores, with an optional suffix like-SNAPSHOTthat is ignored).Parameter to create a sequence.Validates the database against the model.
Same as themigrategoal, but the build fails if anything needs to be migrated.
Alternative to thevalidateconfiguration option of themigrategoal.Filters migration hint files according to their version.
The default implementation isSemanticVersionFileFilter.