You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by 郑王力 <zw...@gmail.com> on 2005/02/01 07:32:31 UTC
question: complex query
hi:
I am developing projects using spring 1.1.3 + iBATIS 2.0.9. All is ok, but complex query. code just like:
<resultMap id="roleMap" class="roleVO">
<result property="id" column="ROLEID" />
<result property="roleName" column="ROLENAME" />
<result property="menus" column="ROLEID" select="queryMenuByRoleId"/>
</resultMap>
error:
java.lang.NullPointerException
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction(SqlMapExecutorDelegate.java:776)
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(SqlMapSessionImpl.java:141)
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(SqlMapClientImpl.java:114)
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.autoEndTransaction(SqlMapExecutorDelegate.java:860)
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:617)
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
I think that it is because I don't set transactionManager in sqlmap-config.xml, because I control transcation in spring framework.
I try to add <transactionManager type="EXTERNAL" /> in sqlmap-config.xml, but the transactionManager element must have the datasource element.
Why should I do?