empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1236369 - in /incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db: DBDDLGenerator.java DBExpressionIndex.java DBIndex.java
Date Thu, 26 Jan 2012 19:57:30 GMT
Author: doebele
Date: Thu Jan 26 19:57:29 2012
New Revision: 1236369

URL: http://svn.apache.org/viewvc?rev=1236369&view=rev
Log:
EMPIREDB-129
allow even more general expressions

Modified:
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDDLGenerator.java
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBExpressionIndex.java
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBIndex.java

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDDLGenerator.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDDLGenerator.java?rev=1236369&r1=1236368&r2=1236369&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDDLGenerator.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDDLGenerator.java
Thu Jan 26 19:57:29 2012
@@ -405,7 +405,7 @@ public abstract class DBDDLGenerator<T e
 
             // columns
             boolean addSeparator = false;
-            DBColumnExpr[] idxColumns = idx.getColumnExpressions();
+            DBExpr[] idxColumns = idx.getExpressions();
             for (int i = 0; i < idxColumns.length; i++)
             {
                 sql.append((addSeparator) ? ", " : "");

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBExpressionIndex.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBExpressionIndex.java?rev=1236369&r1=1236368&r2=1236369&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBExpressionIndex.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBExpressionIndex.java
Thu Jan 26 19:57:29 2012
@@ -31,7 +31,7 @@ public class DBExpressionIndex extends D
 {
     private final static long serialVersionUID = 1L;
     
-    private DBColumnExpr[] columnExpressions;
+    private DBExpr[] columnExpressions;
 
     /**
      * Constructs a DBExpresionIndex
@@ -40,7 +40,7 @@ public class DBExpressionIndex extends D
      * @param unique true if the index has only unique values or false otherwise
      * @param columnExpressions an array of one or more column expressions of the index
      */
-    public DBExpressionIndex(String name, boolean unique, DBColumnExpr[] columnExpressions)
+    public DBExpressionIndex(String name, boolean unique, DBExpr[] columnExpressions)
     {
         super(name, (unique ? UNIQUE : STANDARD), null);
         // columnExpressions
@@ -74,7 +74,7 @@ public class DBExpressionIndex extends D
      * @return the columnExpressions belonging to this index
      */
     @Override
-    public DBColumnExpr[] getColumnExpressions()
+    public DBExpr[] getExpressions()
     {
         return columnExpressions;
     }
@@ -90,8 +90,12 @@ public class DBExpressionIndex extends D
     public boolean contains(DBColumn col)
     {
         for (int i = 0; i < columnExpressions.length; i++)
-            if (col.equals(columnExpressions[i].getUpdateColumn()))
+        {
+            if (!(columnExpressions[i] instanceof DBColumnExpr))
+                continue;
+            if (col.equals(((DBColumnExpr)columnExpressions[i]).getUpdateColumn()))
                 return true;
+        }    
         return false;
     }
 

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBIndex.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBIndex.java?rev=1236369&r1=1236368&r2=1236369&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBIndex.java (original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBIndex.java Thu
Jan 26 19:57:29 2012
@@ -95,7 +95,7 @@ public class DBIndex extends DBObject
      * 
      * @return the columnExpressions belonging to this index
      */
-    public DBColumnExpr[] getColumnExpressions()
+    public DBExpr[] getExpressions()
     {
         return columns;
     }



Mime
View raw message