Search code examples
javasetiterationibatis

Java : Iterating a Set in ibatis


I have a Set attribute in the model object.

    class AA{

        Set x;
    }

But when I try to iterate the Set in the ibatis xml file , I get the following exception.

   The 'x' property of the AA class is not a List or Array.

This is the stuff that is present in the ibatis xml file.

    <iterate property="x" open="(" close=")" conjunction=","> 

            #x[]#

      </iterate>

What am I missing ?


Solution

  • You might want to take a look at this question: Iterate list of Objects in Ibatis

    They're talking about a List rather than a Set, but it appears that ibatis only supports iteration over Lists and Arrays.