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<T>
simply because that is the default implementation of IList<T>.  Of
course, I could be way off so you may want to wait until the experts
chime in...

  _____  

From: Tony Johnson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 12, 2007 1:20 PM
To: [email protected]
Subject: Generic Lists



Hi,

 

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<T> then things work fine. Eg:

 

class myobject

{

...

public List<subobject> Children{get... set...}

}

 

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

 

public class MyList<T> : List<T>

{

}

 

And then change myobject to use that:

class myobject

{

...

public MyList<subobject> Children{get... set...}

}

 

IBATIS no longer lazy loads any data. I'm under the impression that any
collection that implements 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. 

 

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 to 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-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. 
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. 

--------------------------------------------------------

Reply via email to