Return-Path: Delivered-To: apmail-ibatis-user-cs-archive@www.apache.org Received: (qmail 3270 invoked from network); 12 Jul 2007 19:07:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jul 2007 19:07:35 -0000 Received: (qmail 13874 invoked by uid 500); 12 Jul 2007 19:07:37 -0000 Delivered-To: apmail-ibatis-user-cs-archive@ibatis.apache.org Received: (qmail 13864 invoked by uid 500); 12 Jul 2007 19:07:37 -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 13853 invoked by uid 99); 12 Jul 2007 19:07:37 -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 12:07:37 -0700 X-ASF-Spam-Status: No, hits=2.8 required=10.0 tests=HTML_MESSAGE,INFO_TLD X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [199.43.38.100] (HELO mlnya402er.ml.com) (199.43.38.100) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2007 12:07:32 -0700 Received: from mlnyc852bh.amrs.win.ml.com (unknown [141.128.12.202]) by mlnya402er.ml.com (Postfix) with ESMTP id 8D594545B8 for ; Thu, 12 Jul 2007 15:07:09 -0400 (EDT) Received: from mlnya302bh.amrs.win.ml.com ([170.240.239.47]) by mlnyc852bh.amrs.win.ml.com with Microsoft SMTPSVC(5.0.2195.6920); Thu, 12 Jul 2007 15:07:09 -0400 Received: from MLNYC728MB.amrs.win.ml.com ([141.128.12.73]) by mlnya302bh.amrs.win.ml.com with Microsoft SMTPSVC(5.0.2195.6920); Thu, 12 Jul 2007 15:06:13 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.0.6619.12 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7C4B7.B52A0CB8" Subject: RE: Generic Lists Date: Thu, 12 Jul 2007 15:06:10 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Generic Lists thread-index: AcfD14bIX94S31EiSqqSTWeJKLxSdQA0HRRAAADByKAAASFDsAAAfoqwAAGK/VA= From: "Clough, Samuel \(USPC.PRG.Atlanta\)" To: X-OriginalArrivalTime: 12 Jul 2007 19:06:13.0637 (UTC) FILETIME=[B7483350:01C7C4B7] X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. ------_=_NextPart_001_01C7C4B7.B52A0CB8 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I was a little confused :^). _____ =20 From: Nguyen, Tom [mailto:Tom.Nguyen@rels.info]=20 Sent: Thursday, July 12, 2007 2:24 PM To: user-cs@ibatis.apache.org Subject: RE: Generic Lists 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. =20 /// /// Simplify Order Children class definition. /// [Serializable] public class OrderChild : BusinessBase { /// /// Order /// protected EntityRef _order =3D new EntityRef(); =20 /// /// Get or sets Order /// public Order Order { get { return _order; } set { object self =3D this; // update circular reference _order.UpdateValue(value, (T)self);=20 } } } =20 public class OrderDeliveryAddress : OrderChild { ... } =20 Regards, Tom Nguyen=20 Sr. Developer tom.nguyen@rels.info =20 _____ =20 From: Nguyen, Tom [mailto:Tom.Nguyen@rels.info]=20 Sent: Thursday, July 12, 2007 1:20 PM To: user-cs@ibatis.apache.org Subject: RE: Generic Lists =20 I believe the latest one 1.6.1 has support for generic list. =20 =20 One thing I found is that it does not work for all generic definitions, similar to Tony. =20 Example: =20 // 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... =20 OrderChild /// /// Simplify Order Children class definition. /// [Serializable] public class OrderChild : BusinessBase { /// /// Order /// protected Order _order =3D new Order(); =20 /// /// Get or sets Order /// public Order Order { get { return _order; } set { _order =3D value=20 } } } // Then I can do something like this public class OrderLoanInfo : OrderChild { ... } public class OrderDeliveryAddress : OrderChild { ... } // This confuse the DataMapper and it doesn't know what to do if say I do #_orderLoanInfo.Order.LoanNumber# =20 I have to manually define the order object in every child class. =20 =20 Regards, Tom Nguyen=20 Sr. Developer tom.nguyen@rels.info =20 _____ =20 From: Clough, Samuel (USPC.PRG.Atlanta) [mailto:Samuel_Clough@princetonrg.com]=20 Sent: Thursday, July 12, 2007 12:36 PM To: user-cs@ibatis.apache.org Subject: RE: Generic Lists =20 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 could be way off so you may want to wait until the experts chime in... =20 _____ =20 From: Tony Johnson [mailto:listAccount@deepcode.co.uk]=20 Sent: Thursday, July 12, 2007 1:20 PM To: user-cs@ibatis.apache.org Subject: Generic Lists Hi, =20 I'm struggling with trying to get a custom generic list collection working with IBATIS lazy loading. 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 then things work fine. Eg: =20 class myobject { ... public List Children{get... set...} } =20 But as soon as I introduce a new class to take over the list, eg: =20 public class MyList : List { } =20 And then change myobject to use that: class myobject { ... public MyList Children{get... set...} } =20 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 the base class) and it doesn't work.=20 =20 Am I doing something stupid here? =20 Thanks Tony =20 _____ =20 Princeton Retirement Group, Inc - Important Terms=20 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 Retirement Group, Inc. or any affiliate to any registration requirement within such location.=20 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-authorized 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.=20 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-mails that have been altered in the course of delivery. Princeton Retirement Group, Inc. reserves the right to monitor, review and retain all electronic communications, including E-mail, traveling through its networks and systems (subject to and in accordance with local laws). If any of your 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 _____ =20 _____ =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 the addressee indicated in this message (or responsible for delivery of this message to such person) you may not review, use, disclose or distribute this message or any files transmitted herewith. If you receive this message in error, please contact the sender by reply e-mail and delete this message and all copies of it from your system.=20 _____ =20 _____ =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 the addressee indicated in this message (or responsible for delivery of this message to such person) you may not review, use, disclose or distribute this message or any files transmitted herewith. If you receive this message in error, please contact the sender by reply e-mail and delete this message and all copies of it from your system.=20 _____ =20 ------_=_NextPart_001_01C7C4B7.B52A0CB8 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
I was a little confused = :^).


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

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

 

    = /// <summary>

    = /// Simplify Order Children class=20 definition.

    = /// </summary>

    = [Serializable]

    = public class OrderChild<T> : BusinessBase

    = {

       =20 /// <summary>

       =20 ///=20 Order

       =20 /// </summary>

       =20 protected = EntityRef<Order, = T> _order =3D=20 new EntityRef<Order,=20 T>();

 

       =20 /// <summary>

       =20 /// Get or sets=20 Order

       =20 /// </summary>

       =20 public = Order=20 Order

       =20 {

            = get { return _order;=20 }

            = set=20 {

           &= nbsp;   =20 object self = =3D this; // update circular=20 reference

           &= nbsp;   =20 _order.UpdateValue(value, (T)self); =

            = }

       =20 }

    = }

 

