Hibernate version: 2.1
Mapping documents:
...
<subclass
name="mypackage.TLine"
proxy="mypackage.TLine"
discriminator-value="P">
<many-to-one name="myObjectRef" column="MY_OBJECT_ID" class="mypackage.MyObject"/>
</subclass>
Name and version of the database you are using: Oracle 9
So, I have an instance of TLine class, which does refer to an instance of MyObject class. At the same time, MyObject may exist without TLine referring to it. In MyObject's mapping there is nothing about TLine.
There is a group of two MyObjects, one of which has a TLine associated with it and another does not have. The group has its own unique id.
The following HQL query will return me data about two MyObject instances:
Code:
select do.key
from MyObject do
where do.group.key = 51885
The following query returns me data regarding the only MyObject, which has a TLine:
Code:
select do.key
from TLine line
right join line.myObjectRef do,
where do.group.key = 51885
Why? I use an outer join here...
Thanks in advance!