ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Sherwin <alex.sher...@acadiasoft.com>
Subject Problem with Map -> Object -> List object inspection in SqlMaps
Date Tue, 10 Feb 2009 17:30:05 GMT
When I pass a Map Object as a parameter to a query, I have a custom 
Object that contains lists on it.  My Object is keyed as "param" in the 
map, and the lists are "whereList", "orderByList" etc.

The syntax should look like this:

$param.whereList[].conjunction$ etc, however this does not work.  I get 
a ProbeException that "param.whereList" is not a valid List or Array, so 
I overrode some of the iBATIS classes to debug what was going on and 
found that eventually found:

BaseProbe.getIndexedType is getting "param.whereList" as the indexedName 
argument, where the Object passed in is my map which has the correct 
keys (including key "param" which contains my custom object with the 
"whereList" on it).

However, at this point the indexedName "param.whereList" is not broken 
down any farther since indexOf('[') is -1 (not found), so it attempts to 
pull the list out of my map with the key "param.whereList", which is 
incorrect, and returning null, which it is doing instanceof on and of 
course not an instance of List or any Array implementations, and 
throwing the ProbeException that I am seeing.

For now I can work around this by putting my lists into the root of the 
map as "whereList" etc, however I can't help but think I'm either 
missing some key syntactical thing, or that maybe the way it is breaking 
down the objects is incorrect in the hierarchy I'm trying to use.

View raw message