ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject RE: Result Map nested properties in .NET
Date Mon, 10 Oct 2005 18:50:37 GMT
Gilles commented that IBatisNet uses a slightly different syntax:

 http://www.mail-archive.com/user-cs%40ibatis.apache.org/msg00323.html

Anyone can create and/or vote on issues by going to:

 http://issues.apache.org/jira/browse/IBATISNET

--- "Potter, Christopher" <Christopher.Potter@nfsmt.com> wrote:

> Hi All:
> 
> Just curious if a JIRA issue has been created for this yet.  I'm
> getting
> killed by this limitation right now just as Ron suggests in an
> example
> he sent as a follow-up to the message below.
> 
> Thanks,
> Chris
> 
> -----Original Message-----
> From: Ron Grabowski [mailto:rongrabowski@yahoo.com] 
> Sent: Friday, September 23, 2005 3:16 PM
> To: user-cs@ibatis.apache.org
> Subject: Re: Result Map nested properties in .NET
> 
> Hrmmm, I thought we had this functionality. I wrote a test case and
> got
> the same error you did. I looked through the code and I couldn't find
> anything that would parse that. 
> 
> I saw that IBatisNet.DataMapper.Test.Domain.LineItem had a Order
> property but we don't have tests to populate a property on the Order
> object.
> 
> I think the problem originates from line 262 of ResultProperty.cs:
> 
>  _propertyInfo = 
>   ReflectionInfo.GetInstance(resultClass).GetSetter(_propertyName);
> 
> In your case, _propertyName is equal to "Message.To".
> 
> I suggest creating an issue in JIRA:
> 
>  http://issues.apache.org/jira/browse/IBATISNET
> 
> Does the IBatieNet DataMapper documentation say we support this?
> There's always a chance that I've overlooked something and that it is
> possible :)
> 
> --- Joe Chandler <joe.chandler@autodesk.com> 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="C:\Projects\Common\Core\DataConfig\Maps\Oracle\Email.xml" />. 
> 
> > 		- 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"
> > 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; }    
> > 		        }
> > 
> > 		}
> > 
> 
> 


Mime
View raw message