Do you have namespaces enabled in sqlmapconfig?

I bet lunch that you do. :-)

Larry


On 7/7/06, Merritt, Norris <[EMAIL PROTECTED]> wrote:




Obviously there is something wrong with the trivially simple sqlMap file
shown below, but being so new to iBatis I can't figure out what it is.

If someone would kindly point it out I would appreciate it. Other folks
having this symptom were doing things with Abator and namespaces, which I am
not.



The error occurs when I execute the line of code



     sqlMap.queryForObject("getFoo", paramMap, resultMap );



I expected to get a hashmap in resultMap consisting of name/value pairs for
all columns of the single row of footable that would be returned by my
select statement if it were executed, but instead I get:



com.ibatis.sqlmap.client.SqlMapException: There is no
statement named getFoo in this SqlMap.

      at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getMappedStatement(SqlMapExecutorDelegate.java:288)

      at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:552)

      at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:97)

      at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:74)

      at FooTest.main(FooTest.java:26)





I know that my sqlMap xml file is being loaded and parsed because if I
introduce errors into it, the parser throws appropriate exceptions.

As given below, the parser accepts the sqlMap file but I get the above
exception trying to do the query shown above.



<sqlMap>



  <statement id="getFoo" parameterMap="getFooMap"
parameterClass="java.util.Map" resultClass="java.util.HashMap">



      select * from dbo.footable as foo where foo.id = '#id#'



  </statement>



  <parameterMap id="getFooMap" class="java.util.HashMap">

    <parameter property ="id" jdbcType="VARCHAR" javaType="string" />

  </parameterMap>



</sqlMap>

Reply via email to