Return-Path: Delivered-To: apmail-ibatis-user-cs-archive@www.apache.org Received: (qmail 79766 invoked from network); 13 Jul 2007 04:08:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jul 2007 04:08:46 -0000 Received: (qmail 23710 invoked by uid 500); 13 Jul 2007 04:08:48 -0000 Delivered-To: apmail-ibatis-user-cs-archive@ibatis.apache.org Received: (qmail 23695 invoked by uid 500); 13 Jul 2007 04:08:47 -0000 Mailing-List: contact user-cs-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-cs@ibatis.apache.org Delivered-To: mailing list user-cs@ibatis.apache.org Received: (qmail 23684 invoked by uid 99); 13 Jul 2007 04:08:47 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2007 21:08:47 -0700 X-ASF-Spam-Status: No, hits=2.8 required=10.0 tests=HTML_MESSAGE,INFO_TLD,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of sahridhayan@gmail.com designates 66.249.82.238 as permitted sender) Received: from [66.249.82.238] (HELO wx-out-0506.google.com) (66.249.82.238) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2007 21:08:43 -0700 Received: by wx-out-0506.google.com with SMTP id h29so341636wxd for ; Thu, 12 Jul 2007 21:08:20 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=NIcjj2UGZ/EdGXzu9UHrGq1XY19J/1rEOwsGQG00L0/cv+Njs6nAoREEs5o1PZ8jxHIrcryDL3TcYboBon42oa/MTMhodgqo6ovKGDZhYEqUFOLJDGQzYAuJL8Z09Z5cAEWNuCcwzArb3YxQ0qCq/QWtJikWrdR1LRhApe7HcIs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=AlXn6oiBcJMt4hqZzfZIZXB5xD80cF2NY6epuLwZscr9O0p5BdW858PRpulu3BMFp2pGj5bFyXFHPx5Ts68fOwiuZxkgv79ImPUPUdSHk4wlFaQ3b0SVyO0UmtFWiZJ5TiHRl4rosuOJ96v8iRvJ5hsJTN99n+3IIRRXkfNezKc= Received: by 10.90.69.8 with SMTP id r8mr1267022aga.1184299700575; Thu, 12 Jul 2007 21:08:20 -0700 (PDT) Received: by 10.90.94.15 with HTTP; Thu, 12 Jul 2007 21:08:20 -0700 (PDT) Message-ID: <25c36d2b0707122108k2c00fc11tbad246e6b8b52c9e@mail.gmail.com> Date: Fri, 13 Jul 2007 12:08:20 +0800 From: "Sahridhayan Ungal" To: user-cs@ibatis.apache.org Subject: Re: Generic Lists In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_23750_19158518.1184299700514" References: X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_23750_19158518.1184299700514 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline can you share with me the map file will look like for insert? i am also held up with similar (i.e cannot insert data from child class property, for example if i refer #Person.OID# inside INSERT statement i am using version IBatisNet.DataMapper.dll - 1.5.1.0 IBatisNet.DataAccess.dll - 1.8.1.0 with .net 2.0 and SQL 2005 and VS2005 in win xp machinesp2 Thank you for any lights shown in this problem.. Sahridhayan On 7/13/07, Nguyen, Tom wrote: > > Woopse, that's not generic. I wanted to simplify the code a little but > then it turns out to be non-generic. Here is the original code. > > > > /// > > /// Simplify Order Children class definition. > > /// > > [Serializable] > > public class OrderChild : BusinessBase > > { > > /// > > /// Order > > /// > > protected EntityRef _order =3D new EntityRef(= ); > > > > /// > > /// Get or sets Order > > /// > > public Order Order > > { > > get { return _order; } > > set { > > object self =3D this; // update circular reference > > _order.UpdateValue(value, (T)self); > > } > > } > > } > > > > public class OrderDeliveryAddress : OrderChild { = =85 } > > > > Regards, > > > Tom Nguyen > Sr. Developer > tom.nguyen@rels.info > > ------------------------------ > > *From:* Nguyen, Tom [mailto:Tom.Nguyen@rels.info] > *Sent:* Thursday, July 12, 2007 1:20 PM > *To:* user-cs@ibatis.apache.org > *Subject:* RE: Generic Lists > > > > I believe the latest one 1.6.1 has support for generic list. > > > > One thing I found is that it does not work for all generic definitions, > similar to Tony. > > > > Example: > > > > // In this example, I'm using Generic to write less code. Say Order's > Child can access Order similar to how Asp.NET Page.Controls[0].Page etc= =85 > > > > OrderChild > > /// > > /// Simplify Order Children class definition. > > /// > > [Serializable] > > public class OrderChild : BusinessBase > > { > > /// > > /// Order > > /// > > protected Order _order =3D new Order(); > > > > /// > > /// Get or sets Order > > /// > > public Order Order > > { > > get { return _order; } > > set { > > _order =3D value > > } > > } > > } > > // Then I can do something like this > > public class OrderLoanInfo : OrderChild { =85 } > > public class OrderDeliveryAddress : OrderChild { =85 } > > // This confuse the DataMapper and it doesn't know what to do if say I do > #_orderLoanInfo.Order.LoanNumber# > > > > I have to manually define the order object in every child class. > > > > > > Regards, > > > Tom Nguyen > Sr. Developer > tom.nguyen@rels.info > ------------------------------ > > *From:* Clough, Samuel (USPC.PRG.Atlanta) [mailto: > Samuel_Clough@princetonrg.com] > *Sent:* Thursday, July 12, 2007 12:36 PM > *To:* user-cs@ibatis.apache.org > *Subject:* RE: Generic Lists > > > > I'm probably not thinking clearly and haven't coded using iBatis in a > while, but doesn't it support just the IList interface, not necessary any > collection? In this case you may be getting lucky with List simply > because that is the default implementation of IList. Of course, I cou= ld > be way off so you may want to wait until the experts chime in... > > > ------------------------------ > > *From:* Tony Johnson [mailto:listAccount@deepcode.co.uk] > *Sent:* Thursday, July 12, 2007 1:20 PM > *To:* user-cs@ibatis.apache.org > *Subject:* Generic Lists > > Hi, > > > > I'm struggling with trying to get a custom generic list collection workin= g > with IBATIS lazy loading. Basically, if I have a simple object with a sim= ple > mapping file that lazy loads a list and that list is defined in my object= as > a List then things work fine. Eg: > > > > class myobject > > { > > =85 > > public List Children{get=85 set=85} > > } > > > > But as soon as I introduce a new class to take over the list, eg: > > > > public class MyList : List > > { > > } > > > > And then change myobject to use that: > > class myobject > > { > > =85 > > public MyList Children{get=85 set=85} > > } > > > > IBATIS no longer lazy loads any data. I'm under the impression that any > collection that implements IList or IList will work transparently with > lazy loading, yet the MyList class above implements these (albeit in t= he > base class) and it doesn't work. > > > > Am I doing something stupid here? > > > > Thanks > > Tony > > > ------------------------------ > > *Princeton Retirement Group, Inc - Important Terms * > > This E-mail is not intended for distribution to, or use by, any person or > entity in any location where such distribution or use would be contrary t= o > law or regulation, or which would subject Princeton Retirement Group, Inc= . > or any affiliate to any registration requirement within such location. > > This E-mail may contain privileged or confidential information or may > otherwise be protected by work product immunity or other legal rules. No > confidentiality or privilege is waived or lost by any mistransmission. > Access, copying or re-use of information by non-intended or non-authorize= d > recipients is prohibited. If you are not an intended recipient of this > E-mail, please notify the sender, delete it and do not read, act upon, > print, disclose, copy, retain or redistribute any portion of this E-mail. > > The transmission and content of this E-mail cannot be guaranteed to be > secure or error-free. Therefore, we cannot represent that the information= in > this E-mail is complete, accurate, uncorrupted, timely or free of viruses= , > and Princeton Retirement Group, Inc. cannot accept any liability for E-ma= ils > that have been altered in the course of delivery. Princeton Retirement > Group, Inc. reserves the right to monitor, review and retain all electron= ic > communications, including E-mail, traveling through its networks and syst= ems > (subject to and in accordance with local laws). If any of your details ar= e > incorrect or if you no longer wish to receive mailings such as this by > E-mail please contact the sender by reply E-mail. > ------------------------------ > ------------------------------ > > This e-mail message and any files transmitted herewith, are intended > solely for the use of the individual(s) addressed and may contain > confidential, proprietary or privileged information. If you are not the > addressee indicated in this message (or responsible for delivery of this > message to such person) you may not review, use, disclose or distribute t= his > message or any files transmitted herewith. If you receive this message i= n > error, please contact the sender by reply e-mail and delete this message = and > all copies of it from your system. > ------------------------------ > > ------------------------------ > > This e-mail message and any files transmitted herewith, are intended > solely for the use of the individual(s) addressed and may contain > confidential, proprietary or privileged information. If you are not the > addressee indicated in this message (or responsible for delivery of this > message to such person) you may not review, use, disclose or distribute t= his > message or any files transmitted herewith. If you receive this message i= n > error, please contact the sender by reply e-mail and delete this message = and > all copies of it from your system. > > ------------------------------ > > ------=_Part_23750_19158518.1184299700514 Content-Type: text/html; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
can you share with me the map file will look like for insert?
 
