Iterate list of Objects in Ibatis

后端 未结 3 1652
难免孤独
难免孤独 2020-12-30 12:46

I have a list of object where I want to iterate and access a particular field in ibatis sql.

Ex.

public Class Student
{
String id;
String name;
}
<         


        
3条回答
  •  庸人自扰
    2020-12-30 13:32

    Try something like:

    
    

    where id and name are fields of Student class and my parameterClass is List.

    Worked for me.

    The sql formed dynamically will look like:

    select * from STUDENTS where ( id, name ) in ( (1,'a'), (2,'b') )
    

提交回复
热议问题