I have a problem with HQL-code generated from a joined-subclass. I believe there are a few braces missing. And this makes the DB swap around for hours.
Hibernate version:
3.05
Mapping documents:
Code:
<class name="Entiteit" table="entiteit">
<id name="Id" column="id000" type="long" unsaved-value="-1"> <generator class="increment"/> </id>
<version name="Version" column="ve000" unsaved-value="negative"/>
<property name="Identification" column="a1103" type="string" length="14"/>
<!-- SpecializedEntity part -->
<joined-subclass name="SpecializedEntity" table="specializedentity">
<key column="id117"/>
<property name="Name" column="a1170" type="string" length="80" />
</joined-subclass>
</class>
Name and version of the database you are using:Oracle 9.2
The generated SQL (show_sql=true):When I make an HQL like this:
Code:
from SpecializedEntity where (Name='John' or Name='Pete')
the following SQL is generated:
Code:
select (bunch of fields) from Entity e, SpecializedEntity s
where s.name='John' or s.name='Pete' and s.id117=e.id000
I believe this should be:
Code:
select (bunch of fields) from Entity e, SpecializedEntity s
where (s.name='John' or s.name='Pete')
and s.id117=e.id000
It his a bug, or am I expecting something wrong?