empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r691409 - in /incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db: ./ expr/column/ expr/compare/ expr/set/ hsql/ mysql/ oracle/ sqlserver/
Date Tue, 02 Sep 2008 22:27:49 GMT
Author: doebele
Date: Tue Sep  2 15:27:48 2008
New Revision: 691409

URL: http://svn.apache.org/viewvc?rev=691409&view=rev
Log:
EMPIREDB-8

Modified:
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBColumnExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBDatabaseDriver.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRowSet.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBAbstractFuncExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBCalcExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBConcatExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBCountExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBDecodeExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/compare/DBCompareColExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/set/DBSetExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBColumnExpr.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBColumnExpr.java?rev=691409&r1=691408&r2=691409&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBColumnExpr.java (original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBColumnExpr.java Tue
Sep  2 15:27:48 2008
@@ -19,6 +19,7 @@
 package org.apache.empire.db;
 
 // java
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -34,6 +35,7 @@
 import org.apache.empire.db.expr.column.DBCaseExpr;
 import org.apache.empire.db.expr.column.DBConcatExpr;
 import org.apache.empire.db.expr.column.DBConvertExpr;
+import org.apache.empire.db.expr.column.DBCountExpr;
 import org.apache.empire.db.expr.column.DBDecodeExpr;
 import org.apache.empire.db.expr.column.DBFuncExpr;
 import org.apache.empire.db.expr.column.DBValueExpr;
@@ -906,28 +908,80 @@
     }
 
     /**
-     * Creates and returns an aggregation function object
-     * which returns the number of rows in a group of rows.
+     * Creates and returns an expresion for the SQL "count()" function
+     * which returns the number of rows in the result set.
      *
      * @return the new DBFuncExpr object
      */
     public DBColumnExpr count()
     {
-        return getExprFromPhrase(DBDatabaseDriver.SQL_FUNC_COUNT, null, null, true);
+        return new DBCountExpr(this, false);
+    }
+
+    /**
+     * Creates and returns an expresion for the SQL "count()" function
+     * which returns the number of unique values in the result set.
+     *
+     * @return the new DBFuncExpr object
+     */
+    public DBColumnExpr countDistinct()
+    {
+        return new DBCountExpr(this, true);
+    }
+    
+    /**
+     * Detects the DataType of a given value.
+     * @param value the value to detect
+     * @return the DataType enum for the value
+     */
+    protected DataType detectDataType(Object value)
+    {
+        if (value instanceof DBColumnExpr)
+            return ((DBColumnExpr)value).getDataType();
+        if (value instanceof String)
+            return DataType.TEXT;
+        if ((value instanceof Integer) || (value instanceof Long))
+            return DataType.INTEGER;
+        if (value instanceof Number)
+            return DataType.DECIMAL;
+        if (value instanceof Boolean)
+            return DataType.BOOL;
+        if (value instanceof Date)
+            return DataType.DATETIME;
+        if (value instanceof Character)
+            return DataType.CHAR;
+        if (value instanceof byte[])
+            return DataType.BLOB;
+        return DataType.UNKNOWN;
     }
 
     /**
      * Creates and returns a sql-expression that compares the current column expression with

      * a list of values and returns the corresponding alternative value.<BR>
      * 
-     * @param list 
-     * @param otherwise
-     * @return the new DBFuncExpr object
+     * @param valueMap a list of key values pairs used for decoding 
+     * @param otherwise the value to take if no key matches the given expression
+     * @return a DBDecodeExpr object
      */
     @SuppressWarnings("unchecked")
     public DBColumnExpr decode(Map valueMap, Object otherwise)
     {
+        // Detect data type
         DataType dataType = DataType.UNKNOWN;
+        if (otherwise!=null)
+        {
+            dataType = detectDataType(otherwise);
+        }
+        if (dataType==DataType.UNKNOWN)
+        {
+            for (Object v : valueMap.values())
+            {
+                dataType = detectDataType(v);
+                if (dataType!=DataType.UNKNOWN)
+                    break;
+            }
+        }
+        // Create the decode function
         return new DBDecodeExpr(this, valueMap, otherwise, dataType);
     }
 

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBDatabaseDriver.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBDatabaseDriver.java?rev=691409&r1=691408&r2=691409&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBDatabaseDriver.java
(original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBDatabaseDriver.java
Tue Sep  2 15:27:48 2008
@@ -90,7 +90,6 @@
     public static final int SQL_FUNC_YEAR        = 134; // MSSQL: year (?)
     // Aggregation
     public static final int SQL_FUNC_SUM         = 140; // Oracle: sum(?)
-    public static final int SQL_FUNC_COUNT       = 141; // Oracle: count(?)
     public static final int SQL_FUNC_MAX         = 142; // Oracle: max(?)
     public static final int SQL_FUNC_MIN         = 143; // Oracle: min(?)
     public static final int SQL_FUNC_AVG         = 144; // Oracle: avg(?)

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBExpr.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBExpr.java?rev=691409&r1=691408&r2=691409&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBExpr.java (original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBExpr.java Tue Sep
 2 15:27:48 2008
@@ -73,7 +73,7 @@
      * @param arraySep the separator value
      * @return the new SQL-Command
      */
-    protected String getObjectValue(DBColumnExpr col, Object value, long context, String
arraySep)
+    protected String getObjectValue(DataType dataType, Object value, long context, String
arraySep)
     {
         // it's an Object
         if (value instanceof DBExpr)
@@ -97,7 +97,7 @@
                 if (i > 0 && arraySep != null)
                     buf.append(arraySep);
                 // Append Value
-                buf.append(getObjectValue(col, array[i], context, arraySep));
+                buf.append(getObjectValue(dataType, array[i], context, arraySep));
             }
             return buf.toString();
         } 
@@ -110,7 +110,7 @@
                 return String.valueOf(value);
             }
             // Get Value Expression from Driver
