ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Chien <john.ch...@ncmail.net>
Subject N+ 1 selects
Date Wed, 28 Sep 2005 20:27:14 GMT
Dear Sir:

I follow the FAQ to fix the N+1 selects, However, I continue get the 
compilation error.
My xml looks like:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<!DOCTYPE sqlMap
    PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
    "http://www.ibatis.com/dtd/sql-map-2.dtd">

<sqlMap namespace="EhsInspector">

  <typeAlias alias="ehsInspectors" 
type="us.nc.state.enr.bets.util.EhsInspectorBean"/>
  <typeAlias alias="commonFinder"  
type="us.nc.state.enr.bets.finder.CommonFinder" />

  <resultMap id="getEhsInspectorsANDMap" class="java.util.HashMap" 
groupBy="key">
      <result property="key"   column="key" />
      <result property="value" resultMap="EhsInspector.ehsInspectorsMap"/>
  </resultMap>
 
  <resultMap id="ehsInspectorsMap" class="ehsInspectors">
    <result property="id"                column="id"               
jdbcType="NUMBER"  javaType="java.lang.String" />
    <result property="last_name"         column="last_name"        
jdbcType="VARCHAR" javaType="java.lang.String" />
    <result property="first_name"        column="first_name"       
jdbcType="VARCHAR" javaType="java.lang.String" />
    <result property="middle_initial"    column="middle_initial"   
jdbcType="VARCHAR" javaType="java.lang.String" />
    <result property="added_date"        column="added_date"       
jdbcType="VARCHAR" javaType="java.lang.String" />
    <result property="last_update_date"  column="last_update_date" 
jdbcType="VARCHAR" javaType="java.lang.String" />
    <result property="last_update_user"  column="last_update_user" 
jdbcType="VARCHAR" javaType="java.lang.String" />
  </resultMap>
 
  <select id="getEhsInspectorsAND" parameterClass="commonFinder" 
resultMap="getEhsInspectorsANDMap">
 
      SELECT DISTINCT
            EHS_ID               as key,
            EHS_ID               as id,
            EHS_NAME_LAST        as last_name,
            EHS_NAME_FIRST       as first_name,
            EHS_NAME_MI          as middle_initial,
            EHS_ADDED_DT         as added_date,
            EHS_LAST_UPDATE_DT   as last_update_date,
            EHS_LAST_UPDATE_USER as last_update_user
      FROM  EH.BETS_EHS_INSPECTOR
      GROUP BY EHS_ID
  </select>   
    
</sqlMap>

If you can help me, I will be appreciated.

Thanks,

John Chien

Mime
View raw message