I would think you would want to use the EXISTS operator for the reason you
specified - portability - as well as I believe that vendors often optimize
it somewhat for performance.

Cheers

-----Original Message-----
From: Dain Sundstrom [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 17, 2001 4:32 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-dev] JDBC SQL Extensions


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.

==================================================

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.




_______________________________________________
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