Joined: Fri Oct 22, 2004 11:18 am Posts: 9 Location: Lexington, KY
|
Hibernate version:
2.1.7
Mapping documents:
In the parent class called Unit I have the following assoc defined:
<one-to-one constrained="true" outer-join="false" name="unitAccounting" class="UnitAccounting" property-ref="unit"/>
The child class UnitAccounting is defined as follows:
<class name="UnitAccounting" table="UnitAccounting" lazy="true">
...
<many-to-one name="unit" class="Unit" not-null="true" column="birthMark" index="Idx_Fk_unit"/>
Code between sessionFactory.openSession() and session.close():
Executing a simple query against the Parent (Unit) always results in two queries, one against the parent Unit table and one against the UnitAccounting table. My expectation is that with constrained = true, fetching a Unit will result in a proxy for the UnitAccounting. I'm executing the following HQL query to test (in hibern8ide):
session.createQuery("from Unit").list();
I have read the FAQ and thought I had everything correct. Am I missing something?
|
|