emacarron / mybatis

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

Exception: Result Maps collection does not contain value for test.User-result #192

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi everyone 

i m facing this exception:

org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'sqlSessionFactory' defined in class path resource 
[assuredlabor/services/services-config.xml]: Invocation of init method failed; 
nested exception is org.apache.ibatis.builder.BuilderException: Error parsing 
SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing 
Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection 
does not contain value for test.User-result

i'm facing this issue whenever i add the extends keyword in my resultMap tag, 
without extends keyword everything is working fine.

i've a "Worker" class which's inherited with "User".

<resultMap id="worker-object" extends="User-result" type="Worker">                              
        <id property="workerId" column="worker_id"/>
        <result property="photoFile" column="WORKER.photo_file"/>
        <result property="genderStr" column="WORKER.sex"/>
        <result property="dob" column="WORKER.dob"/>
        <result property="nationality" column="WORKER.nationality"/>
        <collection property="education" ofType="Education" resultMap="Education-result" javaType="ArrayList" column="worker_id"/>
        </resultMap>

   <resultMap id="User-result" type="User">
      <result property="userId" column="user_id"/>
      <result property="username" column="USER.username"/>
      <result property="password" column="USER.password"/>
      <result property="userTypeStr" column="USER.user_type"/>
   </resultMap>

Settings are define below.
   <settings>
        <setting name="cacheEnabled" value="false" />
        <setting name="useGeneratedKeys" value="true" />
        <setting name="defaultExecutorType" value="REUSE" />              
    </settings>

Any suggestion, is there any way through which i can solve this exception.

i'm using MyBatis 3.0.4 in my project.

Kind Regards

Original issue reported on code.google.com by afzal.mo...@gmail.com on 1 Dec 2010 at 1:35

GoogleCodeExporter commented 9 years ago
Could you please post some code so we can try to reproduce it? 

Original comment by eduardo.macarron on 16 Dec 2010 at 6:42

GoogleCodeExporter commented 9 years ago

Original comment by eduardo.macarron on 15 Feb 2011 at 9:48