Joined: Thu Aug 26, 2004 3:05 am Posts: 4 Location: Austria, Linz
|
It seams to me that hibernate always uses an outer join when fetching a collection!
I have a 1:n relationship and I only want to select these records where records are present in the related table. But I get also the records where no entries are in the related table.
Where do I make a mistake?
Hibernate version: 2.1.6
Mapping documents:
...
<hibernate-mapping schema="handy" package="at.telekom.handy.dto" >
<class name="Delivery" table="delivery">
<id name="id" type="integer" unsaved-value="-1">
<column name="id" sql-type="number" not-null="true" />
<generator class="sequence">
<param name="sequence">Delivery_SEQ</param>
</generator>
</id>
<property name="delivered" column="delivered" />
<property name="deliveringdate" column="deliveringdate" />
<many-to-one name="address" class="Address" column="address_id" />
<set name="deliveryItems" lazy="true" outer-join="false">
<key>
<column name="delivery_id" />
</key>
<one-to-many class="DeliveryItem" />
</set>
<property name="deliverynoteNumber" column="deliverynotenumber" not-null="false"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
...
Query q = session.createQuery("from at.telekom.handy.dto.Delivery d where d.delivered = false ");
return q.list();
...
Name and version of the database you are using:
oracle 8.1.xx
The generated SQL (show_sql=true):
|
|