ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karen Koch <kmk...@sbcglobal.net>
Subject Recommended practice / nested ResultMaps
Date Mon, 23 May 2005 17:12:37 GMT
Given the following nested resultMap configuration with the child resultMap including a complex
property that is part of the groupBy, how should the groupBy on that property be specified?
 I tried using the complex property name, and I tried qualifying the complex property name
with the simple key-value sub-property -- neither worked properly.
<resultMap id="distUsagesResult" class="distUsages" groupBy="distKey, entryDate">
    <result property="distKey" column="DistKey"/>
    <result property="entryDate" column="Date"/>
    <result property="org" column="Org"/>
    <result property="costCtr" column="CostCtr"/>
    <result property="task" column="Task"/>
    <result property="option" column="Option"/>
    <result property="statisticList" resultMap="StatType.statisticResult"/>    
<resultMap id="statisticResult" class="statistic" groupBy="distKey, entryDate, statType">

<!-- also tried <resultMap id="statisticResult" class="statistic" groupBy="distKey,
entryDate, statType.statTypeKey"> -->
    <result property="distKey" column="StatDistKey"/>
    <result property="entryDate" column="StatEntryDate"/>
    <result property="statType" column="StatTypeKey" select="getStatType"/>
    <result property="numUnits" column="StatNumUnits"/>
<resultMap id="statTypeResult" class="statType">
    <result property="statTypeKey" column="StatTypeKey"/>
    <result property="statTypeID" column="StatTypeID"/>
    <result property="statTypeDesc" column="StatTypeDesc"/>
    <result property="measUnits" column="MeasUnits"/>
    <result property="numDecPlaces" column="NumDecPlaces"/>
    <result property="org" column="Org"/>
    <result property="account" column="Account"/>
    <result property="costCtr" column="CostCtr"/>
    <result property="task" column="Task"/>
    <result property="option" column="Option"/>
Thanks thanks thanks!

View raw message