Dain Sundstrom wrote:
> Sorry for the confusion. There are two issues here.
> 
> ==================================================
> 
> Issue1: use of the {fn concat(str1, str2)} style functions.
> 
> Solution: use fn style functions as default but have override in xml like:
>         <concat-function>CONCAT (?1, ?2)</concat-function>
> or some thing simmilar.
> 
> ==================================================
> 

Since I have only used the PostgreSQL driver hard to say how other 
vendors JDBC drivers are but have heard lots of comments about Oracle 
.... I would suggest you try and code to the lowest JDBC version and 
wrap up the strange bits in the xml (more jaws stuff). For example in 
Postgresql, concat is || so ..
<concat-function>?1 || ?2</concat-function>
Looks like the way to go ... (Dam more work!)



> Issue 2: IS EMPTY function. How should I map the following ejb-ql query:
> 
> SELECT OBJECT(o)
> FROM Order o
> WHERE o.lineItems IS  EMPTY
> 
> Solution A:
> 
> SELECT o.ordernumber
> FROM Order o
> WHERE NOT EXISTS (
>         SELECT l.pk
>         FROM Order o, LineItem l
>         WHERE o.ordernumber = l.ordernumber)
> 
> I like this because it does not use an outer join (thanks Dave Smith). Does
> it have performance problems?
> 
> Solution B:
> 
> SELECT o.ordernumber
> FROM Order o LEFT OUTER JOIN LineItem l ON o.ordernumber = l.ordernumber
> WHERE l.ordernumber IS NULL
> 
> This would be a major pain to map to all vendors.
> 
> 

Either way the query will have to read the entire order file to check 
the lineitems . I would get it working first then optimize, might be 
there but not offen used.


_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to