db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1337020 - /db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/MapHelper.java
Date Fri, 11 May 2012 03:32:16 GMT
Author: tfischer
Date: Fri May 11 03:32:15 2012
New Revision: 1337020

URL: http://svn.apache.org/viewvc?rev=1337020&view=rev
Log:
fix mapHelper in case there is a subselect in the from clause

Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/MapHelper.java

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/MapHelper.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/MapHelper.java?rev=1337020&r1=1337019&r2=1337020&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/MapHelper.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/MapHelper.java
Fri May 11 03:32:15 2012
@@ -87,10 +87,11 @@ public final class MapHelper
                 return result;
             }
             // try aliases
-            Map<String, String> aliases = criteria.getAliases();
-            if (aliases.get(tableName) != null)
+            Map<String, ? extends Object> aliases = criteria.getAliases();
+            Object aliasMappedTo = aliases.get(tableName);
+            if (aliasMappedTo != null && aliasMappedTo instanceof String)
             {
-                tableName = aliases.get(tableName);
+                tableName = (String) aliasMappedTo;
                 result = databaseMap.getTable(tableName);
             }
         }
@@ -141,10 +142,11 @@ public final class MapHelper
         if (tableMap == null)
         {
             // try aliases
-            Map<String, String> aliases = criteria.getAliases();
-            if (aliases.get(tableName) != null)
+            Map<String, ? extends Object> aliases = criteria.getAliases();
+            Object aliasMappedTo = aliases.get(tableName);
+            if (aliasMappedTo != null && aliasMappedTo instanceof String)
             {
-                tableName = aliases.get(tableName);
+                tableName = (String) aliasMappedTo;
                 tableMap = databaseMap.getTable(tableName);
             }
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message