db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1364559 - in /db/torque/torque4/trunk/torque-templates/src/main: java/org/apache/torque/templates/transformer/om/ resources/org/apache/torque/templates/om/templates/dbObject/base/
Date Mon, 23 Jul 2012 09:54:53 GMT
Author: tfischer
Date: Mon Jul 23 09:54:52 2012
New Revision: 1364559

URL: http://svn.apache.org/viewvc?rev=1364559&view=rev
Log:
TORQUE-217 renamed method to retrieve current date, time or timestamp

Modified:
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMColumnTransformer.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/TableAttributeName.java
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getCurrentDate.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getCurrentTime.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getCurrentTimestamp.vm

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMColumnTransformer.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMColumnTransformer.java?rev=1364559&r1=1364558&r2=1364559&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMColumnTransformer.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMColumnTransformer.java
Mon Jul 23 09:54:52 2012
@@ -74,14 +74,14 @@ public class OMColumnTransformer
     static final String CURRENT_TIMESTAMP = "CURRENT_TIMESTAMP";
 
     /** Constant for the getDefaultDate method name. */
-    static final String GET_DEFAULT_DATE_METHOD_NAME = "getDefaultDate";
+    static final String GET_DEFAULT_DATE_METHOD_NAME = "getCurrentDate";
 
     /** Constant for the getDefaultTime method name. */
-    static final String GET_DEFAULT_TIME_METHOD_NAME = "getDefaultTime";
+    static final String GET_DEFAULT_TIME_METHOD_NAME = "getCurrentTime";
 
     /** Constant for the getDefaultTimestamp method name. */
     static final String GET_DEFAULT_TIMESTAMP_METHOD_NAME
-            = "getDefaultTimestamp";
+            = "getCurrentTimestamp";
 
     /** Prevents reserved java words. */
     private static WrapReservedJavaWords reservedJavaWordsWrapper
@@ -741,11 +741,11 @@ public class OMColumnTransformer
                     {
                         String methodName;
                         if (columnElement.getParent().getAttribute(
-                                TableAttributeName.GET_DEFAULT_DATE_METHOD_NAME)
+                                TableAttributeName.GET_CURRENT_DATE_METHOD_NAME)
                             != null)
                         {
                             methodName = columnElement.getParent().getAttribute(
-                                    TableAttributeName.GET_DEFAULT_DATE_METHOD_NAME)
+                                    TableAttributeName.GET_CURRENT_DATE_METHOD_NAME)
                                 .toString();
                         }
                         else
@@ -758,11 +758,11 @@ public class OMColumnTransformer
                     {
                         String methodName;
                         if (columnElement.getParent().getAttribute(
-                                TableAttributeName.GET_DEFAULT_TIME_METHOD_NAME)
+                                TableAttributeName.GET_CURRENT_TIME_METHOD_NAME)
                             != null)
                         {
                             methodName = columnElement.getParent().getAttribute(
-                                    TableAttributeName.GET_DEFAULT_TIME_METHOD_NAME)
+                                    TableAttributeName.GET_CURRENT_TIME_METHOD_NAME)
                                 .toString();
                         }
                         else
@@ -775,11 +775,11 @@ public class OMColumnTransformer
                     {
                         String methodName;
                         if (columnElement.getParent().getAttribute(
-                                TableAttributeName.GET_DEFAULT_TIMESTAMP_METHOD_NAME)
+                                TableAttributeName.GET_CURRENT_TIMESTAMP_METHOD_NAME)
                             != null)
                         {
                             methodName = columnElement.getParent().getAttribute(
-                                    TableAttributeName.GET_DEFAULT_TIMESTAMP_METHOD_NAME)
+                                    TableAttributeName.GET_CURRENT_TIMESTAMP_METHOD_NAME)
                                 .toString();
                         }
                         else

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java?rev=1364559&r1=1364558&r2=1364559&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java
Mon Jul 23 09:54:52 2012
@@ -522,33 +522,33 @@ public class OMTableAndViewTransformer e
                 if (CURRENT_DATE.equalsIgnoreCase(defaultValue))
                 {
                     if (tableElement.getAttribute(
-                            TableAttributeName.GET_DEFAULT_DATE_METHOD_NAME)
+                            TableAttributeName.GET_CURRENT_DATE_METHOD_NAME)
                         == null)
                     {
                         tableElement.setAttribute(
-                                TableAttributeName.GET_DEFAULT_DATE_METHOD_NAME,
+                                TableAttributeName.GET_CURRENT_DATE_METHOD_NAME,
                                 GET_DEFAULT_DATE_METHOD_NAME);
                     }
                 }
                 else if (CURRENT_TIME.equalsIgnoreCase(defaultValue))
                 {
                     if (tableElement.getAttribute(
-                            TableAttributeName.GET_DEFAULT_TIME_METHOD_NAME)
+                            TableAttributeName.GET_CURRENT_TIME_METHOD_NAME)
                         == null)
                     {
                         tableElement.setAttribute(
-                                TableAttributeName.GET_DEFAULT_TIME_METHOD_NAME,
+                                TableAttributeName.GET_CURRENT_TIME_METHOD_NAME,
                                 GET_DEFAULT_TIME_METHOD_NAME);
                     }
                 }
                 else if (CURRENT_TIMESTAMP.equalsIgnoreCase(defaultValue))
                 {
                     if (tableElement.getAttribute(
-                        TableAttributeName.GET_DEFAULT_TIMESTAMP_METHOD_NAME)
+                        TableAttributeName.GET_CURRENT_TIMESTAMP_METHOD_NAME)
                         == null)
                     {
                         tableElement.setAttribute(
-                            TableAttributeName.GET_DEFAULT_TIMESTAMP_METHOD_NAME,
+                            TableAttributeName.GET_CURRENT_TIMESTAMP_METHOD_NAME,
                             GET_DEFAULT_TIMESTAMP_METHOD_NAME);
                     }
                 }

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/TableAttributeName.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/TableAttributeName.java?rev=1364559&r1=1364558&r2=1364559&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/TableAttributeName.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/TableAttributeName.java
Mon Jul 23 09:54:52 2012
@@ -96,19 +96,19 @@ public enum TableAttributeName implement
      * The variable name in which the name of the getDefaultDate method
      * us defined, is it should be generated.
      */
