Dave Smith wrote:
> 3. Dynamic where clause
> Prompting the user for a search criteria and returning a result set
> based on those criteria. Also would be handy to have cursors/limit.
>
> [snip]
> For 1,3,4 I would propose that we add a special jboss function into the
> QL, something like jboss_sql_inline() and what is between the brackets
> is just passed through to the sql engine. Arguments could be passed
> through to parts of the code with ??1 etc, sort of an escaped argument.
> So you could have
>
> select object(o) from foo o where o.id=?1 and
> jboss_sql_inline(datefunc(datefield) = ??2)
>
> Comments?
>
Are you attempting to reuse parameterized statements here? If so, there's a
better technique which is spec compliant. Have the persistence engine parse
the query and generate a parameterized sql expression. Then compare this
expression with existing parsed queries in the cache. Simple hashtable lookup
will work here. If there's a match, use the existing statement. Otherwise
generate a new statement and add it to the cache.
--Victor Langelo
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development