tentackle-sql:validate

Full name:

org.tentackle:tentackle-sql-maven-plugin:21.16.1.0:validate

Description:

Validates the database against the model.
The build fails if something to migrate found.
Alternative to the validate configuration option of the migrate goal.

Attributes:

  • Requires a Maven project to be executed.
  • Executes as an aggregator goal.
  • The goal is not marked as thread-safe and thus does not support parallel builds.

Optional Parameters

Name Type Since Description
<alienTables> List<String> - Optional list of tables names not belonging to the model.
Could be just simple names, but in fact is a regular expression.
Must not contain the schema name, only the table name!
<asTemplate> boolean - Optionally, the generated migration file is passed to freemarker as a template.
Default: false
User Property: tentackle.migrateSqlAsTemplate
<backendNames> String - Comma-separated list of backend names.
The following special names are recognized:
  • all: all non-deprecated backends
  • none: does not match any backend
  • deprecated: all deprecated backends
<backendProperties> List<FileSet> - The backend property files.
<backends> List<BackendInfoParameter> - Backend configuration via pom if not from property files.
<bundleDir> File - Optional directory where to create bundle property files.
Contains all attribute- and relation names with their comments.
Useful to copy and paste into the project for auto table config or default editors.
<charset> String - The encoding to read and write files.
Default: ${project.build.sourceEncoding}
<checkReservedTables> boolean - Check for reserved table names.
Invokes org.tentackle.sql.metadata.MetaDataUtilities.isReservedTable(java.lang.String).
Default: true
<dumpAnnotationsAsOptions> String - Optional annotations that should be printed as attribute options.
<dumpAsComment> boolean - Model dump should be dumped as comment blocks (default).
Default: true
<dumpColumnGap> int - Minimum number of spaces between columns in attribute section (default = 2).
Default: 2
<dumpDir> File - Optional directory where to dump the model.
Useful for debugging to verify that the model was interpreted correctly or to pretty-print the model source.
<dumpModelIndex> File - Creates an additional file containing the names of the dumped files.
Usually combined with dumpModelSource to create META-INF/MODEL-INDEX.LIST in order to load the model from a jar file.
<dumpModelSource> boolean - Dumps the original model source instead of the parsed entity.
<dumpVariables> boolean - Model dump should include variables (default).
Default: true
<entityAliases> String - The entity aliases.
User Property: tentackle.entityAliases
<failOnUnexpectedTables> boolean - Fail if unexpected tables are found in the database.
Default: false
<filesets> List<FileSet> - Explicit filesets given instead of model directory.
<generateHeaderComment> boolean - Create a header comment.
Default: true
<jdkToolchain> Map<String,String> - Toolchain for invocation of external tools.
Explicitly specifies the "jdk" toolchain for this plugin only. Overrides the toolchain selected by the maven-toolchain-plugin, if any.

Example:

  <jdkToolchain>
    <version>14</version>
  </jdkToolchain>
To deselect the toolchain configured by the maven-toolchain-plugin:
  <jdkToolchain></jdkToolchain>
<loadModelFromClassPath> boolean - Uses the model found in the resources of the classpath.
Useful to migrate the database tables for dependencies, for example the Tentackle-framework's model.
Requires that the plugin dependencies contain the model resources (see dumpModelIndex) amd dumpModelSource).

Notice: when this flag is true, the model files in the filesets are ignored! If only the tentackle tables should be migrated, make sure to set checkReservedTables to false.

<mapSchemas> boolean - Map schema names to flat table names.
User Property: tentackle.mapSchemas
<minLogLevel> String - The minimum logging java.util.logging.Level to redirect java.util logging to the maven logger.
Default: WARNING
<modelDefaults> String - The model defaults.
User Property: tentackle.modelDefaults
<modelDir> File - Directory holding the model files to be processed.
Ignored if fileset explicitly given.
Default: ${project.build.directory}/wurbel/model
User Property: tentackle.modelDir
<skip> Boolean - Skips processing.
Defaults to true if packaging is "pom".
<split> boolean - The generated SQL file can be split into one file per entity.
This is especially useful if the migrations are processed any further, for example by shell scripts.

The main migration file will just contain statistic comments.
Each migrated table gets its own directory which is a number starting at 1 and as much leading zeros as necessary to keep the directory names in numeric order.
If there is a before-all SQL, it will go into the folder zero, i.e. 0 or 00, etc...
Any after-all SQL will go into the folder with the highest number.

<sqlDir> File - Directory holding the SQL generated scripts.
Default: ${project.build.directory}/sql
User Property: tentackle.sqlDir
<sqlFileName> String - The name of the created sql file.
Default: migratemodel.sql
User Property: tentackle.migrateSqlFile
<useDropIfExists> boolean - Use IF EXISTS for drop index, constraint and column if the backend supports it.
If not supported, a warning will be logged.
<validate> boolean - Fail if the model differs from the database meta data.
Useful to validate that no migrations are necessary.

Same as validate goal.

<verbosity> String - The verbosity.
One of "default", "info" or "debug". Debug is also turned on (if not set explicitly) by Maven's global debug flag (see command line switch -X).
Default: ${tentackle.verbosity}

Parameter Details

<alienTables>

Optional list of tables names not belonging to the model.
Could be just simple names, but in fact is a regular expression.
Must not contain the schema name, only the table name!
  • Type: java.util.List<java.lang.String>
  • Required: No

<asTemplate>

Optionally, the generated migration file is passed to freemarker as a template.
  • Type: boolean
  • Required: No
  • User Property: tentackle.migrateSqlAsTemplate
  • Default: false

<backendNames>

