Joined: Fri May 20, 2005 9:48 am Posts: 2
|
Hibernate version: 3.0.3
Mapping documents:
<hibernate-mapping>
<class name="LoginVO" table="LOGIN">
...
<many-to-one name="record1" not-found="ignore" class="MyClass">
<column name="COL1"/>
</many-to-one>
<many-to-one name="record2" not-found="ignore" class="MyClass">
<column name="COL2"/>
</many-to-one>
...
</hibernate-mapping>
Name and version of the database:
Oracle 9i
We have a Hibernate Query which looks like this:
SELECT count(logT.*) FROM LoginVO logT WHERE
logT.record1 is not null AND logT.record1.name = 'foo';
And this query works fine ( returns 1 ).
But if we extend this query to this:
SELECT count(logT.*) FROM LoginVO logT WHERE
(logT.record1 is not null AND logT.record1.name = 'foo')
OR (logT.record2 is not null AND logT.record2.name = 'foo')
When we run this query and record2 is null it returns 0 (without any errors), if it's not null it returns 1.
Is this a known bug of not-found="ignore" or is it deliberate and we are just missing something?
Thanks for any insight in this matter
Darek
|
|