[snip]
> On the other hand, your proposal is no good either, since
> it does not return green Foos with bar=null. So it seems
> to me like both are imperfect, but existing functionality
> is better, because we can force what we mean by adding
> "distinct".
Ok, I'm happy with the use of "distinct".
> Here is a query in HQL:
> SELECT foo FROM foo IN CLASS Foo
> WHERE foo.color='green' AND (foo.bar=? OR foo.bar.someValue='happy')
>
[snip]
> The generated SQL-Code produces the cartesian product between
> Foo and Bar: SELECT ... FROM Foo foo, Bar sim0 WHERE
> (foo.color='green')AND((foo.barId
Ok, here are some tables.
CREATE TABLE Foo (
id int PRIMARY KEY,
color VARCHAR,
barId int,
FOREIGN KEY (barId) REFERENCES Bar
)
CREATE TABLE Bar (
id int PRIMARY KEY,
someValue VARCHAR
)
In the mapping there is a association between Foo and Bar.
Here is a query in HQL:
SELECT foo F