ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Douglas Hansknecht <DougFromO...@us.ibm.com>
Subject Child object created when no child records exist in table
Date Tue, 15 Jul 2008 19:31:37 GMT
It appears that ABATIS-213 has surfaced again. 

        Two tables (Household, Person) are tied (Person has HouseholdID) 

The result maps: 
 <resultMap id="HouseholdResult" class="Household" groupBy="HouseholdID"> 
  <result property="HouseholdID" column="HouseholdID"/> 
  <result property="Address" column="Address" /> 
  <result property="People" resultMap="Person.PersonResult" /> 

  <resultMap id="PersonResult" class="Person"> 
    <result property="PersonID" column="PersonID" nullValue="-1"/> 
    <result property="Name" column="Name"/> 
    <result property="SSN" column="SSN" nullValue="-1"/> 
    <result property="HouseholdID" column="HouseholdID" nullValue="-1"/> 

when a select is executed that returns a household record with no person 
records, the Household Java object has 1 child object with the following 
        PersonID        -1 
        Name                null 
        SSN                null 
        HouseholdID        -1 

I am using ibatis- 

Douglas Hansknecht
IT Architect, Portals, Content & e-Commerce
IBM Global Business Services
Phone: 614-582-9886 Fax: 614-559-4574
View raw message