ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From devver <kmg...@googlemail.com>
Subject Re: Problem accessing List instance property via <isnull>
Date Wed, 28 Apr 2010 21:08:21 GMT

Thanks for the reply (sorry: managed to reply twice). It's IB v2. 
An older version of IB sounds feasibly yet we have sql maps that use similar
constructs, i.e <isnull> nested within <iterate> elements and accessing
properties on instances stored in maps. Most perculiar. I  cant get it to
work and will probably have to resort to tortuous SQL to get the results I
need



nmaves wrote:
> 
> Which version are you using?  It looks to be IB2 and if that is true I
> would suggest to moving up to 3.x.
> 
> On Mon, Apr 26, 2010 at 1:02 PM, devver <kmg203@googlemail.com> wrote:
>>
>> Hi
>>
>> I'm new to iBatis and I'm struggling to access a property of instances
>> stor4ed in a list which, in turn are passed to ibatis in a HashMap
>> parameter. The <iterate> clauses are building a WHERE clause, the
>> contents
>> of which will alter depending on whether this proeprty is null or not.
>>
>> I am iterating over my List as follows:
>>
>> <iterate prepend="AND" property="MyMap.myList" conjunction="AND" open="("
>> close=")">
>>    ...
>> </iterate>
>>
>> Within this I check the value of a property, 'myProperty' and complete
>> the
>> WHER clause accordingly. The iterate clause now looks like this:
>>
>> <iterate prepend="AND" property="MyMap.myList" conjunction="AND" open="("
>> close=")">
>>    <isNull property="MyMap.myList[].myProperty">
>>         <!-- code when property is NULL -->
>>    </isNull>
>>    <isNotNull property="MyMap.myList[].myProperty">
>>         <!-- code when property is _not_  NULL -->
>>    </isNotNull>
>>
>> </iterate>
>>
>> When I run this, the error message seems to indicate that my syntax i
>> nrelation to the List is incorrect:-
>>
>> --- Cause: com.ibatis.common.beans.ProbeException: Error getting ordinal
>> list from JavaBean. Cause java.lang.NumberFormatException: For input
>> string:
>> ""
>> Caused by: java.lang.NumberFormatException: For input string: ""; nested
>> exception is com.ibatis.common.jdbc.exception.NestedSQLException:
>>
>> If anyone can shed any light as to what I've missed, here, I'd be
>> grateful.
>>
>> Thanks
>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Problem-accessing-List-instance-property-via-%3Cisnull%3E-tp28368852p28368852.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>> For additional commands, e-mail: user-java-help@ibatis.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Problem-accessing-List-instance-property-via-%3Cisnull%3E-tp28368852p28394013.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message