As long as the old styles is there.

sqlmap.xml is something that I see as accessed by sql experts, dba, etc.
They do not know EL, but thy know greater than, etc.

(ps: I will post a 3.0 wish list: remote DAO, jxm, named map dispatch, soft Hashmap cache, async exec, jdo like methods, etc. - of course, w/ soure code :-) - when I get a minute)

.V

Brandon Goodin wrote:

Hey all,

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

First off, I believe that after this change we should make the version
IBatis 2.1 and force a choice between using the old dyna sql and the
new dynasql.

Currently we have the following tags:

Binary:

<isEqual>;<isNotEqual>;<isGreaterThan>;<isGreaterEqual>;<isLessThan>;<isLessEqual>

<isPropertyAvailable>;<isNotPropertyAvailable>;<isNull>;<isNotNull>;<isEmpty>;<isNotEmpty>

Other

<isParameterPresent>;<isNotParameterPresent>


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

<choose>  - for mulitple conditionals. used in conjunction with when
and otherwise.
attributes: none

<when> attributes: prepend, test, *postpend

<otherwise>
attributes: prepend, *postpend



<if> - for single conditionals
Attributes: prepend, test, *postpend



<foreach> - for iterating over arrays. Also, i was thinking we can
place a test attribute on this to gain a for loop [for(x=0; x<y; x++)]
effect.
attributes:
test
begin
end
item
step
open
close
conjuction
prepend
*postpend



*<while> - for looping a "do while" condition.
attributes:
test
open
close
conjuction
prepend
*postpend

* = not certain this needs to be included. But, i figured i'd throw it
in for discussion.



Because we need a good EL that is not overkill or confined I thought
that JEXL was a nice middle ground. They don't go as deep as OGNL and
aren't confined to JSP like Commons EL. JEXL uses JavaCC, so i don't
think we'll have any speed issues. It seems well constructued.
However, it is poorly documented. So, we'd have to document it in
IBatis docs. I would certainly like to hear your guys thoughts on it.
Some other nice features is that JEXL has the ability to access
methods on an object. This could be handy considering we will be
adding this functionality in the future to other areas of IBatis
SQLMaps (i.e. parameter maps and result maps).

Our other option is to simply rip what we like and ditch the rest. It
doesn't look too difficult to write a parser with JavaCC, ANTLR, or
SableCC(?). Here is an article that reviews a couple parsers.

http://www.beust.com/weblog/archives/000145.html

Here are some parser sites:

SableCC - http://sablecc.org/

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."

JavaCC - https://javacc.dev.java.net/

Anyway, i wanted to get the prelimary discussion going on this and
then get something written that fills the need better that our current
solution.

Brandon






--
RiA-SoA w/JDNC <http://www.SandraSF.com> forums
- help develop a community
My blog <http://www.sandrasf.com/adminBlog>

Reply via email to