public class OrderDeliveryAddress : OrderChild<OrderDeliveryAddress> { = …=20 }

 

Regards,


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

<= /o:p>


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

 

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

 

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

 

Example:

 

// In this = example, I’m=20 using Generic to write less code.  Say Order’s Child can = access Order=20 similar to how Asp.NET Page.Controls[0].Page = etc…

 

OrderChild

    = /// <summary>

    = /// Simplify Order Children class=20 definition.

    = /// </summary>

    = [Serializable]

    = public class OrderChild : BusinessBase

    = {

       =20 /// <summary>

       =20 ///=20 Order

       =20 /// </summary>

       =20 protected = Order = _order =3D new Order();

 

       =20 /// <summary>

       =20 /// Get or sets=20 Order

       =20 /// </summary>

       =20 public = Order=20 Order

       =20 {

            = get { return _order;=20 }

            = set=20 {

           &= nbsp;   =20 _order =3D value

            = }

       =20 }

    = }

// Then I can do something like=20 this

public class OrderLoanInfo : OrderChild { …=20 }

public class OrderDeliveryAddress : OrderChild = { …=20 }

// This confuse the DataMapper and it doesn’t = know what to do=20 if say I do=20 #_orderLoanInfo.Order.LoanNumber#<= /P>

 

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

 

 

Regards,


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


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

 

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

 


From: Tony=20 Johnson [mailto:listAccount@deepcode.co.uk]
Sent:
Thursday, July 12, 2007 = 1:20=20 PM
To:=20 user-cs@ibatis.apache.org
Subject: Generic=20 Lists

Hi,

 

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

 

class=20 myobject

{

public=20 List<subobject> Children{get… = set…}

}

 

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

 

public class=20 MyList<T> : List<T>

{

}

 

And then = change=20 myobject to use that:

class=20 myobject

{

public=20 MyList<subobject> Children{get… = set…}

}

 

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

 

Am I doing = something=20 stupid here?

 

Thanks

Tony

 


Princeton = Retirement=20 Group, Inc - Important Terms

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

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

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



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



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


------_=_NextPart_001_01C7C4B7.B52A0CB8--