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 6971f2c8 EMPIREDB-431 DBQuery: getQueryColumn by index
6971f2c8 is described below

commit 6971f2c8955172e98fe05b401aee4e6a36bbbcb2
Author: Rainer Döbele <[email protected]>
AuthorDate: Tue Dec 10 13:07:01 2024 +0100

    EMPIREDB-431
    DBQuery: getQueryColumn by index
---
 .../main/java/org/apache/empire/db/DBQuery.java    | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/empire-db/src/main/java/org/apache/empire/db/DBQuery.java 
b/empire-db/src/main/java/org/apache/empire/db/DBQuery.java
index 0c5b065b..00c82693 100644
--- a/empire-db/src/main/java/org/apache/empire/db/DBQuery.java
+++ b/empire-db/src/main/java/org/apache/empire/db/DBQuery.java
@@ -262,6 +262,17 @@ public class DBQuery extends DBRowSet
         this.updateable = updateable;
     }
 
+    /**
+     * Gets the query column by Index
+     * @return the query column of that index
+     */
+    public DBQueryColumn getQueryColumn(int iColumn)
+    {
+        if (iColumn < 0 || iColumn >= columns.size())
+            return null;
+        return queryColumns[iColumn];
+    }
+
     /**
      * Gets all columns of this rowset (e.g. for cmd.select()).
      * 
@@ -333,6 +344,17 @@ public class DBQuery extends DBRowSet
             throw new ItemNotFoundException(name);
         return col;
     }
+
+    /**
+     * This is a convenience shortcut for getQueryColumn
+     * 
+     * @param name the column name
+     * @return the located column
+     */
+    public DBQueryColumn column(int iColumn)
+    {
+        return getQueryColumn(iColumn);
+    }
     
     /**
      * return query key columns

Reply via email to