db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1364213 - in /db/torque/torque4/trunk: torque-templates/src/main/java/org/apache/torque/templates/platform/ torque-test/src/main/schema/ torque-test/src/test/java/org/apache/torque/generated/peer/
Date Sun, 22 Jul 2012 04:09:01 GMT
Author: tfischer
Date: Sun Jul 22 04:09:01 2012
New Revision: 1364213

URL: http://svn.apache.org/viewvc?rev=1364213&view=rev
Log:
TORQUE-217 implemented Date default values for mysql

Modified:
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMysqlImpl.java
    db/torque/torque4/trunk/torque-test/src/main/schema/default-value-schema.xml
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromDatabaseTest.java

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMysqlImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMysqlImpl.java?rev=1364213&r1=1364212&r2=1364213&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMysqlImpl.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMysqlImpl.java
Sun Jul 22 04:09:01 2012
@@ -35,7 +35,7 @@ import org.apache.torque.templates.typem
 public class PlatformMysqlImpl extends PlatformDefaultImpl
 {
     /** The date format for formatting database dates. */
-    private static String DATE_FORMAT = "''yyyyMMddHHmmss''";
+    private static String DATE_FORMAT = "''yyyy-MM-dd''";
 
     /**
      * Default constructor.

Modified: db/torque/torque4/trunk/torque-test/src/main/schema/default-value-schema.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/main/schema/default-value-schema.xml?rev=1364213&r1=1364212&r2=1364213&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/main/schema/default-value-schema.xml (original)
+++ db/torque/torque4/trunk/torque-test/src/main/schema/default-value-schema.xml Sun Jul 22
04:09:01 2012
@@ -80,23 +80,6 @@
       default="2010-09-08 11:12:13.0"
       useDatabaseDefaultValue="true"
     />
-    <column
-      name="CURRENT_DATE_VALUE"
-      type="DATE"
-      default="CURRENT_DATE"
-      useDatabaseDefaultValue="true"
-    />
-    <column
-      name="CURRENT_TIME_VALUE"
-      type="TIME"
-      default="CURRENT_TIME"
-      useDatabaseDefaultValue="true"
-    />
-    <column
-      name="CURRENT_TIMESTAMP_VALUE"
-      domain="myTimestamp"
-      useDatabaseDefaultValue="true"
-    />
   </table>
 
   <table name="java_default_values">

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromDatabaseTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromDatabaseTest.java?rev=1364213&r1=1364212&r2=1364213&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromDatabaseTest.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromDatabaseTest.java
Sun Jul 22 04:09:01 2012
@@ -365,9 +365,10 @@ public class DefaultValuesFromDatabaseTe
         {
             dateFormat = "''dd-MM-yyyy HH:mm:ss''";
         }
-        else if (defaultAdapter instanceof MysqlAdapter)
+        else if (defaultAdapter instanceof MysqlAdapter
+                && (classToSelect == java.sql.Time.class))
         {
-            dateFormat = "''yyyyMMddHHmmss''";
+            dateFormat = "''HH:mm:ss''";
         }
         else if (defaultAdapter instanceof MssqlAdapter)
         {



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


Mime
View raw message