Hibernate version:
3.1b1
Sybase ASE doesn't support the syntax
where (c1,c2) in (select v1, v2 ...)
This is generated for composite keys in bidi one-to-many
when fetch="subselect" is set.
Isn't that a typical case where the dialect should drive how the query
is being built?
I'd conjecture that the following are equivalent:
1)
select * from T1 where c11,c12 in (select c21,c22 from T2 where clause2 )
2)
select * from T1, T2
where ( clause2 )
and T1.c11=T2.c21
and T1.c21=T2.c22
[ technically the 2nd is not a subselect, but at least it will work for Sybase...]
In fact I'd prefer the 2) form and leave it to the optimizer to figure out
the details.
Hasn't this been adressed before?
Thx!
----------
OT: I realize that I can fetch="join", but there I'm running into
1+N queries.
|