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