Hi, i run into the following problem with hibernate 3.2 :
i have an set of employees belonging to an department and try to get one of the employees by findByExample()
<class name="Deptartment">
...
<set name="employees">
<key column="deptId" not-null="true"/>
<one-to-many class="Employee" />
</set>
...
</class>
<class name="Employee">
...
</class>
hibnernate findByExample() will include a foreign-key column 'deptId' into the generated sql-query, BUT ONLY if the key-column is set 'not-null=true'. Else it will ignore the column like expected.
Of course this won't work cause there is no 'deptId' property in Employee.
Is there any way keeping hibernate from including that foreign-key-column into the query, or am i missing something fundamental here?
|