It's in section 3.5.3.6 ("resultMapping") in the DataMapper Guide.  See http://ibatis.apache.org/downloads.html for DataMapper 1.2.1 for .NET, Docs Bundle (CHM, PDF, and SDK Help) .

Roberto

On 9/23/05, Joe Chandler <[EMAIL PROTECTED]> wrote:
I have looked through the documentation (the generic pdf ) and online
and cannot find any reference to resultMapping attribute.  Can you send
a link as to how to make this work? Or the snippet from whatever doc
that explains how to do this in .NET?

-J

-----Original Message-----
From: Ron Grabowski [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 23, 2005 3:46 PM
To: user-cs@ibatis.apache.org
Subject: Re: Result Map nested properties in .NET

I think it would be nice if IBatisNet handled this case like Java. Is
there a reason why we don't? If I were using a moderately complex
object with other objects as properties:

EmailMessage.FromOjbect.Name
EmailMessage.ToObject.Name
EmailMessage.BccObject.Name

I would add 3 type aliases to my sql map file and 3 additional
resultMap nodes each containing 1 result node? That seems like a lot of
work to just set simple string properties...

--- Gilles Bayon <[EMAIL PROTECTED]> wrote:

> It's is not supported in the .NET version (not a bug), you must use a
> resuttMapping attribut.
> I gess you read the Java Guide.
>
>  On 9/23/05, Joe Chandler <[EMAIL PROTECTED]> wrote:
> >
> > I am trying to use an embedded object in a result map, but I get
> the
> > following error:
> >
> >     IBatisNet.Common.Exceptions.ConfigurationException:
> >
> >       - The error occurred while loading SqlMap .
> >
> >       - initialize result property : Message.To
> >
> >       - The error occurred in <sqlMap
> >
> url="" />.
> >
> >       - Check the Email.EmailResult. --->
> >       IBatisNet.Common.Exceptions.ConfigurationException: Could not
> >       configure ResultMap. ResultMap named "EmailResult" not found,
> failed.
> >
> >       Cause: There is no Set property named 'Message.To' in class
> >       'EmailMessage'
> >
> >       at
> >
>
IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.Initialize (Co
nfigurationScope
> >       configScope)
> >
> >
> >
> >
> > Does the .NET version of 1.2 DataMapper support what the docs say
> > regarding this?
> >
> >     This is from the dev guide for iBatis....
> >
> >       The solution is to use a join and nested property mappings
> >       instead of a separate select statement. Here's an
> >
> >       example using the same situation as above (Products and
> >       Categories):
> >
> >       Developer Guide iBATIS SQL Maps 2
> >
> >       http://www.ibatis.com by Clinton Begin
> >
> >       26
> >
> >       <resultMap id="get-product-result"
> >       class="com.ibatis.example.Product">
> >
> >             <result property="id" column="PRD_ID"/>
> >
> >             <result property="description"
> >             column="PRD_DESCRIPTION"/>
> >
> >             <result property="***category.id<http://category.id/>
> >             *" column="CAT_ID" />
> >
> >             <result property="*** category.description*"
> >             column="CAT_DESCRIPTION" />
> >
> >       </resultMap>
> >
> >
> >
> > This is my result map definition:
> >
> >  <resultMaps>
> >
> > <resultMap id="EmailResult" class="EmailMessage">
> >
> > <result property="Id" column="ID"/>
> >
> > <result property="Message.To" column="TO"/>
> >
> > </resultMap>
> >
> > </resultMaps>
> >
> > This is my EmailMessage Object:
> >
> >     public class EmailMessage : BaseDomainEntity, IMessage {
> >
> >
> >        private System.Web.Mail.MailMessage _message = new
> >       System.Web.Mail.MailMessageMailMessage ();
> >
> >         public System.Web.Mail.MailMessage Message {
> >
> >       get { return _message; }
> >
> >       set { _message = value; }
> >
> >       }
> >
> >       }
> >
> >
>



Reply via email to