[Opensource] implementing outer join in MultiDBObject?

Malcolm Wise malcolm.wise at sde.eu.sony.com
Fri Feb 21 01:43:44 PST 2003


Hi Mike,

I did actually implement this in my own code, but in the end didn't use it
because I accomplished the same thing using ValidValues.  I basically added
some setter methods to MultiDBObject along the lines of the setForeignKey()
method - setInnerJoin(String leftShortName, String leftColumn, String
rightShortName, String rightColumn), setLeftJoin(String leftShortName,
String leftColumn, String rightShortName, String rightColumn) and
setRightJoin(String leftShortName, String leftColumn, String rightShortName,
String rightColumn).  The joins are built using ANSI syntax in the FROM
clause, so should be pretty portable (I use Sybase ASE12).  I've only
allowed for '=' in the join, but it shouldn't be a great deal more work to
allow for others (just an extra parameter for the above methods should do
it).  Here's an example of what's produced:

SELECT table1.x, table1.y, table2.z
FROM table1 LEFT JOIN table2 ON table1.a = table2.b

If this seems to fit the bill, I can make the changes in HEAD, or I can send
you the details off-list if you need it sooner
(malcolm.wise at sde.eu.sony.com).

Cheers,
Malc

-----Original Message-----
From: opensource-admin at jcorporate.com
[mailto:opensource-admin at jcorporate.com]On Behalf Of Mike Traum
Sent: 21 February 2003 01:06
To: Expresso Mailing List (E-mail)
Subject: [Opensource] implementing outer join in MultiDBObject?


Something I've been wondering for a while is why outer join's are
implemented in MultiDBObject. The way I see it, it would be quite simple -
just have a setter and then check for that, adding 'OUTER JOIN' ('left' and
'right' if you want to support that) to the where clause. Am I missing
something or should I go for it? (the only thing I could think of is
database incompatibilities, which seems unlikely)

thanks,
mike



*************************************************************************
The information contained in this message or any of its
attachments may be privileged and confidential and intended 
for the exclusive use of the addressee. If you are not the
addressee any disclosure, reproduction, distribution or other
dissemination or use of this communication is strictly prohibited
*************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.jcorporate.com/pipermail/opensource/attachments/20030221/6237c6d6/attachment-0002.htm


More information about the Opensource mailing list