db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <minf...@sharp.fm>
Subject Re: Torque LEFT JOIN with multiple clauses
Date Mon, 04 Jun 2012 12:50:08 GMT
On 02 Jun 2012, at 4:52 PM, Thomas Fox wrote:

> No, they aren't. The curren implementation is you can use one condition but
> choose the operator.
> If you want to create a patch for this, I'd advocate to use a
> org.apache.torque.criteria.Criterion to hold the join clause  for the most
> general approach.
> You can look at the TORQUE-7 svn commit log to see the places to modify
> (unfortunately, some Torque.properties were modified  inadvertently in this
> commit, please ignore those). You can probably use the
> org.apache.torque.sql.SqlBuilder.appendCriterion(Criterion, Criteria, DB,
> StringBuilder, Database, Query) method for SQL generation for the
> Criterion.

The attached patch is what I came up with so far.

As it ultimately turned out, my query eventually didn't need the join clause, so I haven't
developed this further. Ideally it should be possible to support nested selects in the join
clause as well, but I didn't get a chance to dig how to do that.

This however was what I started with, which gives you a criterion to use:

View raw message