ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe Laflamme" <philippe.lafla...@mail.mcgill.ca>
Subject RE: A few dumb questions
Date Tue, 30 Nov 2004 17:11:16 GMT
> Cool, thanks, did not know I could use condition tags. With 
> all this XML parsing and checking, I suppose the overhead 
> still is pretty negligible compared to the execution of the 
> statement right?

If you take a look at the SQLMap PDF document you'll also notice that other
tags exist as well (not only condition tags). For example there is a tag
that allows you to iterate on a Collection (or array) of objects. This
allows you to build IN clauses for example.

If I'm correct, XML checking (validation) is done upon loading the file. The
building of the actual SQL is made when calling the statement. As you said,
building the SQL is negligible compared to the actual SQL execution. If
you're looking to optimize SQL queries, the time taken to build the query
should not even be considered. Also, there is a caching mechanism built into
the SQLMap framework; it allows for completely avoiding the database in
certain circumstances... Again, take a look at the document for more info.

> 
> Talking about performance, do you know if prepared statements 
> are being used?

Yep. Batch insert and updates are also available...

Thanks,
Phil

> -----Original Message-----
> From: Oliver Zeigermann [mailto:oliver.zeigermann@gmail.com] 
> Sent: Tuesday, November 30, 2004 11:41 AM
> To: ibatis-user-java@incubator.apache.org
> Subject: Re: A few dumb questions
> 
> 
> On Tue, 30 Nov 2004 08:55:00 -0500, Philippe Laflamme 
> <philippe.laflamme@mail.mcgill.ca> wrote:
> > As you probably know, SQL in iBatis is built using XML. 
> Tags are used 
> > to test different conditions on the parameter object. So 
> for example, 
> > you can test whether a value in the parameter is null, 
> equal to some 
> > value and so on. These tags allows for building complex SQL queries 
> > that are easy to read, understand and especially maintain.
> > 
> > So instead of concatenating Java String objects to build complex 
> > queries with a bunch of if-then-else and switch-case 
> statements, you 
> > build the query by specifying when/how certain blocks should be 
> > evaluated.
> 
> Cool, thanks, did not know I could use condition tags. With 
> all this XML parsing and checking, I suppose the overhead 
> still is pretty negligible compared to the execution of the 
> statement right?
> 
> Talking about performance, do you know if prepared statements 
> are being used?
> 
> Oliver
> 


Mime
View raw message