i am also held up with similar  (i.e cannot insert data from chil= d class property, for example if i refer #Person.OID# inside INSERT stateme= nt
 
i am using version
IBatisNet.DataMapper.dll - 1.5.1.0
IBatisNet.DataAccess.dll - 1.8.1.0
 
with .net 2.0 and SQL 2005 and VS2005
 
in win xp machinesp2
 
Thank you for any lights shown in this problem..
 
Sahridhayan
 
 


 
On 7/13/07, = Nguyen, Tom <Tom.Nguyen@rels= .info> wrote:

Woopse, that's not generic.  I= wanted to simplify the code a little but then it turns out to be non-gener= ic.  Here is the original code.

 

&n= bsp;   /// <= font color=3D"gray"> <summary>

&n= bsp;   /// Simplify Order = Children class definition.

&n= bsp;   /// <= font color=3D"gray"> </summary>

&n= bsp;   [Se= rializable]

&n= bsp;   public class OrderChild<T> : BusinessBase

&n= bsp;   {

&n= bsp;       /// <summary>

&n= bsp;       /// Order

&n= bsp;       /// </summary>

&n= bsp;       protected EntityRef< Order,= T> _order =3D new EntityRef<= /span> <Order, T>();

&n= bsp;

&n= bsp;       /// <summary>

&n= bsp;       /// Get or sets Order

&n= bsp;       /// </summary>

&n= bsp;       public Order Order

&n= bsp;       {

&n= bsp;           get { return _order; }

&n= bsp;           set {

&n= bsp;            = ;   object self =3D this;=20 // update circular reference<= /font>

&n= bsp;            = ;   _order.UpdateValue(value, (T)self);

&n= bsp;           }

&n= bsp;       }

&n= bsp;   }

&n= bsp;

public class = OrderDeliveryAddress : OrderChild< OrderDeliveryAddress> { =85 }

 

Regards,


Tom Nguyen=20
Sr. Developer
tom.nguyen@rels.info=


From: Nguy= en, Tom [mailto: Tom.Nguyen@rels.info]
Sent: Thursday= , July 12, 2007 1:20 PM
To: user-cs@ibatis.apache.org
Subject: RE: Generic Lists

I believe the latest one 1.6.1 has = support for generic list. 

 

One thing I found is that it does n= ot work for all generic definitions, similar to Tony.

 

Example:

 

// In this example, I'm using Gener= ic to write less code.  Say Order's Child can access Order similar to = how Asp.NET Page.Controls[0].Page etc=85

 

OrderChild

&n= bsp;   /// <= font color=3D"gray"> <summary>

&n= bsp;   /// Simplify Order = Children class definition.

&n= bsp;   /// <= font color=3D"gray"> </summary>

&n= bsp;   [Se= rializable]

&n= bsp;   public class OrderChild : BusinessBase

&n= bsp;   {

&n= bsp;       /// <summary>

&n= bsp;       /// Order

&n= bsp;       /// </summary>

&n= bsp;       protected Order _order =3D=20 new Order();

&n= bsp;

&n= bsp;       /// <summary>

&n= bsp;       /// Get or sets Order

&n= bsp;       /// </summary>

&n= bsp;       public Order Order

&n= bsp;       {

&n= bsp;           get { return _order; }

&n= bsp;           set {

&n= bsp;            = ;   _order =3D value

&n= bsp;           }

&n= bsp;       }

&n= bsp;   }

//= Then I can do something= like this

public class = OrderLoanInfo : OrderChild { =85 }

public class = OrderDeliveryAddress : OrderChild { =85 }

//= This confuse the DataMa= pper and it doesn't know what to do if say I do #_orderLoanInfo.Order.LoanN= umber#

&n= bsp;

I = have to manually define the order object in every child class.

 

 

Regards,


Tom Nguyen
Sr. Developer
tom.nguyen@rels.info=


From: Clou= gh, Samuel ( USPC.PRG.Atlanta) [mailto:= Samuel_Clough@princetonrg.com]
Sent: Thursday, July 12, 2007 12:36 PM
To: user-= cs@ibatis.apache.org
Subject: RE: Generi= c Lists

I'm probably not= thinking clearly and haven't coded using iBatis in a while, but doesn&= #39;t it support just the IList interface, not necessary any collection?&nb= sp; In this case you may be getting lucky with List<T> simply because= that is the default implementation of IList<T>.  Of course, I c= ould be way off so you may want to wait until the experts chime in...

 


From: Tony Johnson [mailto:listAcc= ount@deepcode.co.uk]
Sent: Thursday, July 12, 2007 1:20 PM
To= : user-cs@ibatis.ap= ache.org
Subject: Generic Li= sts

Hi,

 =

I'm struggling with = trying to get a custom generic list collection working with IBATIS lazy loa= ding. Basically, if I have a simple object with a simple mapping file that = lazy loads a list and that list is defined in my object as a List<T> = then things work fine. Eg:

 =

class myobject

{

=85

public List<subobject> Children{get=85 set=85}

}

 =

But as soon as I int= roduce a new class to take over the list, eg:

 =

public class MyList<T> : List<T>

{

}

 =

And then change myob= ject to use that:

class myobject

{

=85

public MyList<subobject> Children{get=85 set=85}=

}

 =

IBATIS no longer laz= y loads any data. I'm under the impression that any collection that impleme= nts IList or IList<T> will work transparently with lazy loading, yet = the MyList<T> class above implements these (albeit in the base class)= and it doesn't work.=20

 =

Am I doing something= stupid here?

 =

Thanks=

Tony

 =


Pr= inceton Retirement Group, Inc - Important Terms

This E-mail is not intended for distribution to, or use by= , any person or entity in any location where such distribution or use would= be contrary to law or regulation, or which would subject Princeton Retirem= ent Group, Inc. or any affiliate to any registration requirement within suc= h location.=20

This E-mail may contain privileged or confidential informa= tion or may otherwise be protected by work product immunity or other legal = rules. No confidentiality or privilege is waived or lost by any mistransmis= sion. Access, copying or re-use of information by non-intended or non-autho= rized recipients is prohibited. If you are not an intended recipient of thi= s E-mail, please notify the sender, delete it and do not read, act upon, pr= int, disclose, copy, retain or redistribute any portion of this E-mail.=20

The transmission and content of this E-mail cannot be guar= anteed to be secure or error-free. Therefore, we cannot represent that the = information in this E-mail is complete, accurate, uncorrupted, timely or fr= ee of viruses, and Princeton Retirement Group, Inc. cannot accept any liabi= lity for E-mails that have been altered in the course of delivery. Princeto= n Retirement Group, Inc. reserves the right to monitor, review and retain a= ll electronic communications, including E-mail, traveling through its netwo= rks and systems (subject to and in accordance with local laws). If any of y= our details are incorrect or if you no longer wish to receive mailings such= as this by E-mail please contact the sender by reply E-mail.=20



This e-mail message and any files transmitted herewith, are = intended solely for the use of the individual(s) addressed and may contain = confidential, proprietary or privileged information.  If you are not t= he addressee indicated in this message (or responsible for delivery of this= message to such person) you may not review, use, disclose or distribute th= is message or any files transmitted herewith.  If you receive this mes= sage in error, please contact the sender by reply e-mail and delete this me= ssage and all copies of it from your system.



This e-mail message and any files transmitted herewith, are intended= solely for the use of the individual(s) addressed and may contain confiden= tial, proprietary or privileged information.  If you are not the addre= ssee indicated in this message (or responsible for delivery of this message= to such person) you may not review, use, disclose or distribute this messa= ge or any files transmitted herewith.  If you receive this message in = error, please contact the sender by reply e-mail and delete this message an= d all copies of it from your system. =20



------=_Part_23750_19158518.1184299700514--