You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by tf...@apache.org on 2010/08/31 05:44:31 UTC

svn commit: r991071 - in /db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/xsd: ./ torque-database-strict.xsd

Author: tfischer
Date: Tue Aug 31 03:44:31 2010
New Revision: 991071

URL: http://svn.apache.org/viewvc?rev=991071&view=rev
Log:
Greg's suggestion for a XSD schema

Added:
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/xsd/
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/xsd/torque-database-strict.xsd

Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/xsd/torque-database-strict.xsd
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/xsd/torque-database-strict.xsd?rev=991071&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/xsd/torque-database-strict.xsd (added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/xsd/torque-database-strict.xsd Tue Aug 31 03:44:31 2010
@@ -0,0 +1,987 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!--
+    Torque XML database schema DTD
+    $Id$
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           targetNamespace="http://db.apache.org/torque4.0"
+           xmlns="http://db.apache.org/torque4.0"
+           elementFormDefault="qualified"
+           version="4.0">
+           
+  <xs:annotation>
+    <xs:documentation xml:lang="en">
+The XML schema used by version 4.0 and greater of the Apache Software
+Foundation Torque project(
+<a href="http://db.apache.org/torque">http://db.apache.org/torque</a> )
+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.
+    </xs:documentation>
+  </xs:annotation>
+  
+<!-- =====================================
+     database element definition
+     ===================================== -->
+  <xs:element name="database" type="databaseType">
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+The root element for defining a Torque database schema.
+      </xs:documentation>
+    </xs:annotation>
+  </xs:element>
+
+  <xs:complexType name="databaseType">
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+The root type definition for a Torque database schema.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="option" type="optionType" minOccurs="0"
+                  maxOccurs="unbounded" >
+        <xs:annotation>
+          <xs:documentation xml:lang="en">
+A set of key/value options to be passed to custom generator templates.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>                  
+                  
+      <xs:element name="external-schema" type="externalSchemaType"
+                  minOccurs="0" maxOccurs="unbounded" >
+        <xs:annotation>
+          <xs:documentation xml:lang="en">
+Include another schema file.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="domain" type="domainType" minOccurs="0"
+                  maxOccurs="unbounded" >
+        <xs:annotation>
+          <xs:documentation xml:lang="en">
+Domains are used to define common attribute sets for columns.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="table" type="tableType" minOccurs="1"
+                  maxOccurs="unbounded" >
+        <xs:annotation>
+          <xs:documentation xml:lang="en">
+Define table with its relevant attributes.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:sequence>
+    <xs:attribute name="name" type="javaNameType" use="required">
+      <xs:annotation>
+        <xs:documentation xml:lang="en" >
+The name used to identify this schema in the generated
+Java objects and as the default JDBC connection pool to use.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="package" type="javaQualifiedNameType" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+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.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="baseClass" type="javaQualifiedNameType" use="optional">
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+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.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="basePeer" type="javaQualifiedNameType" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+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.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="defaultJavaNamingMethod" use="optional"
+                  type="namingMethodType" default="underscore" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+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.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="heavyIndexing" use="optional" type="xs:boolean"
+                  default="false" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+Adds extra indices for multi-part primary key columns. true or false,
+defaults to false. For databases like MySQL, values in a where 
+clause must match key part order from the left to right. 
+So, in the key definition PRIMARY KEY (FOO_ID, BAR_ID), FOO_ID must be the first
+element used in the where clause of the SQL query used against this 
+table for the primary key index to be used. This feature could cause
+problems under MySQL with heavily indexed tables, by causing too many
+indices to be created, overrunning MySQL's table limit.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="defaultJavaType" use="optional"
+                  type="javaReturnType" default="primitive" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+Defines if the record object property getter / setters will 
+use objects (e.g. Integer) or primitives (e.g. int), defaults
+to primitive.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="defaultIdMethod" use="optional" type="idBrokerType"
+                  default="none" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+Defines the defaultIdMethod to use with tables which do not have an idMethod
+attribute defined. This attribute has 4 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.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+
+<!-- =====================================
+     option element definition
+     ===================================== -->
+  <xs:complexType name="optionType">
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+These tags allows a set of key/value options to be passed to custom generator
+templates.
+      </xs:documentation>
+    </xs:annotation>
+      <xs:attribute name="key" type="xs:string" use="required" />
+      <xs:attribute name="value" type="xs:string" use="required" />
+  </xs:complexType>
+  
+<!-- =====================================
+     external-schema element definition
+     ===================================== -->
+  <xs:complexType name="externalSchemaType" >
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+Includes another schema file.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="filename" type="xs:string" use="required" />
+  </xs:complexType>
+  
+<!-- =====================================
+     domain element definition
+     ===================================== -->
+  <xs:complexType name="domainType" >
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+Domains are used to define attributes for columns.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="name" type="xs:string" use="required" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The name used to reference this set of column attributes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="type" use="optional" type="sqlDataType"
+                  default="VARCHAR" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The SQL Standard data type for the column
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="size" type="xs:decimal" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+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.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scale" type="xs:integer" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The scale of the field.  E.g.decimal(size, scale)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="default" type="xs:string" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The default column value
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="description" type="xs:string" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The description of this domain for documentation purposes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+  
+<!-- =====================================
+     table element definition
+     ===================================== -->
+  <xs:complexType name="tableType">
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+The table element and its relevant attributes.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="option" type="optionType" minOccurs="0"
+                  maxOccurs="unbounded" />
+      <xs:element name="column" type="columnType" maxOccurs="unbounded" >
+        <xs:annotation>
+          <xs:documentation xml:lang="en">
+The column element and its relevant attributes
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:choice minOccurs="0" maxOccurs="unbounded" >
+        <xs:element name="foreign-key" type="foreignKeyType">
+          <xs:annotation>
+            <xs:documentation xml:lang="en">
+Define a foreign key constraint for this table.
+            </xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="index" type="indexType" >
+          <xs:annotation>
+            <xs:documentation xml:lang="en">
+Defines an index for this table.
+            </xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="unique" type="uniqueType">
+          <xs:annotation>
+            <xs:documentation xml:lang="en">
+Define a unique value constraint
+            </xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="id-method-parameter" type="idMethodParameterType">
+        </xs:element>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute name="name" type="sqlNameType" use="required" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The table name of the SQL table.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="heavyIndexing" use="optional"
+                  type="xs:boolean" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+See heavyIndexing attribute in the database element.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="interface" type="javaQualifiedNameType"
+                  use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+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.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="alias" type="javaNameType" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+Makes this table definition become an "alias" stub (no SQL created) of either
+the baseClass attribute or the alias name.  Used mostly by Turbine.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="baseClass" type="javaQualifiedNameType" use="optional">
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+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.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="basePeer" type="javaQualifiedNameType" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+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.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="idMethod" use="optional" type="idBrokerType"
+                  default="null" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+Defines the defaultIdMethod to use with tables which do not have an idMethod
+attribute defined. This attribute has 4 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.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="abstract" use="optional" type="xs:boolean"
+                  default="false" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+Whether or not to generate the class as Abstract or not
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="javaName" type="javaNameType" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+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.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="skipSql" use="optional" type="xs:boolean"
+                  default="false" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+Whether or not to skip SQL generation for this reference.  Useful for using
+Views or creating a "subset" of columns in an existing table.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="description" type="xs:string" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+A description of this table.  Used for documentation and will be included in
+the table generation SQL if the server type supports this.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="javaNamingMethod" use="optional"
+                  type="namingMethodType" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+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.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+  
+<!-- =====================================
+     column element definition
+     ===================================== -->
+  <xs:complexType name="columnType">
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+The column element and its relevant attributes
+      </xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="option" type="optionType" minOccurs="0"
+                  maxOccurs="unbounded" />
+      <xs:element name="inheritance" type="inheritanceType" minOccurs="0"
+                  maxOccurs="unbounded" >
+        <xs:annotation>
+          <xs:documentation xml:lang="en">
+Define an inheritance mapping of records to class by a key column.  See the
+inheritance How To document.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+                  
+    </xs:sequence>
+    <xs:attribute name="name" type="sqlNameType" use="required" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The column name
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="type" use="optional" type="sqlDataType"
+                  default="VARCHAR" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The SQL Standard data type for the column
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="size" type="xs:decimal" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+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.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="scale" type="xs:integer" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The scale of the field.  E.g.decimal(size, scale)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="default" type="xs:string" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The default column value
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="primaryKey" use="optional"
+                  type="xs:boolean" default="false" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+Is this column a primary key or not (true or false, defaults to false)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="autoIncrement" use="optional"
+                  type="xs:boolean" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+Whether or not to auto-increment this field (true or false, defaults to false)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="required" use="optional" type="xs:boolean"
+                  default="false" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+Whether a value is required in this column (NULL ALLOWED) (true or false,
+defaults to false)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="javaName" type="javaNameType"
+                  use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The Java property name to use for this column in the record objects.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="javaType" use="optional"
+                  type="javaReturnType" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+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
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="domain" type="xs:string" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The domain reference name to set common settings.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="inheritance" type="inheritanceAttrType" use="optional"
+                  default="false" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The inheritance method used (see Inheritance How-To)
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="inputValidator" type="xs:string"
+                  use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+Simply sets the inputValidator property in the ColumnMap object for
+this column. Not used by torque directly.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="protected" use="optional"
+                  type="xs:boolean" default="false" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+If true, the setters and getters for this property will be protected rather
+than public.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="javaNamingMethod" use="optional"
+                  type="javaNameType" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The method to use to convert the column name to a valid Java property name.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="description" type="xs:string" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The description of this domain for documentation purposes.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+  
+<!-- =====================================
+     inheritance element definition
+     ===================================== -->
+  <xs:complexType name="inheritanceType">
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+Define an inheritance mapping of records to class by a key column.  See the
+inheritance How To document.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="key" type="xs:string" use="required" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+A value found in the column marked as the inheritance key column
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="class" type="javaNameType" use="required" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The class name for the object that will inherit the record values
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="extends" type="javaQualifiedNameType" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The class that the inheritor class will extend
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+  
+<!-- =====================================
+     foreign-key element definition
+     ===================================== -->
+  <xs:complexType name="foreignKeyType" >
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+Define a foreign key constraint for this table.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="option" type="optionType" minOccurs="0"
+                  maxOccurs="unbounded" />
+      <xs:element name="reference" type="referenceType" maxOccurs="unbounded" >
+        <xs:annotation>
+          <xs:documentation xml:lang="en">
+Define a mapping between a local column containing a foreign key value and
+the foreign table column.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:sequence>
+    <xs:attribute name="name" type="sqlNameType" use="optional" >
+        <xs:annotation>
+        <xs:documentation xml:lang="en">
+The name used to create the foreign key constraint.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="foreignTable" type="sqlNameType" use="required" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The name of the table that contains the foreign key
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onDelete" use="optional" type="cascadeType"
+                  default="none" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+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.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="onUpdate" use="optional" type="cascadeType"
+                  default="none" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+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.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+  
+<!-- =====================================
+     reference element definition
+     ===================================== -->
+  <xs:complexType name="referenceType" >
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+Define a mapping between a local column containing a foreign key value and
+the foreign table column.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="foreign" type="sqlNameType" use="required" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The column in the foreign table that contains the key.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="local" type="sqlNameType" use="required" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The column in this table that contains the foreign key.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+  
+<!-- =====================================
+     index element definition
+     ===================================== -->
+  <xs:complexType name="indexType" >
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+Defines an index for this table.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="option" type="optionType" minOccurs="0"
+                  maxOccurs="unbounded" />
+      <xs:element name="index-column" type="indexColumnType"
+                  maxOccurs="unbounded" >
+        <xs:annotation>
+          <xs:documentation xml:lang="en">
+Define a column to use in a table index.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:sequence>
+    <xs:attribute name="name" type="sqlNameType" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The name used in creating this index in the database.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+  
+<!-- =====================================
+     reference element definition
+     ===================================== -->
+  <xs:complexType name="indexColumnType" >
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+Define a column to use in a table index.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="name" type="sqlNameType" use="required" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+A column name to use in this index.  Must exist in the table.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+<!--
+  Removed to resolve Jira issue TORQUE-91
+    <xs:attribute name="size" type="xs:string"
+                  use="optional" />
+  -->
+  </xs:complexType>
+  
+<!-- =====================================
+     unique element definition
+     ===================================== -->
+  <xs:complexType name="uniqueType">
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+Define a unique value constraint
+      </xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="option" type="optionType" minOccurs="0"
+                  maxOccurs="unbounded" />
+      <xs:element name="unique-column" type="uniqueColumnType"
+                  maxOccurs="unbounded" >
+        <xs:annotation>
+          <xs:documentation xml:lang="en">
+Specify a column to use in the unique constraint.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:sequence>
+    <xs:attribute name="name" type="sqlNameType" use="optional" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The name to use in defining this constraint.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+  
+<!-- =====================================
+     unique-column element definition
+     ===================================== -->
+  <xs:complexType name="uniqueColumnType" >
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+Specify a column to use in the unique constraint.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="name" type="sqlNameType" use="required" >
+      <xs:annotation>
+        <xs:documentation xml:lang="en">
+The name to use in defining this constraint.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+  
+<!-- =====================================
+     id-method-parameter element definition
+     ===================================== -->
+  <xs:complexType name="idMethodParameterType">
+    <xs:attribute name="name" type="xs:string" use="optional"
+                  default="default" />
+    <xs:attribute name="value" type="xs:string"
+                  use="required" />
+  </xs:complexType>
+
+<!-- =====================================
+    Type definitions for attributes
+     ===================================== -->
+
+  <xs:simpleType name="sqlDataType">
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+Standard SQL column data types.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:NMTOKEN">
+      <xs:enumeration value="BIT" />
+      <xs:enumeration value="TINYINT" />
+      <xs:enumeration value="SMALLINT" />
+      <xs:enumeration value="INTEGER" />
+      <xs:enumeration value="BIGINT" />
+      <xs:enumeration value="FLOAT" />
+      <xs:enumeration value="REAL" />
+      <xs:enumeration value="NUMERIC" />
+      <xs:enumeration value="DECIMAL" />
+      <xs:enumeration value="CHAR" />
+      <xs:enumeration value="VARCHAR" />
+      <xs:enumeration value="LONGVARCHAR" />
+      <xs:enumeration value="DATE" />
+      <xs:enumeration value="TIME" />
+      <xs:enumeration value="TIMESTAMP" />
+      <xs:enumeration value="BINARY" />
+      <xs:enumeration value="VARBINARY" />
+      <xs:enumeration value="LONGVARBINARY" />
+      <xs:enumeration value="NULL" />
+      <xs:enumeration value="OTHER" />
+      <xs:enumeration value="JAVA_OBJECT" />
+      <xs:enumeration value="DISTINCT" />
+      <xs:enumeration value="STRUCT" />
+      <xs:enumeration value="ARRAY" />
+      <xs:enumeration value="BLOB" />
+      <xs:enumeration value="CLOB" />
+      <xs:enumeration value="REF" />
+      <xs:enumeration value="BOOLEANINT" />
+      <xs:enumeration value="BOOLEANCHAR" />
+      <xs:enumeration value="DOUBLE" />
+    </xs:restriction>
+  </xs:simpleType>
+  
+  <xs:simpleType name="idBrokerType">
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+A schema type for idBroker methods.  An idBroker defines the way that
+record id values will be automatically created.
+
+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.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:NMTOKEN">
+      <xs:enumeration value="idbroker" />
+      <xs:enumeration value="native" />
+      <xs:enumeration value="none" />
+      <xs:enumeration value="null" />
+    </xs:restriction>
+  </xs:simpleType>
+  
+  <xs:simpleType name="namingMethodType">
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+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.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:NMTOKEN">
+      <xs:enumeration value="nochange" />
+      <xs:enumeration value="underscore" />
+      <xs:enumeration value="underscoreOmitSchema" />
+      <xs:enumeration value="javaname" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="javaReturnType">
+    <xs:restriction base="xs:NMTOKEN">
+      <xs:enumeration value="object" />
+      <xs:enumeration value="primitive" />
+    </xs:restriction>
+  </xs:simpleType>
+  
+  <xs:simpleType name="cascadeType" >
+    <xs:restriction base="xs:NMTOKEN">
+      <xs:enumeration value="cascade" />
+      <xs:enumeration value="setnull" />
+      <xs:enumeration value="restrict" />
+      <xs:enumeration value="none" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="inheritanceAttrType">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="single" />
+      <xs:enumeration value="false" />
+    </xs:restriction>
+  </xs:simpleType>
+  
+  <xs:simpleType name="javaNameType">
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+Java identifiers, e.g. [A-Za-z_$]A-Za-z_$0-9]*
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[A-Za-z_$][A-Za-z_$0-9]*" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="javaQualifiedNameType">
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+Java fully qualified names (e.g. x.y.x)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern
+              value="([A-Za-z_$][A-Za-z_$0-9]*[.])*[A-Za-z_$][A-Za-z_$0-9]*" />
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="sqlNameType">
+    <xs:annotation>
+      <xs:documentation xml:lang="en">
+SQL Standard non-delimited identifiers.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[A-Za-z$#][A-Za-z_$#0-9]*" />
+    </xs:restriction>
+  </xs:simpleType>
+
+</xs:schema>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org