db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1365852 - /db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/templates/specialFeatures.xml
Date Thu, 26 Jul 2012 00:19:22 GMT
Author: tfischer
Date: Thu Jul 26 00:19:22 2012
New Revision: 1365852

URL: http://svn.apache.org/viewvc?rev=1365852&view=rev
improved default values documentation


Modified: db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/templates/specialFeatures.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/templates/specialFeatures.xml?rev=1365852&r1=1365851&r2=1365852&view=diff
--- db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/templates/specialFeatures.xml
+++ db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/templates/specialFeatures.xml
Thu Jul 26 00:19:22 2012
@@ -25,7 +25,22 @@
-  <section name="Date Default values">
+  <section name="Default values">
+    <p>
+      If a default is specified, the default value is used on both a new java object
+      and as column default value in the sql script for the database.
+      However, when a java object is saved, the database value is always
+      overwritten because the normal behavior for saving a new object
+      is to write all fields.
+      This behavior can be overwritten by setting the column attribute
+      useDatabaseDefaultValue to true. In this case, the column is not
+      written on inserts if the value of the corresponding java field
+      is equal to the default.<br/>
+      It is a good idea to have a non-primary key field in each table where 
+      useDatabaseDefaultValue is not set because otherwise you could run into
+      SQL syntax errors when an unchanged new object is changed
+      (because there are no values to insert).
+    </p>
       as default for Date fields.

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

View raw message