-            return driver.getValueString(value, col.getDataType());
+            return driver.getValueString(value, dataType);
         }
     }
     

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRowSet.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRowSet.java?rev=691409&r1=691408&r2=691409&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRowSet.java (original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRowSet.java Tue Sep
 2 15:27:48 2008
@@ -275,7 +275,7 @@
      */
     public DBColumnExpr count()
     {
-        return new DBCountExpr(this, null);
+        return new DBCountExpr(this);
     }
     
     /**

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBAbstractFuncExpr.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBAbstractFuncExpr.java?rev=691409&r1=691408&r2=691409&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBAbstractFuncExpr.java
(original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBAbstractFuncExpr.java
Tue Sep  2 15:27:48 2008
@@ -154,9 +154,10 @@
         // Get Template
         if (params != null)
         {   // Replace Params
+            DataType dataType = expr.getDataType();
             for (int i = 0; i < params.length; i++)
             {   // String test  =(params[i] != null) ? params[i].toString() : "";
-                String value = getObjectValue(expr, params[i], CTX_DEFAULT, ",");
+                String value = getObjectValue(dataType, params[i], CTX_DEFAULT, ",");
                 // template = template.replaceAll("\\{" + String.valueOf(i) + "\\}", value);
                 template = StringUtils.replaceAll(template, "{"+ String.valueOf(i) + "}",
value);
             }

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBCalcExpr.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBCalcExpr.java?rev=691409&r1=691408&r2=691409&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBCalcExpr.java
(original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBCalcExpr.java
Tue Sep  2 15:27:48 2008
@@ -147,7 +147,7 @@
         // Zusammenbauen
         expr.addSQL(buf, context);
         buf.append(op);
-        buf.append(getObjectValue(this, value, context, op));
+        buf.append(getObjectValue(getDataType(), value, context, op));
     }
 
     @Override

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBConcatExpr.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBConcatExpr.java?rev=691409&r1=691408&r2=691409&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBConcatExpr.java
(original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBConcatExpr.java
Tue Sep  2 15:27:48 2008
@@ -161,14 +161,14 @@
         {   // Complex Pattern with placeholder ? for this expression and {0} for the value
             buf.append(template.substring(0, sep));
             left.addSQL(buf, context);
-            String value = getObjectValue(this, right, context, ", ");
+            String value = getObjectValue(getDataType(), right, context, ", ");
             buf.append(MessageFormat.format(template.substring(sep + 1), value));
         } 
         else
         {   // Simple Pattern without placeholders
             left.addSQL(buf, context);
             buf.append(template);
-            buf.append(getObjectValue(this, right, context, template));
+            buf.append(getObjectValue(getDataType(), right, context, template));
         }
         
     }

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBCountExpr.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBCountExpr.java?rev=691409&r1=691408&r2=691409&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBCountExpr.java
(original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBCountExpr.java
Tue Sep  2 15:27:48 2008
@@ -34,22 +34,34 @@
  * This class is used to add the "count" statement to the SQL-Command.
  * <P>
  * There is no need to explicitly create instances of this class.<BR>
- * Instead use {@link DBRowSet#count() }
+ * Instead use {@link DBRowSet#count() or @link DBColumnExpr#count() }
  * <P>
  *
  */
 public class DBCountExpr extends DBColumnExpr
 {
     private final DBRowSet rowset;
-    private final DBColumnExpr expr;
+    private final DBColumnExpr column;
+    private final boolean distinct;
     
     /**
      * Constructs a DBCountExpr.
      */
-    public DBCountExpr(DBRowSet rowset, DBColumnExpr expr)
+    public DBCountExpr(DBRowSet rowset)
     {
         this.rowset = rowset;
-        this.expr = expr;
+        this.column = null;
+        this.distinct = false;
+    }
+    
+    /**
+     * Constructs a DBCountExpr.
+     */
+    public DBCountExpr(DBColumnExpr expr, boolean distinct)
+    {
+        this.rowset = null;
+        this.column = expr;
+        this.distinct = distinct;
     }
 
     /**
@@ -60,6 +72,8 @@
     @Override
     public DBDatabase getDatabase()
     {
+        if (column!=null)
+            column.getDatabase();
         return rowset.getDatabase();
     }
 
@@ -113,8 +127,8 @@
     @Override
     public void addReferencedColumns(Set<DBColumn> list)
     {
-        if (expr!=null)
-            expr.addReferencedColumns(list);
+        if (column!=null)
+            column.addReferencedColumns(list);
         else
             list.add(rowset.getColumn(0)); // select any column
     }
@@ -126,23 +140,31 @@
      * @param context the current SQL-Command context
      */
     @Override
-    public void addSQL(StringBuilder buf, long context)
+    public void addSQL(StringBuilder sql, long context)
     { 
-        buf.append("count(");
-        if (expr!=null)
-            expr.addSQL(buf, context);
+        sql.append("count(");
+        if (column!=null)
+        {   // count(distinct column)
+            if (distinct)
+                sql.append("distinct "); 
+            column.addSQL(sql, context);
+        }
         else
-            buf.append("*");
-        buf.append(")");
+        {   // count(*)
+            sql.append("*");
+        }
+        sql.append(")");
     }
 
-    /** this helper function calls the XMLUtil.addXML(Element, String) method */
+    /** 
+     * this adds the column description to the parent element 
+     */
     @Override
     public Element addXml(Element parent, long flags)
     {   // Add Expression
         Element elem;
-        if (expr!=null)
-        {   elem = expr.addXml(parent, flags);
+        if (column!=null)
+        {   elem = column.addXml(parent, flags);
         }
         else
         {   elem = XMLUtil.addElement(parent, "column");

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBDecodeExpr.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBDecodeExpr.java?rev=691409&r1=691408&r2=691409&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBDecodeExpr.java
(original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBDecodeExpr.java
Tue Sep  2 15:27:48 2008
@@ -90,8 +90,8 @@
             Object val = valueMap.get(key);
 
             String part = driver.getSQLPhrase(DBDatabaseDriver.SQL_FUNC_DECODE_PART);
-            part = StringUtils.replaceAll(part, "{0}", getObjectValue(expr, key, DBExpr.CTX_DEFAULT,
""));
-            part = StringUtils.replaceAll(part, "{1}", getObjectValue(expr, val, DBExpr.CTX_DEFAULT,
""));
+            part = StringUtils.replaceAll(part, "{0}", getObjectValue(expr.getDataType(),
key, DBExpr.CTX_DEFAULT, ""));
+            part = StringUtils.replaceAll(part, "{1}", getObjectValue(this.getDataType(),
val, DBExpr.CTX_DEFAULT, ""));
 
             inner.append(driver.getSQLPhrase(DBDatabaseDriver.SQL_FUNC_DECODE_SEP));
             inner.append(part);
@@ -100,7 +100,7 @@
         if (elseExpr != null)
         { // Else
             String other = driver.getSQLPhrase(DBDatabaseDriver.SQL_FUNC_DECODE_ELSE);
-            other = StringUtils.replaceAll(other, "{0}", getObjectValue(expr, elseExpr, DBExpr.CTX_DEFAULT,
""));
+            other = StringUtils.replaceAll(other, "{0}", getObjectValue(getDataType(), elseExpr,
DBExpr.CTX_DEFAULT, ""));
 
             inner.append(driver.getSQLPhrase(DBDatabaseDriver.SQL_FUNC_DECODE_SEP));
             inner.append(other);

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/compare/DBCompareColExpr.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/compare/DBCompareColExpr.java?rev=691409&r1=691408&r2=691409&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/compare/DBCompareColExpr.java
(original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/compare/DBCompareColExpr.java
Tue Sep  2 15:27:48 2008
@@ -139,7 +139,7 @@
                 break;
         }
         // Value
-        String valsql = getObjectValue(expr, value, context, arraySep);
+        String valsql = getObjectValue(expr.getDataType(), value, context, arraySep);
         if (valsql == null || valsql.equalsIgnoreCase("null"))
         { // Null oder Not Null!
             op = DBCmpType.getNullType(op);
@@ -225,7 +225,7 @@
         // Value Only ?
         if ((context & CTX_NAME) == 0)
         {
-            String valsql = getObjectValue(expr, value, context, "+");
+            String valsql = getObjectValue(expr.getDataType(), value, context, "+");
             buf.append((valsql != null) ? valsql : "null");
             return;
         }

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/set/DBSetExpr.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/set/DBSetExpr.java?rev=691409&r1=691408&r2=691409&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/set/DBSetExpr.java
(original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/set/DBSetExpr.java
Tue Sep  2 15:27:48 2008
@@ -121,6 +121,6 @@
         if ((context & CTX_NAME) != 0 && (context & CTX_VALUE) != 0)
             buf.append("=");
         if ((context & CTX_VALUE) != 0)
-            buf.append(getObjectValue(column, value, CTX_NAME | CTX_VALUE, "+"));
+            buf.append(getObjectValue(column.getDataType(), value, CTX_NAME | CTX_VALUE,
"+"));
     }
 }

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java?rev=691409&r1=691408&r2=691409&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java
(original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java
Tue Sep  2 15:27:48 2008
@@ -157,7 +157,6 @@
             case SQL_FUNC_YEAR:         return "year(?)";
             // Aggregation
             case SQL_FUNC_SUM:          return "sum(?)";
-            case SQL_FUNC_COUNT:        return "count(?)";
             case SQL_FUNC_MAX:          return "max(?)";
             case SQL_FUNC_MIN:          return "min(?)";
             case SQL_FUNC_AVG:          return "avg(?)";

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java?rev=691409&r1=691408&r2=691409&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
(original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
Tue Sep  2 15:27:48 2008
@@ -246,7 +246,6 @@
             case SQL_FUNC_YEAR:               return "year(?)";
             // Aggregation
             case SQL_FUNC_SUM:                return "sum(?)";
-            case SQL_FUNC_COUNT:              return "count(?)";
             case SQL_FUNC_MAX:                return "max(?)";
             case SQL_FUNC_MIN:                return "min(?)";
             case SQL_FUNC_AVG:                return "avg(?)";

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java?rev=691409&r1=691408&r2=691409&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java
(original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java
Tue Sep  2 15:27:48 2008
@@ -168,7 +168,6 @@
             case SQL_FUNC_YEAR:                 return "TO_CHAR(?,'YYYY')";
             // Aggregation
             case SQL_FUNC_SUM:                  return "sum(?)";
-            case SQL_FUNC_COUNT:                return "count(?)";
             case SQL_FUNC_MAX:                  return "max(?)";
             case SQL_FUNC_MIN:                  return "min(?)";
             case SQL_FUNC_AVG:                  return "avg(?)";

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java?rev=691409&r1=691408&r2=691409&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
(original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
Tue Sep  2 15:27:48 2008
@@ -231,7 +231,6 @@
             case SQL_FUNC_YEAR:               return "year(?)";
             // Aggregation
             case SQL_FUNC_SUM:                return "sum(?)";
-            case SQL_FUNC_COUNT:              return "count(?)";
             case SQL_FUNC_MAX:                return "max(?)";
             case SQL_FUNC_MIN:                return "min(?)";
             case SQL_FUNC_AVG:                return "avg(?)";



Mime
View raw message