The XML schema used by version 4.0 and greater of the Apache Software
Foundation Torque project(
http://db.apache.org/torque )
to model SQL database information. This model is used by various Torque
utilities for managing the SQL Server info and to build the Java objects
to access this data.
The basic structure of a model is built using the database element
as the root. This will contain references to options, external (include)
models, new SQL Domain definitions, and tables. See the Torque project
home page for more details.
The root element for defining a Torque database schema.
The root type definition for a Torque database schema.
A set of key/value options to be passed to custom generator templates.
Include another schema file.
Domains are used to define common attribute sets for columns.
Define table with its relevant attributes.
The name used to identify this schema in the generated
Java objects and as the default JDBC connection pool to use.
The base Java package to use for the Java classes generated by this schema.
This overrides the targetPackage property in the Torque build.properties file.
The fully qualified class that the generated Java table record objects will
extend. This class does not have to extend org.apache.torque.om.BaseObject.
The fully qualified class that the generated Java Peer objects will extend.
Unlike baseClass, basePeer should extend BasePeer at some point in the chain,
i.e. it needs to be the superclass.
This attribute determines how table or column names, from the name
attribute of the table or column element, are converted to a Java
class or method name respectively when creating the OM Java
objects. There are three different options:
- nochange
Indicates no change is performed
- underscore
Underscores are removed, First letter is capitalized,
first letter after an underscore is capitalized, the
rest of the letters are converted to lowercase.
- javaname
Same as underscore, but no letters are converted to lowercase.
- null
Use the value previously set or the default value.
Defines if the record object property getter / setters will
use objects (e.g. Integer) or primitives (e.g. int), defaults
to primitive.
Defines the defaultIdMethod to use with tables which do not have an idMethod
attribute defined. This attribute has 3 possible values, they are:
- idbroker
Torque's software based id broker system
- native
The SQL Server's native autoincrement/identifier process
- none
Don't try to auto assign id numbers
- null
Use the value previously set or the default value.
These tags allows a set of key/value options to be passed to custom generator
templates.
Includes another schema file.
Domains are used to define attributes for columns.
The name used to reference this set of column attributes.
The SQL Standard data type for the column
The size of the field. E.g. Varchar(size) or Numeric(Size). Note that
while this still supports the original torque use of using a
decimal number (5.2) to indicate the precision
and scale in one attribute. Use of the scale attribute is preferred.
The scale of the field. E.g.decimal(size, scale)
The default column value
The description of this domain for documentation purposes.
The table element and its relevant attributes.
The column element and its relevant attributes
Define a foreign key constraint for this table.
Defines an index for this table.
Define a unique value constraint
The table name of the SQL table.
The interface attribute specifies an interface that should be referenced in
the implements section of the generated extension class. If this is a fully
qualified class name (i. e. the string contains dots), the interface will
simply be implemented by the extension object. If the interface is a simple
class name (without dots), an empty interface file will be generated in the
extension object package. When this attribute is used, all methods that
normally would return the extension object type will now return the interface
type. This feature allows to use Torque generated classes in the context of
other applications or APIs.
The fully qualified class that the generated Java table
record objects will extend. This class does not have to extend
org.apache.torque.om.BaseObject.
The fully qualified class that the generated Java Peer objects will extend.
Unlike baseClass, basePeer should extend BasePeer at some point in the chain,
i.e. it needs to be the superclass.
Defines the id method to automatically generate ids for this table.
This attribute has 3 possible values, they are:
- idbroker
Torque's software based id broker system
- native
The SQL Server's native autoincrement / identifier process
- none
Don't try to auto assign id numbers
Whether or not to generate the class as Abstract or not
This is the Java class name to use when generating the Table or column. If
this is missing the Java name is generated base on the Java Naming Method
setting.
Whether or not to skip SQL generation for this reference. Useful for using
Views or creating a "subset" of columns in an existing table.
A description of this table. Used for documentation and will be included in
the table generation SQL if the server type supports this.
This attribute determines how the table and column names in this table
definition are converted to a Java class or method name respectively when
creating the OM Java objects. There are four different options:
- nochange
Indicates no change is performed
- underscore
Underscores are removed, First letter is capitalized, first letter
after an underscore is capitalized, the rest of the letters are
converted to lowercase.
- javaname
Same as underscore, but no letters are converted to lowercase.
- null
Use the value previously set or the default value.
The column element and its relevant attributes
Define an inheritance mapping of records to class by a key column. See the
inheritance How To document.
The column name
The SQL Standard data type for the column
The size of the field. E.g. Varchar(size) or Numeric(Size). Note that
while this still supports the original torque use of using a
decimal number (5.2) to indicate the precision
and scale in one attribute. Use of the scale attribute is preferred.
The scale of the field. E.g.decimal(size, scale)
The default column value
Is this column a primary key or not (true or false, defaults to false)
Whether or not to auto-increment this field (true or false, defaults to false)
Whether a value is required in this column (NULL ALLOWED) (true or false,
defaults to false)
The Java property name to use for this column in the record objects.
Defines if the record object property getter / setters will
use objects (e.g. Integer) or primitives (e.g. int), defaults
to database attribute or primitive
The domain reference name to set common settings.
The inheritance method used (see Inheritance How-To)
If true, the setters and getters for this property will be protected rather
than public.
The method to use to convert the column name to a valid Java property name.
The description of this domain for documentation purposes.
Define an inheritance mapping of records to class by a key column. See the
inheritance How To document.
A value found in the column marked as the inheritance key column
The class name for the object that will inherit the record values
The class that the inheritor class will extend
Define a foreign key constraint for this table.
Define a mapping between a local column containing a foreign key value and
the foreign table column.
The name used to create the foreign key constraint.
The name of the table that contains the foreign key
The action to take when the referenced value in foreignTable is deleted.
Note this is handled by the database server and not Torque code. Will not
work if the DB server does not support this.
The action to take when the referenced value in foreignTable is updated.
Note this is handled by the database server and not Torque code. Will not
work if the DB server does not support this.
Define a mapping between a local column containing a foreign key value and
the foreign table column.
The column in the foreign table that contains the key.
The column in this table that contains the foreign key.
Defines an index for this table.
Define a column to use in a table index.
The name used in creating this index in the database.
Define a column to use in a table index.
A column name to use in this index. Must exist in the table.
Define a unique value constraint
Specify a column to use in the unique constraint.
The name to use in defining this constraint.
Specify a column to use in the unique constraint.
The name to use in defining this constraint.
Standard SQL column data types.
A schema type for methods to create ids automatically.
idbroker = Torque's software based id broker system
native = The SQL Server's native method, depends on database used
(e.g. autoincrement for MySQL, sequence for postgresql...)
none = Don't try to auto assign id numbers
This attribute determines how table or column names, from the name attribute
of the table or column element, are converted to a Java class or method
name respectively when creating the OM Java objects.
defaultJavaNamingMethod can contain four different values:
nochange = Indicates no change is performed
underscore = Underscores are removed, First letter is capitalized,
first letter after an underscore is capitalized, the
rest of the letters are converted to lowercase.
javaname = Same as underscore, but no letters are converted to lowercase.
null = Use the value previously set or the default value.
Java identifiers, e.g. [A-Za-z_$]A-Za-z_$0-9]*
Java fully qualified names (e.g. x.y.x)
SQL Standard non-delimited identifiers.