Hi group;
I was wondering if there is any way to receive the ResultSet back straight
from iBATIS, i.e. allow iBATIS to do the mapping on the way in, but let me
manipulate the ResultSet directly on the way out.
I have a framework that uses iBATIS to product "no-code" reports (just the
Have you tried using a row handler?
I have found them to be very efficient working with large datasets.
Larry
On 1/4/07, Tegan Clark <[EMAIL PROTECTED]> wrote:
Hi group;
I was wondering if there is any way to receive the ResultSet back straight
from iBATIS, i.e. allow iBATIS to do the mapping
Hi Tegan,
I think the RowHandler interface will provide the functionality you need,
this will allow you to iterate the objects.
Take a look in p61 of the developer handbook for a nice example
Damien.
Ps. The Handbook is at :
http://ibatis.apache.org/docs/java/pdf/iBATIS-SqlMaps-2_
Damien/Larry,
Thanks for the reply. I've looked at RowHandler, and unless I'm missing
something iBATIS is still controlling the iteration and passing me a Map of the
underlying data, i.e. iBATIS first incures the overhead of adapting the
ResultSet to the Map, and then I must implement som
iBATIS is used to wrap JDBC, so that you don't have to deal with the low
level details.
If you want to deal with the low level details, simply don't use iBATIS.
You are going to have an overhead if you use wrapper, but the overhead
is probably minimal.
Do things the normal iBATIS way, and if yo
Hi Tegan,
I'm not sure which overhead you are trying to avoid..
If you want to avoid loading 100,000 objects into memory at the same time,
then the RowHandler will do this for you. The row handler will walk along
the resultSet and for each row call handleRow. So you would expect this
method
How does iBatis determine whether results are to be pulled from the cache or
to be queried from the database? For instance, if I have a query like such:
"select * from employee" and then follow-up with a second query of "select *
from employee where id=1", the second query appears to hit the datab
iBATIS caches by SQL statement - your two statements are different, so there
is a cache miss. This also demonstrates a fundamental truth about iBATIS -
iBATIS doesn't know about object identity. So iBATIS would have no way of
looking through the first set of cached results to see if an object fr
Thanks for the quick response.
"iBATIS caches by SQL statement". I thought that was the case. Thanks for
confirming.
I'm trying to just use iBatis caching. One way that I saw of accomplishing
pre-loading was to issue the "select * from employee" at web application
startup. Then, on each user req
The new iBatis book describes lazy-loading as follows (pg 131).
"To use lazy loading, we need to edit the SqlMapConfig.xml file to
enable it by changing the lazyLoadingEnabled attribute to true in the
element. If you want to use the cglib enhanced version of lazy
loading, you will want to downloa
Setting lazyLoadingEnabled to true will allow the lazy loading 1 to many
relationships. You don't have any 1 to many relationships in your code
below.
Setting enhancementEnabled to true will allow the lazy loading of 1 to
1 relationships.
From: Kuntz, Tim [mail
We are attempting to use iBATIS to map into DataObjects (SDOs) . We use a Map
implementation to move the data into and out of the DataObject. A single result
class is used for all result maps. We use a custom ResultObjectFactory to
create and initialize the 'type' of this object. There are tim
Paul is right, but I'd like to add a little more to the explanation:
With enhancement (CGLIB) you can lazy load properties of complex, concrete
or abstract types (as well as interfaces). Without enhancement (CGLIB), you
can only lazy load properties of interface types.
The reason is that Java's
Thanks for the info Clinton and Paul... I'm not sure I would have
figured out those nuances on my own.
From: Clinton Begin [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 04, 2007 10:04 PM
To: user-java@ibatis.apache.org
Subject: Re: iBatis Book - Lazy Loadi
Hi Tegan,
I once made a feature request for something like this:
http://issues.apache.org/jira/browse/IBATIS-206
It didnt receive any serious consideration though, perhaps more on grounds
of ideology than of practicality.
The basis of my request was that if we have the RowHandler f
15 matches
Mail list logo