ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leucht, Axel" <Axel.Leu...@prodv.de>
Subject Select with dynamic where
Date Wed, 19 May 2010 07:49:30 GMT
I'm currently having one problem with iBATIS-3.

My test bed runs fine with iBATIS-2 and I have a problem with one select
statement which inserts a dynamic where clause.
The parameters, which are plain strings, are not inserted into the sql

	<select id="getSomeStudents" resultType="entities.Student"
		select name,descr as description from student where name
		<foreach item="item" index="index" collection="list"
			open="(" separator="," close=")">

In Java-Code
	    List<String> props = new ArrayList<String>();
	    List<Student> listStudenten =
sqlSession.selectList("Student.getEinigeStudenten", props);

The log shows that the sql don't contain the parameters given.

DEBUG [main] - ==>  Executing: select name,descr as description from
student where name in ( ? , ? , ? ) 
DEBUG [main] - ==> Parameters: null, null, null

What is wrong with my approach?


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

View raw message