I have a many-to-one association set up like this, in the hbm.xml:
<many-to-one name="gigVenue"
class="blah.blah.xxx" fetch="select"
lazy="no-proxy" not-null="true" >
<column name="N_VENUE_ID" precision="18" scale="0" not-null="true" />
</many-to-one>
And I am using instrumentation to do true lazy loading.
BUT when I run a hql query with an inner join fetch to the other table, the property that should contain the object that is the other table's value, is left as null. Even though I can see the other table's value's object being created by hibernate.
Does anyone have any insight into this problem?
update:
from Gig g inner join fetch g.gigVenue gv where g.artistId = :artistId and (g.territoryId = -1 or g.territoryId = :territoryId) order by g.gigDatetime desc
<set name="gigs" inverse="true" lazy="true" table="DSP_GIG" fetch="select">
<key>
<column name="N_VENUE_ID" precision="18" scale="0" not-null="true" />
</key>
<one-to-many class="blah.blah.Gig" />
</set>