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 2014/10/06 22:23:39 UTC

svn commit: r1629756 - /db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/orm-reference/defining-the-schema.xml

Author: tfischer
Date: Mon Oct  6 20:23:38 2014
New Revision: 1629756

URL: http://svn.apache.org/r1629756
Log:
TORQUE-329 Create better schema documentation

Modified:
    db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/orm-reference/defining-the-schema.xml

Modified: db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/orm-reference/defining-the-schema.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/orm-reference/defining-the-schema.xml?rev=1629756&r1=1629755&r2=1629756&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/orm-reference/defining-the-schema.xml (original)
+++ db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/orm-reference/defining-the-schema.xml Mon Oct  6 20:23:38 2014
@@ -639,7 +639,7 @@
             <td></td>
           </tr>
           <tr>
-            <td>default</td>
+            <td>useDatabaseDefaultValue</td>
             <td>
               Whether to use the database default value 
               if a new object is saved
@@ -723,8 +723,7 @@
               will be protected rather than public.
               Allowed values are true and false.
             </td>
-            <td>
-            </td>
+            <td>false</td>
           </tr>
           <tr>
             <td>version</td>
@@ -1141,6 +1140,225 @@
         If you cannot create the sql like this, you can also fill the attribute
         createSql with the sql needed to create the sql.
       </p>
+      <p>
+        The view element can contain the following elements:
+        <table>
+          <tr>
+            <th>element</th>
+            <th>description / reference</th>
+            <th></th>
+          </tr>
+          <tr>
+            <td>option</td>
+            <td>currently not used by the torque templates</td>
+            <td>0 or more times</td>
+          </tr>
+          <tr>
+            <td>column</td>
+            <td>see <a href="#View_Columns">View columns</a></td>
+            <td>1 or more times</td>
+          </tr>
+        </table>
+      </p>
+      <p>
+        The view element can contain the following attributes:
+        <table>
+          <tr>
+            <th>attribute</th>
+            <th>description / reference</th>
+            <th>default value</th>
+          </tr>
+          <tr>
+            <td>name</td>
+            <td>The SQL name of the view</td>
+            <td></td>
+          </tr>
+          <tr>
+            <td>baseClass</td>
+            <td>
+              The fully qualified name of class 
+              which the generated data object class extends
+            </td>
+            <td></td>
+          </tr>
+          <tr>
+            <td>basePeer</td>
+            <td>
+              The fully qualified name of class 
+              which the generated peer class extends
+            </td>
+            <td></td>
+          </tr>
+          <tr>
+            <td>abstract</td>
+            <td>
+              Whether the generated data object class should be abstract
+            </td>
+            <td>false</td>
+          </tr>
+          <tr>
+            <td>javaName</td>
+            <td>
+              The base name of the generated java classes
+            </td>
+            <td>generated from the SQL name</td>
+          </tr>
+          <tr>
+            <td>sqlSuffix</td>
+            <td>
+              The suffix after the select column for the view creation SQL.
+            </td>
+            <td></td>
+          </tr>
+          <tr>
+            <td>createSql</td>
+            <td>
+              The SQL to create the view.
+            </td>
+            <td>
+              computed from the select attributes of the columns 
+              and the sqlSuffix attribute of the view
+            </td>
+          </tr>
+          <tr>
+            <td>skipSql</td>
+            <td>
+              Whether to skip the create statement 
+              when generating the schema creation sql
+            </td>
+            <td>false</td>
+          </tr>
+          <tr>
+            <td>description</td>
+            <td>A description of the view</td>
+            <td></td>
+          </tr>
+        </table>
+      </p>
+    </subsection>
+
+    <subsection name="View Columns">
+      <p>
+        View columns are similar for table columns, but have a different
+        set of attributes because views are read-only and have a different
+        creation SQL than tables.
+      </p>
+      <p>
+        The column element in a view can contain the following elements:
+        <table>
+          <tr>
+            <th>element</th>
+            <th>description / reference</th>
+            <th></th>
+          </tr>
+          <tr>
+            <td>option</td>
+            <td>currently not used by the torque templates</td>
+            <td>0 or more times</td>
+          </tr>
+          <tr>
+            <td>inheritance</td>
+            <td>see <a href="#Inheritance">Inheritance</a></td>
+            <td>0 or more times</td>
+          </tr>
+        </table>
+      </p>
+      <p>
+        The column element in a view can contain the following attributes:
+        <table>
+          <tr>
+            <th>attribute</th>
+            <th>description / reference</th>
+            <th>default value</th>
+          </tr>
+          <tr>
+            <td>name</td>
+            <td>The SQL name of the column</td>
+            <td></td>
+          </tr>
+          <tr>
+            <td>type</td>
+            <td>
+              The SQL type of the column, also determines the java type.
+              Required unless the domain attribute is set.
+              Note that not every type is supported by every database.
+              Also note that for most (but not all) data types, the javaType
+              of the column can be automatically determined from the SQL type.
+              Possible values are BIT, TINYINT, SMALLINT, INTEGER, BIGINT, 
+              FLOAT, REAL, NUMERIC, DECIMAL, CHAR, VARCHAR, LONGVARCHAR, 
+              DATE, TIME, TIMESTAMP, BINARY, VARBINARY, LONGVARBINARY, 
+              NULL, OTHER, JAVA_OBJECT, DISTINCT, STRUCT, ARRAY, BLOB, CLOB, 
+              REF, BOOLEANINT, BOOLEANCHAR and DOUBLE.
+            </td>
+            <td></td>
+          </tr>
+          <tr>
+            <td>description</td>
+            <td>A description of the column.</td>
+            <td></td>
+          </tr>
+          <tr>
+            <td>size</td>
+            <td>
+              The SQL size of the column. Must be an integer.
+              Does only make sense for some SQL Types.
+            </td>
+            <td></td>
+          </tr>
+          <tr>
+            <td>scale</td>
+            <td>
+              The SQL scale of the column (number of digits after the comma).
+              Must be an integer. Does only make sense for some SQL Types.
+            </td>
+            <td></td>
+          </tr>
+          <tr>
+            <td>javaName</td>
+            <td>
+              The base name for the column for generating 
+              java methods and fields.
+            </td>
+            <td>
+              Determined from the name attribute.
+            </td>
+          </tr>
+          <tr>
+            <td>javaType</td>
+            <td>
+              The java type for the java representation of the column.
+            </td>
+            <td>
+              For most types, determined from the type attribute.
+            </td>
+          </tr>
+          <tr>
+            <td>domain</td>
+            <td>
+              The <a href="#Domains">domain</a> to use for this column.
+            </td>
+            <td>
+            </td>
+          </tr>
+          <tr>
+            <td>protected</td>
+            <td>
+              If true, the generated java setters and getters for this property 
+              will be protected rather than public.
+              Allowed values are true and false.
+            </td>
+            <td>false</td>
+          </tr>
+          <tr>
+            <td>select</td>
+            <td>
+              The SQL snippet which reads the view column value.
+            </td>
+            <td>
+            </td>
+          </tr>
+        </table>
+      </p>
     </subsection>
 
     <subsection name="Domains">



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