Comma-separated list of backend names.
The following special names are recognized:
  • all: all non-deprecated backends
  • none: does not match any backend
  • deprecated: all deprecated backends
  • Type: java.lang.String
  • Required: No

<backendProperties>

The backend property files.
  • Type: java.util.List<org.apache.maven.shared.model.fileset.FileSet>
  • Required: No

<backends>

Backend configuration via pom if not from property files.
  • Type: java.util.List<org.tentackle.maven.plugin.sql.BackendInfoParameter>
  • Required: No

<bundleDir>

Optional directory where to create bundle property files.
Contains all attribute- and relation names with their comments.
Useful to copy and paste into the project for auto table config or default editors.
  • Type: java.io.File
  • Required: No

<charset>

The encoding to read and write files.
  • Type: java.lang.String
  • Required: No
  • Default: ${project.build.sourceEncoding}

<checkReservedTables>

Check for reserved table names.
Invokes org.tentackle.sql.metadata.MetaDataUtilities.isReservedTable(java.lang.String).
  • Type: boolean
  • Required: No
  • Default: true

<dumpAnnotationsAsOptions>

Optional annotations that should be printed as attribute options.
  • Type: java.lang.String
  • Required: No

<dumpAsComment>

Model dump should be dumped as comment blocks (default).
  • Type: boolean
  • Required: No
  • Default: true

<dumpColumnGap>

Minimum number of spaces between columns in attribute section (default = 2).
  • Type: int
  • Required: No
  • Default: 2

<dumpDir>

Optional directory where to dump the model.
Useful for debugging to verify that the model was interpreted correctly or to pretty-print the model source.
  • Type: java.io.File
  • Required: No

<dumpModelIndex>

Creates an additional file containing the names of the dumped files.
Usually combined with dumpModelSource to create META-INF/MODEL-INDEX.LIST in order to load the model from a jar file.
  • Type: java.io.File
  • Required: No

<dumpModelSource>

Dumps the original model source instead of the parsed entity.
  • Type: boolean
  • Required: No

<dumpVariables>

Model dump should include variables (default).
  • Type: boolean
  • Required: No
  • Default: true

<entityAliases>

The entity aliases.
  • Type: java.lang.String
  • Required: No
  • User Property: tentackle.entityAliases

<failOnUnexpectedTables>

Fail if unexpected tables are found in the database.
  • Type: boolean
  • Required: No
  • Default: false

<filesets>

Explicit filesets given instead of model directory.
  • Type: java.util.List<org.apache.maven.shared.model.fileset.FileSet>
  • Required: No

<generateHeaderComment>

Create a header comment.
  • Type: boolean
  • Required: No
  • Default: true

<jdkToolchain>

Toolchain for invocation of external tools.
Explicitly specifies the "jdk" toolchain for this plugin only. Overrides the toolchain selected by the maven-toolchain-plugin, if any.

Example:

  <jdkToolchain>
    <version>14</version>
  </jdkToolchain>
To deselect the toolchain configured by the maven-toolchain-plugin:
  <jdkToolchain></jdkToolchain>
  • Type: java.util.Map<java.lang.String, java.lang.String>
  • Required: No

<loadModelFromClassPath>

Uses the model found in the resources of the classpath.
Useful to migrate the database tables for dependencies, for example the Tentackle-framework's model.
Requires that the plugin dependencies contain the model resources (see dumpModelIndex) amd dumpModelSource).

Notice: when this flag is true, the model files in the filesets are ignored! If only the tentackle tables should be migrated, make sure to set checkReservedTables to false.

  • Type: boolean
  • Required: No

<mapSchemas>

Map schema names to flat table names.
  • Type: boolean
  • Required: No
  • User Property: tentackle.mapSchemas

<minLogLevel>

The minimum logging java.util.logging.Level to redirect java.util logging to the maven logger.
  • Type: java.lang.String
  • Required: No
  • Default: WARNING

<modelDefaults>

The model defaults.
  • Type: java.lang.String
  • Required: No
  • User Property: tentackle.modelDefaults

<modelDir>

Directory holding the model files to be processed.
Ignored if fileset explicitly given.
  • Type: java.io.File
  • Required: No
  • User Property: tentackle.modelDir
  • Default: ${project.build.directory}/wurbel/model

<skip>

Skips processing.
Defaults to true if packaging is "pom".
  • Type: java.lang.Boolean
  • Required: No

<split>

The generated SQL file can be split into one file per entity.
This is especially useful if the migrations are processed any further, for example by shell scripts.

The main migration file will just contain statistic comments.
Each migrated table gets its own directory which is a number starting at 1 and as much leading zeros as necessary to keep the directory names in numeric order.
If there is a before-all SQL, it will go into the folder zero, i.e. 0 or 00, etc...
Any after-all SQL will go into the folder with the highest number.

  • Type: boolean
  • Required: No

<sqlDir>

Directory holding the SQL generated scripts.
  • Type: java.io.File
  • Required: No
  • User Property: tentackle.sqlDir
  • Default: ${project.build.directory}/sql

<sqlFileName>

The name of the created sql file.
  • Type: java.lang.String
  • Required: No
  • User Property: tentackle.migrateSqlFile
  • Default: migratemodel.sql

<useDropIfExists>

Use IF EXISTS for drop index, constraint and column if the backend supports it.
If not supported, a warning will be logged.
  • Type: boolean
  • Required: No

<validate>

Fail if the model differs from the database meta data.
Useful to validate that no migrations are necessary.

Same as validate goal.

  • Type: boolean
  • Required: No

<verbosity>

The verbosity.
One of "default", "info" or "debug". Debug is also turned on (if not set explicitly) by Maven's global debug flag (see command line switch -X).
  • Type: java.lang.String
  • Required: No
  • Default: ${tentackle.verbosity}