Hi,
I have a mapping file that seems to be generating inner joins (oracle and oracle9 dialect) and I can't figure out why and as a result I'm getting an artificially restricted result set
Can anyone point out why this is happening? - I thought the fetch="select" would override this - I've tried setting fetch mode on the criteria object to select and it has no effect?
Any help much appreciated
Richard
Hibernate version: 1.2
Mapping documents:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="BCM3.Businessentities" namespace="Northgate.LandProperty.BCM3.BusinessEntities">
<class name="BCApplication" table="BCAPPLICATION">
<cache usage="read-write"/>
<id name="UniqueId" column="REFERENCE">
<generator class="sequence">
<param name="sequence">BCAPPLICATION_SQ</param>
</generator>
</id>
<property name="ReferenceNumber" column="APPLICATION_NUMBER" type="AnsiString"/>
<property name="CreatedDate" column="CREATE_DATE"/>
<property name="CreatedBy" column="CREATE_BY" type="AnsiString"/>
<bag name="SiteVisits" lazy="false" fetch="subselect">
<key column="BCA_REFERENCE"/>
<one-to-many class="SiteVisit"/>
</bag>
<bag name="Phases" lazy="false" fetch="subselect" >
<key column="BCA_REFERENCE"/>
<one-to-many class="BCApplicationPhase"/>
</bag>
<one-to-one name="SiteDetail" class="BCApplicationSiteDetail" fetch="select" lazy="false"/>
<one-to-one name="Site" class="BCApplicationSite" property-ref="ApplicationUniqueId" fetch="select" lazy="false"/>
<one-to-one name="Owner" class="Owner" property-ref="ApplicationUniqueId" fetch="select" lazy="false"/>
<one-to-one name="Agent" class="Agent" property-ref="ApplicationUniqueId" fetch="select" lazy="false"/>
<property name="SiteAddress" column="SITE_ADDRESS" type="AnsiString"/>
<property name="Description" column="DEVELOPMENT_DESCRIPTION" type="AnsiString"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
DEBUG NHibernate.SQL - SELECT this_.REFERENCE as REFERENCE38_1_, this_.APPLICATION_NUMBER as APPLICAT2_38_1_, this_.CREATE_DATE as CREATE3_38_1_, this_.CREATE_BY as CREATE4_38_1_, this_.SITE_ADDRESS as SITE5_38_1_, this_.DEVELOPMENT_DESCRIPTION as DEVELOPM6_38_1_, sitevisit1_.COUNTER as COUNTER39_0_, sitevisit1_.BCA_REFERENCE as BCA2_39_0_, sitevisit1_.CREATE_DATE as CREATE3_39_0_, sitevisit1_.CREATE_BY as CREATE4_39_0_, sitevisit1_.SCHEDULED_DATETIME as SCHEDULED5_39_0_, sitevisit1_.SCHEDULED_DURATION as SCHEDULED6_39_0_, sitevisit1_.ACTUAL_DATETIME as ACTUAL7_39_0_, sitevisit1_.ACTUAL_DURATION as ACTUAL8_39_0_, sitevisit1_.OFFICER_CODE as OFFICER9_39_0_, sitevisit1_.DIARY_REFERENCE as DIARY10_39_0_, sitevisit1_.TEAM_CODE as TEAM11_39_0_, sitevisit1_.EFFECT_DATE as EFFECT12_39_0_, sitevisit1_.REQUESTED_DATETIME as REQUESTED13_39_0_, sitevisit1_.NOTES as NOTES39_0_, sitevisit1_.OFFICE_TIME as OFFICE15_39_0_, sitevisit1_.TRAVEL_TIME as TRAVEL16_39_0_, sitevisit1_.MILEAGE as MILEAGE39_0_, sitevisit1_.TOTAL_COST as TOTAL18_39_0_ FROM BCAPPLICATION this_ inner join BCSITE_VISIT sitevisit1_ on this_.REFERENCE=sitevisit1_.BCA_REFERENCE WHERE this_.REFERENCE in (:p0, :p1); :p0 = '756', :p1 = '757'
|