EMPIREDB-304
added enum detection for query columns
diff --git a/empire-db/src/main/java/org/apache/empire/db/DBColumn.java b/empire-db/src/main/java/org/apache/empire/db/DBColumn.java
index b84ed1f..2b4ca20 100644
--- a/empire-db/src/main/java/org/apache/empire/db/DBColumn.java
+++ b/empire-db/src/main/java/org/apache/empire/db/DBColumn.java
@@ -387,7 +387,7 @@
     /**
      * Returns true if an enum type has been set for this column
      * <P>
-     * @return eturns true if an enum type has been set for this column
+     * @return true if an enum type has been set for this column or false otherwise
      */
     public final boolean isEnum()
     {
diff --git a/empire-db/src/main/java/org/apache/empire/db/DBQueryColumn.java b/empire-db/src/main/java/org/apache/empire/db/DBQueryColumn.java
index 2bee498..c088512 100644
--- a/empire-db/src/main/java/org/apache/empire/db/DBQueryColumn.java
+++ b/empire-db/src/main/java/org/apache/empire/db/DBQueryColumn.java
@@ -19,6 +19,7 @@
 package org.apache.empire.db;

 

 import org.apache.empire.commons.Options;

+import org.apache.empire.data.Column;

 import org.apache.empire.data.DataType;

 import org.w3c.dom.Element;

 

@@ -89,6 +90,22 @@
     }

 

     @Override

+    @SuppressWarnings("unchecked")

+    public Class<Enum<?>> getEnumType()

+    {

+        // check expression attribute

+        Object enumType = expr.getAttribute(Column.COLATTR_ENUMTYPE);

+        if (enumType!=null)

+            return ((Class<Enum<?>>)enumType);        

+        // otherwise check update column

+        DBColumn col = expr.getUpdateColumn();

+        if (col!=null)

+            return col.getEnumType();

+        // otherwise 

+        return super.getEnumType();

+    }

+

+    @Override

     public Object validate(Object value)

     {

         DBColumn column = expr.getUpdateColumn();