]> source.dussan.org Git - iciql.git/commitdiff
Fix wildcard SELECT column mapping on JOIN statements
authorJames Moger <james.moger@gitblit.com>
Mon, 29 Jun 2015 19:39:36 +0000 (15:39 -0400)
committerJames Moger <james.moger@gitblit.com>
Mon, 29 Jun 2015 19:39:36 +0000 (15:39 -0400)
releases.moxie
src/main/java/com/iciql/Db.java

index 156c86dfdace2a7db296bbeacd6d7e05d73eafd9..71f5402d3f514e9241c71bd9b71408e754073aa2 100644 (file)
@@ -9,7 +9,8 @@ r27: {
     html: ~
     text: ~
     security: ~
-    fixes: ~
+    fixes:
+    - Fix column mapping on wildcard select JOIN statements
     changes:
     - Add support for PostgreSQL 9.5 UPSERT syntax
     additions: ~
index 4b55150c7601e715ac51e5e7608e549dbb428c26..ef079632200b203a8aae2484d562ecec1d7db5c0 100644 (file)
@@ -799,8 +799,7 @@ public class Db implements AutoCloseable {
                                }
                                rs = stat.executeQuery();
                        }
-                       boolean wildcardSelect = sql.toLowerCase().startsWith("select *")
-                                       || sql.toLowerCase().startsWith("select distinct *");
+                       boolean wildcardSelect = sql.toLowerCase().matches("select .*\\*.+");
                        return buildObjects(modelClass, wildcardSelect, rs);
                } catch (SQLException e) {
                        throw new IciqlException(e);