Why would it not use an IN clause?
SELECT DISTINCT *
FROM ISSUE A0 INNER JOIN KEYWORD A1 ON A0.ID=A1.OID
WHERE A1.VALUE IN ('OJB', 'join', 'alias')
Wally
-----Original Message-----
From: Janssen, Roger [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 10:55 AM
To: OJB Users List (E-mail)
Subject: How to use multiple aliases for one class/table in query
Hi,
I posed this question earlier but i haven't seen any response yet. I'll
try it again, a bit different this time.
Suppose i have an application registering issues, and in which i can
assign keywords to issues. The keywords are stored in a different table
(with a fk-relation to the related issue).
OJB could automatically load the related keywords when fethcing the
issue.
So far, so good.
Now i would like to retrieve all issues that have the following
keywords; 'OJB', 'join' and 'alias'.
The generated query should be something like this:
SELECT DISTINCT *
FROM ISSUE A0 INNER JOIN KEYWORD A1 ON A0.ID=A1.OID
INNER JOIN KEYWORD A2 ON A0.ID=A2.OID
INNER JOIN KEYWORD A3 ON A0.ID=A3.OID
INNER JOIN KEYWORD A4 ON A0.ID=A4.OID WHERE (
A1.VALUE= 'OJB' ) AND ( A2.NAME = 'join' ) AND (A3.VALUE = 'alias' )
Using the PB API, and the query/criteria classes, how can i get this
query to be generated and executed?
I do not think this is some weird use-case? I know the OJB OQL does not
support 'alias'-ing (according to documentation en some experiments i
have
done) so ODMG api is no option (i also don't want to use it). PB api
supports 'alias'-ing but i can not seem to get OJB to generate multiple
aliases in one query for the same objectclass/table.
What am i missing?
Roger Janssen <mailto:[EMAIL PROTECTED]>
mailto:[EMAIL PROTECTED]
iBanx B.V <http://www.ibanx.nl/> http://www.ibanx.nl
************************************************************************
*
The information contained in this communication is confidential and is
intended solely for the use of the individual or entity to whom it is
addressed.You should not copy, disclose or distribute this communication
without the authority of iBanx bv. iBanx bv is neither liable for
the proper and complete transmission of the information has been
maintained nor that the communication is free of viruses, interceptions
or interference.
If you are not the intended recipient of this communication please
return the communication to the sender and delete and destroy all
copies.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]