emacarron / mybatis

Automatically exported from code.google.com/p/mybatis
0 stars 0 forks source link

Properties named "value" do not work if there is also a dynamic statement #165

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the MyBatis are you using?
3.0.3

Please describe the problem.  Unit tests are best!
my select clause is defined 
<select id="count" resultType="int" parameterType="map">
select count(*) from ${table} where ${column}=#{value}
</select>

and parameterType is

Map map = new HashMap();
map.put("table",myTable};
map.put("column",myColumn);
map.put("value",myValue);

if i execute "session.selectOne("count",map)"
error was occurred as fellow
### Cause: java.lang.NullPointerException
    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:77)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:69)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:40)

and  I modifyed the  source 
'org.apache.ibatis.builder.xml.dynamic.DynamicSqlSource.java' from downloaded 
source 
as adding 'if(!entry.getKey().equals("value")) at line 28
then this work fine.

What's problem?

What is the expected output? What do you see instead?

Please provide any additional information below.

Original issue reported on code.google.com by hjoy...@mobis.co.kr on 5 Nov 2010 at 3:16

GoogleCodeExporter commented 9 years ago

Original comment by nathan.m...@gmail.com on 12 Sep 2011 at 6:47

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Issue 134 has been merged into this issue.

Original comment by eduardo.macarron on 29 Jan 2012 at 1:04

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
fixed in r4700. Thanks for the detailed report!

Original comment by eduardo.macarron on 12 Feb 2012 at 12:49

GoogleCodeExporter commented 9 years ago
Sorry it is r4699.

Original comment by eduardo.macarron on 12 Feb 2012 at 1:04