On 2001.08.17 16:31:43 -0400 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.

Conceivable alternate solution:

Since we are now using resource adapters to wrap the db connections, we
could write resource adapters for each non-compliant db that suitably
rewrites these functions to something the db will accept.  Puts the pain
where it belongs.

Having a db - specific wrapper-rar might make ManagedConnectionFactory
configuration a lot simpler too.
> 
> ==================================================
> 
> 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.
> 

I think which works better is going to depend on what kind of mistakes are
in the particular db's optimizer.  Naively I would expect (A) to be easier
to make fast, but I haven't done comparisons.  Go for (A) and see if anyone
complains and what db.

david jencks
> 


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

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

Reply via email to