Improved Dynamic SQL Whiteboard

This is a collaborative development space to discuss the future of dynamic SQL in iBATIS SQL Mapping files. This is a key feature of iBATIS that gives it great power. The current implementation has some limitations that we'd like to resolve by introducing a new and improved Dynamic SQL syntax. This page represents the current state of the decisions and future design.

What are the existing problems/limitations?

Which new syntax do we want to support?

How do we ensure consistency accross the Java and .NET versions?

Brandon's Proposal

Introducing pluggable scripting languages into the ibatis mix will not provide anything but needless complexity. My feeling is that we need to settle on a scoped EL implementation and make our xml simpler. Following is a recommendation i posted to the developer's list:

I did a little more research on where we can take dyna sql and here is a short proposal.

<isEqual>;<isNotEqual>;<isGreaterThan>;<isGreaterEqual>;<isLessThan>;<isLessEqual> <isPropertyAvailable>;<isNotPropertyAvailable>;<isNull>;<isNotNull>;<isEmpty>;<isNotEmpty> <isParameterPresent>;<isNotParameterPresent>

These could be condensed down to a simpler set of tags:

In light of making this cross platform it may a good idea to use JEXL as a reference point and implement our own el with ANTLR.

The EL should be simple and used for value extraction, boolean tests, and math. It should not have control structure syntax like for, if, while.

ANTLR - http://www.antlr.org/ -- ANTLR looks to be the most popular and cross-language (for our C# friends). A quote from the ANTLR website - "ANTLR currently generates Java, C#, and C++. A prototype Python generator is almost ready."

Improved_Dynamic_SQL_Whiteboard (last edited 2009-09-20 22:57:09 by localhost)