ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Mills <developm...@peter.mills.to>
Subject Re: Possible Bug: ResultMapping with a resultmap with no direct Properties
Date Sun, 16 Jul 2006 03:55:44 GMT
Thank you for the quick response. 

Yes, I'm using DataMapper 1.5 Beta.  The useReflectionOptimizer setting 
was enabled, but disabling it didn't help.


Ron Grabowski wrote:

>You're using DataMapper 1.5 Beta correct? 
>Is useReflectionOptimizer enabled?
>--- Peter Mills <development@peter.mills.to> wrote:
>>I'm having trouble with a resultmapping, using the latest beta of the
>>The problem occurs when a resultMapping only contains properties with
>>select attributes (no direct result properties).  In the example
>>I'm trying to map a ReferencePeople object to my Customer object.  
>>ReferencePeople is a simple class that contains a customer's
>>people at a company and some minimal logic.  As such, it contains no 
>>properties other than other mapped objects (such as Salesman).  When 
>>doing the mapping below, despite creating ReferencePeople abject and 
>>adding a salesman to  it, Ibatis injects null into the
>>property of Customer.  However, if I add any direct property to 
>>ReferencePeople, such as copying the Customer's version property in 
>>there, then Ibatis properly injects a ReferencePeople object into
>><resultMap id="Customer" class="Customer">
>>    <result property="CustomerID" column="CustomerID"/>
>>    <result property="ReferencePeople" 
>>    <result property="Version" column ="Version"/>
>><resultMap id="ReferencePeopleResult" class="ReferencePeople">
>>    <result property="PreferredSalesman" column="PreferredSalesman" 
>>    <!-- If I add a random property from Customer to ReferencePeople,
>>that it has a direct property, then everything works fine -->       
>>    <!--<result property="Version" column ="Version"/>-->
>>class customer
>>    properties: CustomerID: long, ReferencePeople: ReferencePeople, 
>>Version: long
>>class ReferencePeople
>>    properties: PreferredSalesman: Salesman, Version: long (version
>>only added in debugging and does not belong in ReferencePeople)
>>    Customer and ReferencePeople information are both stored in the 
>>Customer Table, Salesman infromation is in its own table.

View raw message