empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1201472 - in /incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db: DBDatabaseDriver.java sqlserver/DBDatabaseDriverMSSQL.java
Date Sun, 13 Nov 2011 18:45:14 GMT
Author: doebele
Date: Sun Nov 13 18:45:14 2011
New Revision: 1201472

URL: http://svn.apache.org/viewvc?rev=1201472&view=rev
Log:
EMPIREDB-122
improved function names

Modified:
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabaseDriver.java
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabaseDriver.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabaseDriver.java?rev=1201472&r1=1201471&r2=1201472&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabaseDriver.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabaseDriver.java
Sun Nov 13 18:45:14 2011
@@ -618,19 +618,19 @@ public abstract class DBDatabaseDriver i
         switch (type)
         {
             case DATE:
-                return getDateTimeString(value, SQL_DATE_TEMPLATE, SQL_DATE_PATTERN, SQL_CURRENT_DATE);
+                return getSQLDateTimeString(value, SQL_DATE_TEMPLATE, SQL_DATE_PATTERN, SQL_CURRENT_DATE);
             case DATETIME:
                 // System date is special case
                 if (!DBDatabase.SYSDATE.equals(value) && value.toString().length()<=10)
-                    return getDateTimeString(value, SQL_DATE_TEMPLATE, SQL_DATE_PATTERN,
SQL_CURRENT_DATETIME);
+                    return getSQLDateTimeString(value, SQL_DATE_TEMPLATE, SQL_DATE_PATTERN,
SQL_CURRENT_DATETIME);
                 // Complete Date-Time Object with time 
-                return getDateTimeString(value, SQL_DATETIME_TEMPLATE, SQL_DATETIME_PATTERN,
SQL_CURRENT_DATETIME);
+                return getSQLDateTimeString(value, SQL_DATETIME_TEMPLATE, SQL_DATETIME_PATTERN,
SQL_CURRENT_DATETIME);
             case TEXT:
             case CHAR:
             case CLOB:
             case UNIQUEID:
             {   // Text value
-                return getTextString(type, value);
+                return getSQLTextString(type, value);
             }
             case BOOL:
             {   // Get Boolean value   
@@ -657,7 +657,7 @@ public abstract class DBDatabaseDriver i
      * @param sqlCurrentDate
      * @return
      */
-    protected String getDateTimeString(Object value, int sqlTemplate, int sqlPattern, int
sqlCurrentDate)
+    protected String getSQLDateTimeString(Object value, int sqlTemplate, int sqlPattern,
int sqlCurrentDate)
     {
         // is it a sysdate expression
         if (DBDatabase.SYSDATE.equals(value))
@@ -692,12 +692,12 @@ public abstract class DBDatabaseDriver i
      * @param value the text to be encoded
      * @return the encoded sql value
      */
-    protected String getTextString(DataType type, Object value)
+    protected String getSQLTextString(DataType type, Object value)
     {
         StringBuilder valBuf = new StringBuilder();
         valBuf.append("'");
         if (DBDatabase.EMPTY_STRING.equals(value)==false)
-            appendTextValue(valBuf, value.toString());
+            appendSQLTextValue(valBuf, value.toString());
         valBuf.append("'");
         return valBuf.toString();
     }
@@ -705,7 +705,7 @@ public abstract class DBDatabaseDriver i
     /** 
      * this helper function doubles up single quotes for SQL 
      */
-    protected void appendTextValue(StringBuilder buf, String value)
+    protected void appendSQLTextValue(StringBuilder buf, String value)
     {
         if (value.indexOf('\'') >= 0)
         { // a routine to double up single quotes for SQL

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java?rev=1201472&r1=1201471&r2=1201472&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
Sun Nov 13 18:45:14 2011
@@ -375,16 +375,16 @@ public class DBDatabaseDriverMSSQL exten
     }
 
     /**
-     * @see DBDatabaseDriver#getTextString(DataType type, Object value)
+     * @see DBDatabaseDriver#getSQLTextString(DataType type, Object value)
      */
     @Override
-    protected String getTextString(DataType type, Object value)
+    protected String getSQLTextString(DataType type, Object value)
     {
         StringBuilder valBuf = new StringBuilder();
         // for SQLSERVER utf8 support, see EMPIREDB-122
         valBuf.append((useUnicodePrefix) ? "N'" : "'");
         if (DBDatabase.EMPTY_STRING.equals(value)==false)
-            appendTextValue(valBuf, value.toString());
+            appendSQLTextValue(valBuf, value.toString());
         valBuf.append("'");
         return valBuf.toString();
     }



Mime
View raw message