torque:om

Full name:

org.apache.torque:torque-maven-plugin:3.3.1-SNAPSHOT:om

Description:

Generates the sources for the persistence classes from the schema.xml files.

Attributes:

  • Requires a Maven 2.0 project to be executed.
  • Binds by default to the lifecycle phase: generate-sources.

Required Parameters

Name Type Since Description
schemaDir String - The path to the directory where the schema files are located in.
schemaIncludes String - The schema files which should be included in generation (in ant-style notation).
targetDatabase String - The database type (e.g. mysql, oracle, ...) for the generated persistence classes,

Optional Parameters

Name Type Since Description
addGetByNameMethod boolean - If true, Torque adds methods to get database fields by name/position.
addRetrievableInterface boolean - If true, the data objects will implement a Retrievable interface.
addSaveMethod boolean - Determines whether save()-Methods should be added to the data objects.
addTimeStamp boolean - Determines whether a time stamp and a serialVersionUID will be added to generated objects.
baseOutputDir String - The directory where the sources for the base persistence classes will be generated.
basePrefix String - The prefix for the base classes.
baseReportFile String - The location where the report file for the base persistence classes will be generated.
beanExtendsClass String - A fully qualified class name that the generated base bean class will extend.
beanSuffix String - The suffix for the class name of the bean classes.
complexObjectModel boolean - If true, Torque generates data objects with collection support and methods to easily retrieve foreign key relationships.
correctGetters boolean - If true, Torque generates isXXX getter methods for boolean columns.
outputDir String - The directory in which the sources for the non-base persistence classes will be generated.
reportFile String - The location where the report file for the non-base persistence classes will be generated.
contextPropertiesPath String - The location where the context property file for velocity will be generated.
schemaExcludes String - The schema files which should be excluded in generation (in ant-style notation).
enableJava5Features boolean - Whether Java5 generics and iteration shorthand should be used  in generated code.
generateBeans boolean - If true, Torque generates a bean object for each data object, plus methods to convert data objects to beans and vice versa.
objectIsCaching boolean - If true, Torque generates data objects that cache their foreign key relationships.
retrievableInterface String - The fully qualified class name of the retrievable interface to be implemented by the data objects.
runOnlyOnSchemaChange boolean - Determines if this task should run only if the schema has changed.
saveException String - Defines which Exception should be thrown by the Object.save() method.
silentDbFetch boolean - If true and objectIsCaching is true, Torque silently fetches foreign key relation collections if the collection is not yet initialized.
sqlDbMap String - The path to the properties file containing the mapping sql file -> target database.
subpackageBase String - The subpackage (relative to targetPackage) where Torque will put the generated BaseObject, BasePeer, (and BaseManager, if they are generated at all) Java classes. If not set, the Base classes will be generated in targetPackage.
subpackageBaseBean String - The subpackage (relative to targetPackage) where Torque will put the generated BaseBean Java classes, if they are generated at all.
subpackageBean String - The subpackage (relative to targetPackage) where Torque will put the generated JavaBean classes, if they are generated at all.
subpackageManager String - The subpackage (relative to targetPackage) where Torque will put the generated Java Manager classes, if they are generated at all. If not set, the Manager classes will be generated in targetPackage.
subpackageMap String - The subpackage (relative to targetPackage where Torque will put the generated Java classes for the database map.
subpackageObject String - The subpackage (relative to targetPackage) where Torque will put the generated data object Java classes. If not set, the object classes will be generated in targetPackage.
subpackagePeer String - The subpackage (relative to targetPackage) where Torque will put the generated Peer Java classes. If not set, the Peer classes will be generated in targetPackage.
targetPackage String - The target package for the generated classes.
templatePath String - The base path where the templates are read from, if they are not read from the classpath.
useClasspath boolean - Whether the templates should be loaded from the classpath.
useManagers boolean - If true, Torque will generate Manager classes that use JCS for caching.
userContextProperties Map - A map where all user-defined context properties can be set. Overrides all other mojo configuration settings which are mapped to context properties.

Parameter Details

addGetByNameMethod:

If true, Torque adds methods to get database fields by name/position.
  • Type: boolean
  • Required: No
  • Expression: true

addRetrievableInterface:

If true, the data objects will implement a Retrievable interface.
  • Type: boolean
  • Required: No
  • Expression: false

addSaveMethod:

Determines whether save()-Methods should be added to the data objects.
  • Type: boolean
  • Required: No
  • Expression: true

addTimeStamp:

Determines whether a time stamp and a serialVersionUID will be added to generated objects.
  • Type: boolean
  • Required: No
  • Expression: true

baseOutputDir:

The directory where the sources for the base persistence classes will be generated.
  • Type: java.lang.String
  • Required: No
  • Expression: ${project.build.directory}/generated-sources/torque

basePrefix:

The prefix for the base classes.
  • Type: java.lang.String
  • Required: No
  • Expression: Base

baseReportFile:

The location where the report file for the base persistence classes will be generated.
  • Type: java.lang.String
  • Required: No
  • Expression: ../../torque/report.${project.artifact.artifactId}.om.base.generation

beanExtendsClass:

A fully qualified class name that the generated base bean class will extend.
  • Type: java.lang.String
  • Required: No

beanSuffix:

The suffix for the class name of the bean classes.
  • Type: java.lang.String
  • Required: No
  • Expression: Bean

complexObjectModel:

If true, Torque generates data objects with collection support and methods to easily retrieve foreign key relationships.
  • Type: boolean
  • Required: No
  • Expression: true

correctGetters:

If true, Torque generates isXXX getter methods for boolean columns.
  • Type: boolean
  • Required: No
  • Expression: false

outputDir:

The directory in which the sources for the non-base persistence classes will be generated.
  • Type: java.lang.String
  • Required: No
  • Expression: ${project.build.sourceDirectory}/../generated-java

reportFile:

The location where the report file for the non-base persistence classes will be generated.
  • Type: java.lang.String
  • Required: No
  • Expression: ../../../target/torque/report.${project.artifact.artifactId}.om.generation

contextPropertiesPath:

The location where the context property file for velocity will be generated.
  • Type: java.lang.String
  • Required: No
  • Expression: ${project.build.directory}/torque/context.om.properties

schemaExcludes:

The schema files which should be excluded in generation (in ant-style notation).
  • Type: java.lang.String
  • Required: No
  • Expression: id-table-schema.xml

enableJava5Features:

Whether Java5 generics and iteration shorthand should be used  in generated code.
  • Type: boolean
  • Required: No
  • Expression: false

generateBeans:

If true, Torque generates a bean object for each data object, plus methods to convert data objects to beans and vice versa.
  • Type: boolean
  • Required: No
  • Expression: false

objectIsCaching:

If true, Torque generates data objects that cache their foreign key relationships.
  • Type: boolean
  • Required: No
  • Expression: true

retrievableInterface:

The fully qualified class name of the retrievable interface to be implemented by the data objects.
  • Type: java.lang.String
  • Required: No
  • Expression: org.apache.turbine.om.Retrievable

runOnlyOnSchemaChange:

Determines if this task should run only if the schema has changed.
  • Type: boolean
  • Required: No
  • Expression: true

saveException:

Defines which Exception should be thrown by the Object.save() method.
  • Type: java.lang.String
  • Required: No
  • Expression: Exception

schemaDir:

The path to the directory where the schema files are located in.
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${basedir}/src/main/torque/schema

schemaIncludes:

The schema files which should be included in generation (in ant-style notation).
  • Type: java.lang.String
  • Required: Yes
  • Expression: *schema.xml

silentDbFetch:

If true and objectIsCaching is true, Torque silently fetches foreign key relation collections if the collection is not yet initialized.
  • Type: boolean
  • Required: No
  • Expression: true

sqlDbMap:

The path to the properties file containing the mapping sql file -> target database.
  • Type: java.lang.String
  • Required: No
  • Expression: ${project.build.directory}/torque/sqldbmap.properties

subpackageBase:

The subpackage (relative to targetPackage) where Torque will put the generated BaseObject, BasePeer, (and BaseManager, if they are generated at all) Java classes. If not set, the Base classes will be generated in targetPackage.
  • Type: java.lang.String
  • Required: No

subpackageBaseBean:

The subpackage (relative to targetPackage) where Torque will put the generated BaseBean Java classes, if they are generated at all.
  • Type: java.lang.String
  • Required: No
  • Expression: bean

subpackageBean:

The subpackage (relative to targetPackage) where Torque will put the generated JavaBean classes, if they are generated at all.
  • Type: java.lang.String
  • Required: No
  • Expression: bean

subpackageManager:

The subpackage (relative to targetPackage) where Torque will put the generated Java Manager classes, if they are generated at all. If not set, the Manager classes will be generated in targetPackage.
  • Type: java.lang.String
  • Required: No

subpackageMap:

The subpackage (relative to targetPackage where Torque will put the generated Java classes for the database map.
  • Type: java.lang.String
  • Required: No
  • Expression: map

subpackageObject:

The subpackage (relative to targetPackage) where Torque will put the generated data object Java classes. If not set, the object classes will be generated in targetPackage.
  • Type: java.lang.String
  • Required: No

subpackagePeer:

The subpackage (relative to targetPackage) where Torque will put the generated Peer Java classes. If not set, the Peer classes will be generated in targetPackage.
  • Type: java.lang.String
  • Required: No

targetDatabase:

The database type (e.g. mysql, oracle, ...) for the generated persistence classes,
  • Type: java.lang.String
  • Required: Yes

targetPackage:

The target package for the generated classes.
  • Type: java.lang.String
  • Required: No
  • Expression: torque.generated

templatePath:

The base path where the templates are read from, if they are not read from the classpath.
  • Type: java.lang.String
  • Required: No
  • Expression: ${basedir}/src/main/torque/templates

useClasspath:

Whether the templates should be loaded from the classpath.
  • Type: boolean
  • Required: No
  • Expression: true

useManagers:

If true, Torque will generate Manager classes that use JCS for caching.
  • Type: boolean
  • Required: No
  • Expression: false

userContextProperties:

A map where all user-defined context properties can be set. Overrides all other mojo configuration settings which are mapped to context properties.
  • Type: java.util.Map
  • Required: No