-    GET_DEFAULT_DATE_METHOD_NAME("getDefaultDateMethodName"),
+    GET_CURRENT_DATE_METHOD_NAME("getCurrentDateMethodName"),
 
     /**
      * The variable name in which the name of the getDefaultTime method
      * us defined, is it should be generated.
      */
-    GET_DEFAULT_TIME_METHOD_NAME("getDefaultTimeMethodName"),
+    GET_CURRENT_TIME_METHOD_NAME("getCurrentTimeMethodName"),
 
     /**
      * The variable name in which the name of the getDefaultTimestamp method
      * us defined, is it should be generated.
      */
-    GET_DEFAULT_TIMESTAMP_METHOD_NAME("getDefaultTimestampMethodName");
+    GET_CURRENT_TIMESTAMP_METHOD_NAME("getCurrentTimestampMethodName");
 
 
     /** The name of the source element attribute, not null. */

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getCurrentDate.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getCurrentDate.vm?rev=1364559&r1=1364558&r2=1364559&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getCurrentDate.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getCurrentDate.vm
Mon Jul 23 09:54:52 2012
@@ -28,14 +28,14 @@
 ## The template expects as input a "table" element from the torque schema
 ## which was processed by the OMTransformer.
 ##
-#set ($getDefaultDateMethodName = ${torqueGen.getAttribute("getDefaultDateMethodName")})
-#if (${getDefaultDateMethodName})
+#set ($getCurrentDateMethodName = ${torqueGen.getAttribute("getCurrentDateMethodName")})
+#if (${getCurrentDateMethodName})
     /**
      * Returns the current java date for use as default value.
      *
      * @return the current java date.
      */
-    protected Date ${getDefaultDateMethodName}()
+    protected Date ${getCurrentDateMethodName}()
     {
         GregorianCalendar calendar = new GregorianCalendar();
         calendar.set(GregorianCalendar.HOUR_OF_DAY, 0);

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getCurrentTime.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getCurrentTime.vm?rev=1364559&r1=1364558&r2=1364559&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getCurrentTime.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getCurrentTime.vm
Mon Jul 23 09:54:52 2012
@@ -25,14 +25,13 @@
 ## The template expects as input a "table" element from the torque schema
 ## which was processed by the OMTransformer.
 ##
-#set ($getDefaultTimeMethodName = ${torqueGen.getAttribute("getDefaultTimeMethodName")})
-#if (${getDefaultTimeMethodName})
+#if (${getCurrentTimeMethodName})
     /**
      * Returns the current java time for use as default value.
      *
      * @return the current java time.
      */
-    protected Date ${getDefaultTimeMethodName}()
+    protected Date ${getCurrentTimeMethodName}()
     {
         GregorianCalendar calendar = new GregorianCalendar();
         calendar.set(1970,01,01);

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getCurrentTimestamp.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getCurrentTimestamp.vm?rev=1364559&r1=1364558&r2=1364559&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getCurrentTimestamp.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/dbObject/base/getCurrentTimestamp.vm
Mon Jul 23 09:54:52 2012
@@ -25,14 +25,13 @@
 ## The template expects as input a "table" element from the torque schema
 ## which was processed by the OMTransformer.
 ##
-#set ($getDefaultTimestampMethodName = ${torqueGen.getAttribute("getDefaultTimestampMethodName")})
-#if (${getDefaultTimestampMethodName})
+#if (${getCurrentTimestampMethodName})
     /**
      * Returns the current java timestamp for use as default value.
      *
      * @return the current java timestamp.
      */
-    protected Date ${getDefaultTimestampMethodName}()
+    protected Date ${getCurrentTimestampMethodName}()
     {
         return new Date();
     }



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