Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 161397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:12:21+00:00 2026-05-11T11:12:21+00:00

This question is in relation to another question I have: Using iBATIS.NET with generic

  • 0

This question is in relation to another question I have: Using iBATIS.NET with generic custom collection interfaces and Unity

The problem seems to be that iBATIS.NET will only populate a custom collection (i.e. QueryForObject(‘Select_Foo’) which has a custom collection of Bars) if it is a concrete instance of custom collection not an interface. Does anyone know if this is a limitation of iBATIS.NET or if there is a way of doing this?

Thanks,

Paul

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:12:22+00:00Added an answer on May 11, 2026 at 11:12 am

    If I understood you right then you’d like to get full control over the way how iBatis maps to some object.

    You can do this with the ITypeHandlerCallback. Have a look for a full description in the PDF documentation in section ‘3.5.5. Custom Type Handlers’.

    I have done something similar with DataTables. Your implementation might look similar to this:

    class DataTableBuilder : ITypeHandlerCallback {     public object GetResult(IResultGetter getter)     {         IDataReader reader = getter.DataReader;          // (A) define whatever type you want to          // (B) read rows from DataReader and populate your type from (A)         while (reader.Read())         {             // iterate over the columns of the current row             for (int i = 0; i < reader.FieldCount; i++)             {                // populate your type from (A)             }                             }         return ...;   // return your type from (A)     }      // implement the other members of ITypeHandlerCallback     // the implementation below actually worked for me     public object NullValue { get { return null; } }     public void SetParameter(IParameterSetter setter, object parameter) { }     public object ValueOf(string s) { return s; } } 

    A last note: iBatis is fine for building data transfer objects (DTOs). If you try something like above, you might already moving toward a business object approach. This might get painful with iBatis. Currently (well … for a few months already, due to lack of time) I am evaluating NHibernate as an alternative. I think that NHibernate is handling business object approaches much more smoothly than iBatis does.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 180k
  • Answers 180k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It looks like whichever program or process you're trying to… May 12, 2026 at 3:58 pm
  • Editorial Team
    Editorial Team added an answer What you have in your first query is not a… May 12, 2026 at 3:58 pm
  • Editorial Team
    Editorial Team added an answer A much more elegant solution would be to use the… May 12, 2026 at 3:58 pm

Related Questions

This question is in relation to another question asked here: Sorting 1M records I
I make an AJAX request to a PHP script which returns a number from
All, this is my code //declare string pointer BSTR markup; //initialize markup to some
Before you answer this I have never developed anything popular enough to attain high

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.