Build-time Properties

These properties are set in the build.properties file or the file of your chosing, specificed by the torque.contextProperties property. They affect how Torque generates Java and SQL code for your project.

Property Default Description
Basic Properties
torque.project N/A The name of the project Torque will generate code for. After choosing the project name, your XML schema file (originally project-schema.xml), that Torque will read should be renamed to ${torque.project}-schema.xml.
torque.database N/A Torque must know the target database platform in order to generate the appropriate Java and SQL code. Currently supported values are: axion, cloudscape, db2, db2400, hypersonic, interbase, mssql, mysql, oracle, postgresql, sapdb, and sybase.
torque.targetPackage N/A The Java package that Torque will put the generated classes in. Generally something like com.company.project.om.
torque.subpackage.peer Not set The subpackage (relative to ${torque.targetPackage}) where Torque will put the generated Peer Java classes. If not set, the Peer classes will be generated in ${torque.targetPackage}
torque.subpackage.object Not set The subpackage (relative to ${torque.targetPackage}) where Torque will put the generated Object Java classes. If not set, the Object classes will be generated in ${torque.targetPackage}
torque.subpackage.map map The subpackage (relative to ${torque.targetPackage}) where Torque will put the generated Java classes for the database map.
torque.subpackage.manager Not set The subpackage (relative to ${torque.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 ${torque.targetPackage}
torque.subpackage.bean bean The subpackage (relative to ${torque.targetPackage}) where Torque will put the generated JavaBean classes, if they are generated at all.
torque.subpackage.base Not set The subpackage (relative to ${torque.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 ${torque.targetPackage}
torque.subpackage.base.bean bean The subpackage (relative to ${torque.targetPackage}) where Torque will put the generated BaseBean Java classes, if they are generated at all.
torque.runOnlyOnSchemaChange true When true the om goal will only be executed when the schema has actually been updated.
Directories and Paths
torque.home . The base directory for the input and output of files.
torque.templatePath templates The path relative to where Torque is being executed to load the Velocity templates from.
torque.output.dir ${torque.home}/target The base directory for the output files.
torque.schema.dir ${torque.home}/src/schema The base directory to reading *-schema.xml files from.
torque.doc.dir ${torque.output.dir}/doc The directory to place HTML documentation generated from the XML schema.
torque.java.dir ${maven.src.dir}/java The directory to place all of the generated Java code in.
torque.sql.dir ${torque.output.dir}/sql The directory to place all of the generated SQL in.
torque.javadoc.dir ${torque.output.dir}/javadoc The directory to javadocs generated from the Java om files.
torque.ojb.dir ${maven.src.dir}/ojb The directory to place all of the generated OJB code in.
torque.omzip.dir ${torque.output.dir} The directory to place the jar files output by the om-zip goal.
Database Settings
torque.database.createUrl N/A The JDBC URL that Torque can use to create and drop databases if instructed to do so. This is typically an administrative URL.
torque.database.buildUrl N/A The JDBC URL that will be used to access your database. Torque can use this to create your tables if instructed to do so. This value should reflect the database name specified in the database schema file (described in the next section).
torque.database.url N/A This should contain the same value as buildDatabaseURL. [not quite sure why both of these properties exist]
torque.database.driver N/A The JDBC database driver to use when connecting to your database.
torque.database.user N/A The administrative username that has sufficient privileges to create and drop databases and tables that Torque executes at build time.
torque.database.password N/A The administrative password for the supplied username.
torque.database.host N/A The hostname or IP address of your database server.
torque.database.schema N/A Used by the JDBC -> XML process, and by the SQL Ant Task that will initialize your target database with the generated SQL. This is only used by Oracle at this time. This must be UPPERCASE!
torque.database.name N/A The database name to use in the datadump target.
torque.database.manualCreation false When false, Torque can automatically execute the SQL to create your database tables via the create-db target. This will destroy old data, so manual creation is safer in non-dev environments.
torque.sameJavaName false
Template Variables
torque.addGetByNameMethod true If true, Torque adds methods to get database fields by name/position.
torque.addIntakeRetrievable false If true, the data objects will implement Intake's Retrievable interface
torque.retrievableInterface org.apache.turbine.om.Retrievable (for Turbine 2.2) Defines the Retrievable interface. (set to org.apache.fulcrum.intake.Retrievable if you are using Fulcrum)
torque.addSaveMethod true If true, Torque adds tracking code to determine how to save objects.
torque.saveException Exception Defines which Exception should be thrown by the Object.save() method.
torque.addTimeStamp true If true, Torque puts time stamps in generated om files.
torque.basePrefix Base A string to pre-pend to the file names of base data and peer objects.
torque.complexObjectModel true If true, Torque generates data objects with collection support and methods to easily retrieve foreign key relationships.
torque.useClasspath false If true, Torque will not look in the templatePath directory, for templates, but instead load them from the classpath, allowing you to use Torque without extracting it from the jar.
torque.useManagers false If true, Torque will generate Manager classes that use JCS for caching. Still considered experimental.
torque.objectIsCaching true If true, Torque generates data objects that cache their foreign key relationships. If this is not desired (because the underlying objects can be manipulated from other code), set this property to false. This currently cannot combined with the manager setting from above.
torque.correctGetters false If true, Torque generates is<xxx> getter methods for boolean columns. These are Bean-Spec compliant but break compatibility with all releases up to 3.1.1.
torque.generateBeans false If true, Torque generates a bean object for each data object, plus methods to convert data objects to beans and vive versa
torque.BeanSuffix Bean A string to append to the name of generated Beans
Misc. Settings
torque.idTableXMLFile N/A
torque.doc.format html Possible values are html and anakia.
torque.doc.html.normalFont font-family: Verdana; font-size: 10pt; The value for the CSS class normalFont that is used to format the text of the HTML output.
torque.doc.html.fkColor afe295 The color that the names of foreign key columns are highlighted with in the HTML output.
torque.initialID 101 Controls the starting id of table entries when creating SQL for the id-table. If you have two projects that use the same id-table in the same database with different tables, make sure that they have different initialID settings and the ranges (initialID is incremented for every new table) don't overlap.
torque.initialIDValue 1000 The start value of the ID broker for supplying IDs to Torque. This value is incremented every time Torque requests ID keys from the broker. If you pre-load your table straight from SQL, make sure that you don't accidentially overlap with this setting, because Torque doesn't keep record of what IDs are already taken in the database. If you overlap, inserting new objects will fail because the ID assigned by Torque is already taken.
torque.initialIDStep 10 For performance reasons, the ID Broker does not request a single ID at a time but fetches a whole range and increments the current next ID Value in the ID Table by this step. If you have to do lots of inserts straight in a row, increment this value to get slightly better performance.
torque.omzip.src.base false Whether the om generated base src (BaseX.java) files should be included in the src jar produced by om-zip.
torque.omzip.src.extension false Whether the om generated extension src (X.java) files should be included in the src jar produced by om-zip.
torque.omzip.bin.base false Whether the om generated base class (BaseX.class) files should be included in the bin jar produced by om-zip.
torque.omzip.bin.extension false Whether the om generated extension class (X.class) files should be included in the bin jar produced by om-zip.
torque.omzip.deleteFiles false Whether the generated om files should be deleted following the om-zip.
Compile Settings
torque.compile.src.dir ${torque.java.dir} Where to read the Java om source files.
torque.compile.build.dir bin/classes Where to put the compiled byte code for om classes.
torque.compile.debug on Whether the om classes are compiled with debug code.
torque.compile.deprecation off Whether the om classes are compiled with deprecation allowed.
torque.compile.optimize off Whether the om classes are optimized during compilation.