org.apache.torque.mojo
Class SchemaSqlMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.torque.mojo.BaseMojo
          extended by org.apache.torque.mojo.AntTaskMojo
              extended by org.apache.torque.mojo.TexenTaskMojo
                  extended by org.apache.torque.mojo.DataModelTaskMojo
                      extended by org.apache.torque.mojo.SqlMojoBase
                          extended by org.apache.torque.mojo.SchemaSqlMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class SchemaSqlMojo
extends SqlMojoBase

Generates platform specific SQL from database agnostic XML files.

There are two types of SQL files created by this goal:

Type 1: DDL statements for creating tables, primary keys, indexes, and unique constraints. Does not contain DDL for enforcing relationships between tables.
Type 2: DDL statements for creating and enforcing relationships between tables

This allows data to be imported into multiple tables concurrently. Running the first type of SQL file will create the empty tables without any foreign key constraints. Data can then be loaded concurrently into the tables (using optimized high speed tools if desired) without needing to worry about the order in which the tables are loaded. After data has been loaded, the second type of SQL file can be run to add the relationships between the tables. As long as the data set is consistent and correct, all the relationships will get created correctly.

The database platform to generate SQL for is determined by ${targetDatabase}. See also impex:datasql


Field Summary
 
Fields inherited from class org.apache.torque.mojo.DataModelTaskMojo
TARGET_DATABASE_CONTEXT_PROPERTY
 
Fields inherited from class org.apache.torque.mojo.BaseMojo
FS, SKIP_PACKAGING_TYPE
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
SchemaSqlMojo()
           
 
Method Summary
 void executeMojo()
          Generate SQL from schema XML files
protected  void showConfig()
           
 
Methods inherited from class org.apache.torque.mojo.SqlMojoBase
configureTask, getControlTemplate, getMojoContextProperties
 
Methods inherited from class org.apache.torque.mojo.DataModelTaskMojo
addTargetDatabaseToOutputDir, addTargetDatabaseToReportFile, getAntFileSet, getCanonicalReportFile, getInvalidTargetDatabaseMessage, getReportFile, getSchemaDir, getSchemaExcludes, getSchemaFiles, getSchemaIncludes, getSqlDbMap, getSuffix, getTargetDatabase, getTargetPackage, getUrl, isRunOnlyOnSchemaChange, setReportFile, setRunOnlyOnSchemaChange, setSchemaDir, setSchemaExcludes, setSchemaIncludes, setSqlDbMap, setSuffix, setTargetDatabase, setTargetPackage, setUrl, updateConfiguration, validateConfiguration
 
Methods inherited from class org.apache.torque.mojo.TexenTaskMojo
generateContextProperties, getContextPropertiesPath, getGeneratorTask, getOutputDir, getTemplatePath, getUseClasspath, getUserContextProperties, setContextPropertiesPath, setOutputDir, setTemplatePath, setUseClasspath, setUserContextProperties
 
Methods inherited from class org.apache.torque.mojo.AntTaskMojo
getAntProject, getAntTask, getIniatializedAntProject, setAntProject, setAntTask
 
Methods inherited from class org.apache.torque.mojo.BaseMojo
afterExecution, beforeExecution, execute, getEncoding, getMavenSession, getProject, getSettings, isForceMojoExecution, isSkip, isStartMavenLogger, setEncoding, setForceMojoExecution, setMavenSession, setProject, setSettings, setSkip, setStartMavenLogger, skipMojo
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaSqlMojo

public SchemaSqlMojo()
Method Detail

showConfig

protected void showConfig()

executeMojo

public void executeMojo()
                 throws org.apache.maven.plugin.MojoExecutionException
Generate SQL from schema XML files

Overrides:
executeMojo in class TexenTaskMojo
Throws:
org.apache.maven.plugin.MojoExecutionException - if an error occurs during execution.
See Also:
Mojo.execute()


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.