I just committed the initial revision of the EJB-QL to SQL translation
engine. All you need to do to use the engine is get the new code and add
you EJB-QL query to the ejb-jar.xml file. There are some several
restrictions:
1) This only works for finders. ejbSelect methods are not implemented yet.
2) There is ZERO error handling. If you query is bad, you will get a generic
exception.
3) Functions are mapped to {fn concat(str1, str2)} style functions. If you
are using Oracle, functions will not work for you.
4) The IS EMPTY operator is mapped to an EXISTS operator. If you are using
MySQL or mSQL, you can't use the IS EMPTY clause.
5) The algorithm that generates aliases for the tables is barely functional.
It can easily generate you an aliases that is a reserved word or already
used.
6) The code sucks. About half way through writing this section, I decided
that I had no idea what the final code would look like, so I gave up on
logically organizing the code. The engine needs a couple of rewrites.
7) Most exceptions are caused by a bad EJB-QL query. If you get an
exception, check the query, and if you still think it is OK, check the
EJB-QL BNF. EJB-QL syntax is very restrictive for example:
p.name = 'Name' is legal
'Name' = p.name is not legal
'Name' = 'Name' is not legal
If you are still sure it is broken, send me the query.
Enough said. Have fun.
-dain
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development