db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1365098 - in /db/torque/torque4/trunk: torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromDatabaseTest.java
Date Tue, 24 Jul 2012 14:51:26 GMT
Author: tfischer
Date: Tue Jul 24 14:51:26 2012
New Revision: 1365098

URL: http://svn.apache.org/viewvc?rev=1365098&view=rev
Log:
TORQUE-217 implemented date default values for oracle

Modified:
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java
    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/PlatformOracleImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java?rev=1365098&r1=1365097&r2=1365098&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java
Tue Jul 24 14:51:26 2012
@@ -36,13 +36,16 @@ import org.apache.torque.templates.typem
 public class PlatformOracleImpl extends PlatformDefaultImpl
 {
     /** The date format for formatting database dates. */
-    private static String DATE_FORMAT = "''dd-MMM-yy''";
+    private static String DATE_FORMAT
+        = "'to_date('''yyyy-MM-dd''',''yyyy-mm-dd'')'";
 
     /** The date format for formatting database dates. */
-    private static String TIME_FORMAT = "''KK:mm:ss a''";
+    private static String TIME_FORMAT
+        = "'to_date('''1970-01-01 HH:mm:ss''',''yyyy-mm-dd hh24:mi:ss'')'";
 
     /** The date format for formatting database dates. */
-    private static String TIMESTAMP_FORMAT = "''dd-MMM-yyyy KK:mm:ss a''";
+    private static String TIMESTAMP_FORMAT
+        = "'to_timestamp('''yyyy-MM-dd HH:mm:ss''',''yyyy-mm-dd hh24:mi:ss'')'";
 
     /**
      * Default constructor.

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=1365098&r1=1365097&r2=1365098&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
Tue Jul 24 14:51:26 2012
@@ -363,7 +363,7 @@ public class DefaultValuesFromDatabaseTe
         String dateFormat;
         if (defaultAdapter instanceof OracleAdapter)
         {
-            dateFormat = "''dd-MM-yyyy HH:mm:ss''";
+            dateFormat = "'to_timestamp('''yyyy-MM-dd HH:mm:ss''',''yyyy-mm-dd hh24:mi:ss'')'";
         }
         else if (defaultAdapter instanceof MysqlAdapter
                 && (classToSelect == java.sql.Time.class))



---------------------------------------------------------------------
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