Hibernate version: 3.1
Hello,
We have a setup that used to work fine in Hibernate 3.0, but the behaviour appears to have changed in 3.1 onward, and our code no longer works.
Its a class that has a few bags that each have a where= attribute, to apply a filter on the selection.
Since 3.1, hibernate is modifying this sql to insert (+) after each field, when I execute session merge, to save it. It reterieves the object and bags/sets etc using sql with a single outer join first. In 3.0, it retrieved the object, and its collections each using separate queries, so no outer join.
Now, my where attributes have sql that has an OR in it. And you can't do this in Oracle, you get a 'ORA-01719: outer join operator (+) not allowed in operand of OR or IN' sql error.
For example say Person and Address. Then you might have the following inside your Person hbm, to enable access to a Persons addresses:
<bag name="addresses" where="(isInvalid=0 or isInvalid is null)">
<key column="ID"/>
<one-to-many class="Person"/>
</bag>
Hibernate wrotes the following sql:
select ....
from PERSON person0_, ADDRESS address1_
where person0_.ADDRESSID=address1_.ID and
(address1_.ISINVALID(+)=0 or address1_.ISINVALID(+) is null)
Incidentally, if you try to use a function in the above, such as NVL, you get a Missing Expression SQL error. So it appears the sql inside the where attribute has become more restricted.
Does anyone know anything about this? Is doing this type of thing no longer valid? Am I doing something wrong? Any help would be greatly appreciated.
Thanks in advance.
|