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

  • Home
  • SEARCH
  • 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

Related Questions

No related questions found

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.