java - MyBatis doesn't return all rows in <collection>, when select query is executed to bring all corresponding rows -
<collection property="mole" select="selectallmolebyuserid" column="id"></collection>
should bring 90 rows brings 10 rows. have checked query on database works fine. using mybatis-spring version 1.1.0.
<resultmap id="base_map" type="com.application.user"> <id column="id" property="id" jdbctype="integer" /> <result column="mint_id" property="mintid" jdbctype="integer" /> <result column="first_name" property="firstname" jdbctype="varchar" /> <result column="last_name" property="lastname" jdbctype="varchar" /> </resultmap> <resultmap id="user_map" type="com.application.user" extends="base_map"> <result column="first_login" property="firstlogin" jdbctype="bit" /> <result column="failed_login_count" property="failedlogincount" jdbctype="integer" /> <result column="clear_id" property="clearid" jdbctype="integer" /> <collection property="mole" select="selectallmolebyuserid" column="id"></collection> </resultmap> <resultmap id="mole_result_map" type="com.application.mole"> <id column="id" property="id" jdbctype="integer" /> <result column="description" property="description" jdbctype="varchar" /> <result column="firstname" property="firstname" jdbctype="varchar" /> <result column="lastname" property="lastname" jdbctype="varchar" /> </resultmap> <select id="selectallmolebyuserid" parametertype="java.lang.integer" resultmap="mole.mole_result_map"> select m.id, m.firstname, m.lastname, m.description mole m m.user_id=#{userid} , m.access_granted = true , m.entity_deleted = false </select>
Comments
Post a Comment