ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Goodin <brandon.goo...@gmail.com>
Subject Re: Alternate dynamic SQL syntax?
Date Thu, 30 Dec 2004 21:03:43 GMT
I've been in a bit of a wait and ping mode. There have been some
changes that Clinton wanted to get in the mix before we started
working on the dynamic sql expansion.

The way i see things is that dynamic tags are a form of scripting that
take advantage of EL. So, there is a distinction between supporting an
EL with our tagset or supporting scripting in a similar way as Ant
does. I don't think EL and Scripting are the same thing and i don't
think EL should stand alone as a full blown scripting solution.

I think we need to expand our tags to be more JSTLish in nature. We
need to provide some conditional tags. The EL then becomes the means
for the tags to access the scoped objects and perform basic boolean
testing. One of the advantages of the tags is that they provide for
some very tidy coding.

Examine the iterate tag:

WHERE someValue IN
<iterate property="myProperty" open="(" close=")" conjunction=",">

This would get pretty messy in a scripting language because all of the
internal processing that the <iterate> tag represents would be exposed
in the mapped statement and we begin to push back to clumsier looking
sql/code mingling.

We could provide for custom script functions. But, i have yet to see
any scripting language that would keep the mapped statement as clean
and readable as the tags do. I think we should lean our resources into
adding EL and improving the tagset.

One side note is that EL tends to follow the same property notation as
our property inclusion does ${...}. Tthis may be problematic.

There have been some threads in the sourceforge forum discussing this.
I even posted a comparison of choices with pros and cons. I'll try to
find them and post them here.


On Thu, 30 Dec 2004 11:22:19 -0700, Clinton Begin
<clinton.begin@gmail.com> wrote:
> Hi Scott,
> 1.  In a sense, iBATIS has always been pluggable in this way.  The Sql
> interface is the generalization that allows different Sql sources to
> be applied to a mapped statement.  I have not made any public
> documentation for it.  The bigger challenge is how we'll add the
> "plugability" to the XML parser.  It shouldn't be too hard, but we
> just need to do some tinkering to see what will work best.
> 2.  I can't speak for Brandon, save to say that I don't think we've
> landed on which EL or template language we want to support.  Perhaps
> the best thing to do is to just implement it and see how we can plug
> it in?
> The good news is that with the 2.0.9/2.1 release, we'll have
> implemented a number of the most critical features, which means we'll
> have more time to tinker with this.  I've also rewritten the XML
> parser to make it easier to add such things.
> >> I've got an itch to scratch re: dynamic SQL syntax, and
> >> I was wondering what I could use as a starting point.
> You can get cream for that.  ;-)  But really, if you look at the
> package com.ibatis.sqlmap.engine.mapping.sql.* you'll see three
> implementations: Static, Simple Dynamic, and Dynamic.  These are in
> order of increasing complexity.
> The job of an Sql implementation is to: 1) prepare and return the SQL,
> 2) prepare and return the parameter map, and 3) prepare and return the
> result map.
> Parameter Maps and Result Maps are (in their simplest form) property
> to column mappings.
> Have a look and see if you can work with that.
> Cheers,
> Clinton
> On Wed, 29 Dec 2004 12:10:45 -0600, Severtson, Scott (Associate)
> <Scott.Severtson@qg.com> wrote:
> > Clinton/Brandon,
> >
> > I was wondering if anything came from the Sourceforge Forum discussions
> > in June regarding velocity/jexl/ognl templating
> > (http://sourceforge.net/forum/message.php?msg_id=2620936) for dynamic
> > SQL Maps? I see that as late as November, Clinton said "No decisions
> > have been made yet."
> > (http://www.mail-archive.com/ibatis-user-java@incubator.apache.org/msg00
> > 030.html)
> >
> > Two specific questions:
> > 1. Did Clinton ever create the plug-points for alternate dynamic SQL
> > implementations
> > (http://sourceforge.net/forum/message.php?msg_id=2622001)? If so, did he
> > produce any documentation?
> >
> > 2. Did Brandon ever make any progress/prototypes for an alternate
> > implementation?
> >
> > I've got an itch to scratch re: dynamic SQL syntax, and I was wondering
> > what I could use as a starting point.
> >
> > ----
> > Scott Severtson
> > Centare Group, LLC
> >

View raw message