[ http://issues.apache.org/jira/browse/IBATIS-214?page=comments#action_12416428 ]
Jeff Butler commented on IBATIS-214: ------------------------------------ This seems unnecessary to me. There's a simple workaround - use inline parameters. They give you exactly what you need. The only way we could do this without breaking existing function is to do what you've suggested with the inline attribute, but again why not just use an inline parameter in the first place? I'll change the priority to minor pending any other comments. > Make parameter maps work like inline parameters, no matter count and/or order > ----------------------------------------------------------------------------- > > Key: IBATIS-214 > URL: http://issues.apache.org/jira/browse/IBATIS-214 > Project: iBatis for Java > Type: New Feature > Components: SQL Maps > Versions: 2.1.5 > Environment: iBATIS SQL Maps 2.1.5.582 > Reporter: Daniel Silva > > When using parameter maps and in your statement you use same parameter more > than once, you need to redeclare this parameter at your parameter map tied to > order and count of those parameters in your mapped statement. > So, in situations like this: > <select id="foo" parameterMap="fooMap"> > select * > from foo a, bar b > where b.fooId = a.id > and a.myfield = ? > and b.anotherfield = ? > </select> > My fooMap parameter map must look like this: > <parameterMap id="fooMap" class="com.foo.Blah"> > <parameter property="param"/> > <parameter property="param"/> > </parameterMap> > Proposal is to change the way parameter maps work currently to something like > inline parameters: > <parameterMap id="fooMap" class="com.foo.Blah"> > <parameter property="param"/> > </parameterMap> > <select id="foo" parameterMap="fooMap"> > select * > from foo a, bar b > where b.fooId = a.id > and a.myfield = #param# > and b.anotherfield = #param# > </select> > Maybe it could be useful to add an attribute to the <parameter/> element to > mimic the way result maps work. So we'd have something like: > <parameter property="param" inline="blah"/> > and then: > <select id="foo" parameterMap="myMap"> > select * > from foo a, bar b > where b.fooId = a.id > and a.myfield = #blah# > and b.anotherfield = #blah# > </select> > Not sure 'inline' would be such a good name for this attribute so do what you > think is the best. > Any comments appreciated. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira