This is an automated email from the ASF dual-hosted git repository.

doebele pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/empire-db.git


The following commit(s) were added to refs/heads/master by this push:
     new 5d08f8b  EMPIREDB-304 small improvement to recent code addition
5d08f8b is described below

commit 5d08f8b4f6d0a96a041b6e2ed1c0ee8f06dd2633
Author: Rainer Döbele <[email protected]>
AuthorDate: Tue Jan 28 09:34:25 2020 +0100

    EMPIREDB-304
    small improvement to recent code addition
---
 empire-db/src/main/java/org/apache/empire/db/DBColumn.java     | 2 +-
 empire-db/src/main/java/org/apache/empire/db/DBColumnExpr.java | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

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 fe6ca70..b84ed1f 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
@@ -413,7 +413,7 @@ public abstract class DBColumn extends DBColumnExpr
      */
     public DBColumnExpr decodeEnum()
     {
-        return super.decodeEnum(getEnumType(), null, 
getDataType().isNumeric());
+        return super.decodeEnum(getEnumType(), null);
     }
 
     /**
diff --git a/empire-db/src/main/java/org/apache/empire/db/DBColumnExpr.java 
b/empire-db/src/main/java/org/apache/empire/db/DBColumnExpr.java
index d8b850d..d02ffe1 100644
--- a/empire-db/src/main/java/org/apache/empire/db/DBColumnExpr.java
+++ b/empire-db/src/main/java/org/apache/empire/db/DBColumnExpr.java
@@ -1082,15 +1082,15 @@ public abstract class DBColumnExpr extends DBExpr
      * Creates and returns a sql-expression that maps enum values by name or 
ordinal to their string representation 
      * 
      * @param enumType an enumType to decode 
-     * @param otherwise the value to take if no key matches the given 
expression
-     * @param byOrdinal if true then the ordinal of the enum will be decoded 
otherwise the name
+     * @param otherwise the varchar value to take if no key matches the given 
expression
      * @return a DBDecodeExpr object
      */
-    public DBColumnExpr decodeEnum(Class<Enum<?>> enumType, Object otherwise, 
boolean byOrdinal)
+    public DBColumnExpr decodeEnum(Class<Enum<?>> enumType, String otherwise)
     {
         if (enumType==null || !enumType.isEnum())
             throw new InvalidArgumentException("enumType", enumType);
         // create map
+        boolean byOrdinal = getDataType().isNumeric();
         Enum<?>[] items = enumType.getEnumConstants();
         Map<Object, String> enumMap = new LinkedHashMap<Object, 
String>(items.length);
         for (int i=0; i<items.length; i++)

Reply via email to