You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by BruceKKK <si...@gmail.com> on 2009/06/19 05:34:25 UTC

issue of ibatis sqlmap list of list

i met ora-01795 error, so i need separate list to several size limited lists,
I am trying use nested iterators to iterate over a List of List  using
following code:

<select id="getList" parameterClass="map" resultClass="com.ResultObject">	 
 select *****	from ****** where 
  <isNotEmpty property="outLists" >
   <iterate property="outLists" open="(" close=")" conjunction="OR">
    data in
     <iterate property="outLists[]" open="(" close=")" conjunction=",">
      #outLists[].[]#
     </iterate>
    </iterate>
   </isNotEmpty>
</select>

but i got exception:
com.ibatis.common.beans.ProbeException: Error getting ordinal list from
JavaBean. Cause java.lang.NumberFormatException: For input string: "" 

how to make it run?

by the way: the version of ibatis i used is 2.1.7
-- 
View this message in context: http://www.nabble.com/issue-of-ibatis-sqlmap-list-of-list-tp24105006p24105006.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: issue of ibatis sqlmap list of list

Posted by Nicholoz Koka Kiknadze <ki...@gmail.com>.
Turn on logging (see iBatis docs) to see what does the generated SQL
statement look like.

On Fri, Jun 19, 2009 at 7:34 AM, BruceKKK <si...@gmail.com> wrote:

>
> i met ora-01795 error, so i need separate list to several size limited
> lists,
> I am trying use nested iterators to iterate over a List of List  using
> following code:
>
> <select id="getList" parameterClass="map" resultClass="com.ResultObject">
>  select *****   from ****** where
>  <isNotEmpty property="outLists" >
>   <iterate property="outLists" open="(" close=")" conjunction="OR">
>    data in
>     <iterate property="outLists[]" open="(" close=")" conjunction=",">
>      #outLists[].[]#
>     </iterate>
>    </iterate>
>   </isNotEmpty>
> </select>
>
> but i got exception:
> com.ibatis.common.beans.ProbeException: Error getting ordinal list from
> JavaBean. Cause java.lang.NumberFormatException: For input string: ""
>
> how to make it run?
>
> by the way: the version of ibatis i used is 2.1.7
> --
> View this message in context:
> http://www.nabble.com/issue-of-ibatis-sqlmap-list-of-list-tp24105006p24105006.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Re: issue of ibatis sqlmap list of list

Posted by BruceKKK <si...@gmail.com>.
hi kai,

i have read the src of ibatis, it did not support multi loop. so i consider
use temp table.

thx

Bruce

---------------------------------------------------------------------------------- 

Kai Grabfelder-3 wrote:
> 
> consider using a tmp table if you encounter this error (a) insert into tmp
> table, b) join your select with the
> tmp table). Most of the time ist should be faster than doing than
> combining OR and IN statements.
> 
> cheers
> 
> Kai
> 
> --- Original Nachricht ---
> Absender: BruceKKK
> Datum: 19.06.2009 05:34
>> i met ora-01795 error, so i need separate list to several size limited
>> lists,
>> I am trying use nested iterators to iterate over a List of List  using
>> following code:
>> 
>> <select id="getList" parameterClass="map" resultClass="com.ResultObject">	 
>>  select *****	from ****** where 
>>   <isNotEmpty property="outLists" >
>>    <iterate property="outLists" open="(" close=")" conjunction="OR">
>>     data in
>>      <iterate property="outLists[]" open="(" close=")" conjunction=",">
>>       #outLists[].[]#
>>      </iterate>
>>     </iterate>
>>    </isNotEmpty>
>> </select>
>> 
>> but i got exception:
>> com.ibatis.common.beans.ProbeException: Error getting ordinal list from
>> JavaBean. Cause java.lang.NumberFormatException: For input string: "" 
>> 
>> how to make it run?
>> 
>> by the way: the version of ibatis i used is 2.1.7
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/issue-of-ibatis-sqlmap-list-of-list-tp24105006p24114956.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: issue of ibatis sqlmap list of list

Posted by Kai Grabfelder <no...@kaigrabfelder.de>.
consider using a tmp table if you encounter this error (a) insert into tmp table, b) join your select with the
tmp table). Most of the time ist should be faster than doing than combining OR and IN statements.

cheers

Kai

--- Original Nachricht ---
Absender: BruceKKK
Datum: 19.06.2009 05:34
> i met ora-01795 error, so i need separate list to several size limited lists,
> I am trying use nested iterators to iterate over a List of List  using
> following code:
> 
> <select id="getList" parameterClass="map" resultClass="com.ResultObject">	 
>  select *****	from ****** where 
>   <isNotEmpty property="outLists" >
>    <iterate property="outLists" open="(" close=")" conjunction="OR">
>     data in
>      <iterate property="outLists[]" open="(" close=")" conjunction=",">
>       #outLists[].[]#
>      </iterate>
>     </iterate>
>    </isNotEmpty>
> </select>
> 
> but i got exception:
> com.ibatis.common.beans.ProbeException: Error getting ordinal list from
> JavaBean. Cause java.lang.NumberFormatException: For input string: "" 
> 
> how to make it run?
> 
> by the way: the version of ibatis i used is 2.1.7