You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by Ron Grabowski <ro...@yahoo.com> on 2006/07/16 20:29:52 UTC

/branches/IBatisNet.DataMapper-QueryForDataTable

Several people (both on the mailing list and people that I've talked to
in person) have asked for IBatisNet to support DataTables. I see a
DataTable as an extended IDictionary that has built-in support for
sorting, filtering, and web service serialization (IDictionary objects
can't be passed to a web service). I think a DataTable is unique enough
and such a core class to .NET that it desrves its own QueryFor* method
instead of calling QueryForObject and casting the returned value.

I started a branch to support DataTables in IBatisNet. I'm slow at
commiting code and I didn't want to wait until I had a giant patch on
my computer that was 100% working until it was commited. Hopefully the
branch will motivate me (and others) to communicate and commit more
often. 

I've only added new files to the VS2003 project file. As of last night
I was able to execute a <select> statement and return a DataTable. I
messed around with some other files this morning before I did the
branch. Everything should compile but there's no guarantee that the
branched code will always pass any/all tests.

I also included code that may fix IBATISNET-104 (QueryForXXX do not
check cache before opening/closing connection) by adding a PreExecute
event that is raised right before the IDbCommand is execute. Another
interesting event might be IMappedStatement.RequestScopeCreated. That
may be a better place to open the connection instead of right before
the IDbCommand is executed. Can anyone thing of any other interesting
events? I don't want to add events unless there is a use/need for them.

Re: /branches/IBatisNet.DataMapper-QueryForDataTable

Posted by Gilles Bayon <ib...@gmail.com>.
I don't see the benefit of using type handler in this case ???

Re: /branches/IBatisNet.DataMapper-QueryForDataTable

Posted by Ron Grabowski <ro...@yahoo.com>.
Regarding revision 422779, we can't use a DataAdapter because it
doesn't expose an event to allow us to intercept the creation of the
DataRow to use a type handler. We have to manually add rows to the
DataTable.

--- Gilles Bayon <ib...@gmail.com> wrote:

> I will give a look in the week
> 


Re: /branches/IBatisNet.DataMapper-QueryForDataTable

Posted by Gilles Bayon <ib...@gmail.com>.
I will give a look in the week