-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Self Reference in Many-to-one
PostPosted: Tue Jan 27, 2009 5:15 am 
Newbie

Joined: Tue Jan 27, 2009 4:50 am
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

2.0.0.4000

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">

<class name="Core.Modules.Inventory.DomainModel.STORE, Core" table="STORE " batch-size="16" lazy="false" >

<id name="_storecode" column="STORECODE" access="field">
<generator class="assigned" />
</id>

<property name="_isdeleted" column="ISDELETED" access="field"/>


<many-to-one name="_dispensingflowtypenum" access="field" class="Core.Modules.GeneralMaster.GeneralModules.DomainModel.SystemTypeLookUp, Core" cascade="none" column="DISPENSINGFLOWTYPENUM" not-found="ignore" lazy="false" fetch="join" />


<property name="_isactive" column="ISACTIVE" access="field"/>
<property name="_isbinned" column="ISBINNED" access="field"/>
<property name="_createdby" column="CREATEDBY" access="field"/>
<property name="_createddatetime" column="CREATEDDATETIME" access="field"/>
<property name="_updatedby" column="UPDATEDBY" access="field"/>
<property name="_updateddatetime" column="UPDATEDDATETIME" access="field"/>

<property name="_storedesc" column="STOREDESC" access="field"/>
<many-to-one name="_storecategorytypenum" access="field" class="Core.Modules.GeneralMaster.GeneralModules.DomainModel.SystemTypeLookUp, Core" cascade="none" column="STORECATEGORYTYPENUM" not-found="ignore" lazy="false" fetch="join" outer-join="true" />
<many-to-one name="_locationcode" access="field" class="Core.Modules.GeneralMaster.GeneralModules.DomainModel.Locations, Core" cascade="none" column="LOCATIONCODE" not-found="ignore" lazy="false" fetch="join" />





<property name="_allowin" column="ALLOWIN" access="field"/>
<property name="_allowout" column="ALLOWOUT" access="field"/>
<property name="_isgroup" column="ISGROUP" access="field"/>
<property name="_width" column="WIDTH" access="field"/>
<property name="_length" column="LENGTH" access="field"/>
<property name="_height" column="HEIGHT" access="field"/>
<many-to-one name="_dimensionuomcode" access="field" class="Core.Modules.GeneralMaster.GeneralModules.DomainModel.UOM, Core" cascade="none" column="DIMENSIONUOMCODE" not-found="ignore" lazy="false" fetch="join" />
<many-to-one name="_storetypenum" access="field" class="Core.Modules.GeneralMaster.GeneralModules.DomainModel.SystemTypeLookUp, Core" fetch="join" cascade="none" column="STORETYPENUM" not-found="ignore" lazy="false" outer-join="true" />
<many-to-one name="_storestatustypenum" access="field" class="Core.Modules.GeneralMaster.GeneralModules.DomainModel.SystemTypeLookUp, Core" cascade="none" column="STORESTATUSTYPENUM" not-found="ignore" lazy="false" fetch="join" outer-join="true" />
<many-to-one name="_binstorecode" access="field" class="Core.Modules.Inventory.DomainModel.STORE, Core" cascade="none" fetch="join" outer-join="true" column="BINSTORECODE" not-found="ignore" lazy="false" />


<property name="_remarks" column="REMARKS" access="field"/>



<bag name="StorageConditionDetails" table="STORESTORAGECONDITIONS" collection-type="Core.HelperClasses.CustomCollections.ObservableList`1[[Core.Modules.Inventory.DomainModel.STORAGECONDITIONS, Core]], Core" lazy="false" fetch="join">
<key column="storecode" />
<many-to-many class="Core.Modules.Inventory.DomainModel.STORAGECONDITIONS, Core" column="Storageconditioncode" fetch="join"/>
</bag>

<bag name="StorageServingLocationsDetails" table="STORESERVINGLOCATIONS" collection-type="Core.HelperClasses.CustomCollections.ObservableList`1[[Core.Modules.GeneralMaster.GeneralModules.DomainModel.Locations, Core]], Core" lazy="false" fetch="join" >
<key column="storecode" />

<many-to-many class="Core.Modules.GeneralMaster.GeneralModules.DomainModel.Locations, Core" column="SERVINGLOCATIONCODE" fetch="join" lazy="false" />
</bag>

<bag name="_contactdetails" inverse="true" lazy="false" cascade="all" access="field" collection-type="Core.HelperClasses.CustomCollections.ObservableList`1[[Core.Modules.Inventory.DomainModel.STORECONTACTDETAILS, Core]], Core" fetch="join">
<key column="STORECODE" />
<one-to-many class="Core.Modules.Inventory.DomainModel.STORECONTACTDETAILS, Core" />
</bag>




</class>

</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Oracle 10g

SELECT this_.STORECODE as STORECODE25_20_, this_.ISDELETED as ISDELETED25_20_, this_.DISPENSINGFLOWTYPENUM as DISPENSI3_25_20_, this_.ISACTIVE as ISACTIVE25_20_, this_.ISBINNED as ISBINNED25_20_, this_.CREATEDBY as CREATEDBY25_20_, this_.CREATEDDATETIME as CREATEDD7_25_20_, this_.UPDATEDBY as UPDATEDBY25_20_, this_.UPDATEDDATETIME as UPDATEDD9_25_20_, this_.STOREDESC as STOREDESC25_20_, this_.STORECATEGORYTYPENUM as STORECA11_25_20_, this_.LOCATIONCODE as LOCATIO12_25_20_, this_.ALLOWIN as ALLOWIN25_20_, this_.ALLOWOUT as ALLOWOUT25_20_, this_.ISGROUP as ISGROUP25_20_, this_.WIDTH as WIDTH25_20_, this_.LENGTH as LENGTH25_20_, this_.HEIGHT as HEIGHT25_20_, this_.DIMENSIONUOMCODE as DIMENSI19_25_20_, this_.STORETYPENUM as STORETY20_25_20_, this_.STORESTATUSTYPENUM as STOREST21_25_20_, this_.BINSTORECODE as BINSTOR22_25_20_, this_.REMARKS as REMARKS25_20_, systemtype5_.IDSLNO as IDSLNO15_0_, systemtype5_.TYPENUM as TYPENUM15_0_, systemtype5_.GROUPNUM as GROUPNUM15_0_, systemtype5_.ISDELETED as ISDELETED15_0_, systemtype5_.TYPEDESC as TYPEDESC15_0_, systemtype5_.ISACTIVE as ISACTIVE15_0_, systemtype5_.CREATEDBY as CREATEDBY15_0_, systemtype5_.CREATEDDATETIME as CREATEDD8_15_0_, systemtype5_.UPDATEDBY as UPDATEDBY15_0_, systemtype5_.UPDATEDDATETIME as UPDATED10_15_0_, systemtype6_.IDSLNO as IDSLNO15_1_, systemtype6_.TYPENUM as TYPENUM15_1_, systemtype6_.GROUPNUM as GROUPNUM15_1_, systemtype6_.ISDELETED as ISDELETED15_1_, systemtype6_.TYPEDESC as TYPEDESC15_1_, systemtype6_.ISACTIVE as ISACTIVE15_1_, systemtype6_.CREATEDBY as CREATEDBY15_1_, systemtype6_.CREATEDDATETIME as CREATEDD8_15_1_, systemtype6_.UPDATEDBY as UPDATEDBY15_1_, systemtype6_.UPDATEDDATETIME as UPDATED10_15_1_, locations7_.LOCATIONCODE as LOCATION1_30_2_, locations7_.LOCATIONNAME as LOCATION2_30_2_, locations7_.LOCATIONPARENTCODE as LOCATION3_30_2_, locations7_.LOCATIONTYPECODE as LOCATION4_30_2_, locations7_.COMMENTS as COMMENTS30_2_, locations7_.ISACTIVE as ISACTIVE30_2_, locations7_.CREATEDBY as CREATEDBY30_2_, locations7_.CREATEDDATETIME as CREATEDD8_30_2_, locations7_.UPDATEDBY as UPDATEDBY30_2_, locations7_.UPDATEDDATETIME as UPDATED10_30_2_, locations7_.ISDELETED as ISDELETED30_2_, uom8_.UOMCODE as UOMCODE29_3_, uom8_.ISDELETED as ISDELETED29_3_, uom8_.UOMNAME as UOMNAME29_3_, uom8_.UOMUNITS as UOMUNITS29_3_, uom8_.ISDERIVED as ISDERIVED29_3_, uom8_.BASEUOMCODE as BASEUOMC6_29_3_, uom8_.ISACTIVE as ISACTIVE29_3_, uom8_.NOOFDECIMALPLACES as NOOFDECI8_29_3_, uom8_.CREATEDBY as CREATEDBY29_3_, uom8_.CREATEDDATETIME as CREATED10_29_3_, uom8_.UPDATEDBY as UPDATEDBY29_3_, uom8_.UPDATEDDATETIME as UPDATED12_29_3_, uom9_.UOMCODE as UOMCODE29_4_, uom9_.ISDELETED as ISDELETED29_4_, uom9_.UOMNAME as UOMNAME29_4_, uom9_.UOMUNITS as UOMUNITS29_4_, uom9_.ISDERIVED as ISDERIVED29_4_, uom9_.BASEUOMCODE as BASEUOMC6_29_4_, uom9_.ISACTIVE as ISACTIVE29_4_, uom9_.NOOFDECIMALPLACES as NOOFDECI8_29_4_, uom9_.CREATEDBY as CREATEDBY29_4_, uom9_.CREATEDDATETIME as CREATED10_29_4_, uom9_.UPDATEDBY as UPDATEDBY29_4_, uom9_.UPDATEDDATETIME as UPDATED12_29_4_, storetype1_.IDSLNO as IDSLNO15_5_, storetype1_.TYPENUM as TYPENUM15_5_, storetype1_.GROUPNUM as GROUPNUM15_5_, storetype1_.ISDELETED as ISDELETED15_5_, storetype1_.TYPEDESC as TYPEDESC15_5_, storetype1_.ISACTIVE as ISACTIVE15_5_, storetype1_.CREATEDBY as CREATEDBY15_5_, storetype1_.CREATEDDATETIME as CREATEDD8_15_5_, storetype1_.UPDATEDBY as UPDATEDBY15_5_, storetype1_.UPDATEDDATETIME as UPDATED10_15_5_, status2_.IDSLNO as IDSLNO15_6_, status2_.TYPENUM as TYPENUM15_6_, status2_.GROUPNUM as GROUPNUM15_6_, status2_.ISDELETED as ISDELETED15_6_, status2_.TYPEDESC as TYPEDESC15_6_, status2_.ISACTIVE as ISACTIVE15_6_, status2_.CREATEDBY as CREATEDBY15_6_, status2_.CREATEDDATETIME as CREATEDD8_15_6_, status2_.UPDATEDBY as UPDATEDBY15_6_, status2_.UPDATEDDATETIME as UPDATED10_15_6_, binstoreco3_.STORECODE as STORECODE25_7_, binstoreco3_.ISDELETED as ISDELETED25_7_, binstoreco3_.DISPENSINGFLOWTYPENUM as DISPENSI3_25_7_, binstoreco3_.ISACTIVE as ISACTIVE25_7_, binstoreco3_.ISBINNED as ISBINNED25_7_, binstoreco3_.CREATEDBY as CREATEDBY25_7_, binstoreco3_.CREATEDDATETIME as CREATEDD7_25_7_, binstoreco3_.UPDATEDBY as UPDATEDBY25_7_, binstoreco3_.UPDATEDDATETIME as UPDATEDD9_25_7_, binstoreco3_.STOREDESC as STOREDESC25_7_, binstoreco3_.STORECATEGORYTYPENUM as STORECA11_25_7_, binstoreco3_.LOCATIONCODE as LOCATIO12_25_7_, binstoreco3_.ALLOWIN as ALLOWIN25_7_, binstoreco3_.ALLOWOUT as ALLOWOUT25_7_, binstoreco3_.ISGROUP as ISGROUP25_7_, binstoreco3_.WIDTH as WIDTH25_7_, binstoreco3_.LENGTH as LENGTH25_7_, binstoreco3_.HEIGHT as HEIGHT25_7_, binstoreco3_.DIMENSIONUOMCODE as DIMENSI19_25_7_, binstoreco3_.STORETYPENUM as STORETY20_25_7_, binstoreco3_.STORESTATUSTYPENUM as STOREST21_25_7_, binstoreco3_.BINSTORECODE as BINSTOR22_25_7_, binstoreco3_.REMARKS as REMARKS25_7_, systemtype13_.IDSLNO as IDSLNO15_8_, systemtype13_.TYPENUM as TYPENUM15_8_, systemtype13_.GROUPNUM as GROUPNUM15_8_, systemtype13_.ISDELETED as ISDELETED15_8_, systemtype13_.TYPEDESC as TYPEDESC15_8_, systemtype13_.ISACTIVE as ISACTIVE15_8_, systemtype13_.CREATEDBY as CREATEDBY15_8_, systemtype13_.CREATEDDATETIME as CREATEDD8_15_8_, systemtype13_.UPDATEDBY as UPDATEDBY15_8_, systemtype13_.UPDATEDDATETIME as UPDATED10_15_8_, systemtype14_.IDSLNO as IDSLNO15_9_, systemtype14_.TYPENUM as TYPENUM15_9_, systemtype14_.GROUPNUM as GROUPNUM15_9_, systemtype14_.ISDELETED as ISDELETED15_9_, systemtype14_.TYPEDESC as TYPEDESC15_9_, systemtype14_.ISACTIVE as ISACTIVE15_9_, systemtype14_.CREATEDBY as CREATEDBY15_9_, systemtype14_.CREATEDDATETIME as CREATEDD8_15_9_, systemtype14_.UPDATEDBY as UPDATEDBY15_9_, systemtype14_.UPDATEDDATETIME as UPDATED10_15_9_, store15_.STORECODE as STORECODE25_10_, store15_.ISDELETED as ISDELETED25_10_, store15_.DISPENSINGFLOWTYPENUM as DISPENSI3_25_10_, store15_.ISACTIVE as ISACTIVE25_10_, store15_.ISBINNED as ISBINNED25_10_, store15_.CREATEDBY as CREATEDBY25_10_, store15_.CREATEDDATETIME as CREATEDD7_25_10_, store15_.UPDATEDBY as UPDATEDBY25_10_, store15_.UPDATEDDATETIME as UPDATEDD9_25_10_, store15_.STOREDESC as STOREDESC25_10_, store15_.STORECATEGORYTYPENUM as STORECA11_25_10_, store15_.LOCATIONCODE as LOCATIO12_25_10_, store15_.ALLOWIN as ALLOWIN25_10_, store15_.ALLOWOUT as ALLOWOUT25_10_, store15_.ISGROUP as ISGROUP25_10_, store15_.WIDTH as WIDTH25_10_, store15_.LENGTH as LENGTH25_10_, store15_.HEIGHT as HEIGHT25_10_, store15_.DIMENSIONUOMCODE as DIMENSI19_25_10_, store15_.STORETYPENUM as STORETY20_25_10_, store15_.STORESTATUSTYPENUM as STOREST21_25_10_, store15_.BINSTORECODE as BINSTOR22_25_10_, store15_.REMARKS as REMARKS25_10_, storagecon16_.storecode as storecode22_, storagecon17_.STORAGECONDITIONCODE as Storagec2_22_, storagecon17_.STORAGECONDITIONCODE as STORAGEC1_23_11_, storagecon17_.ISDELETED as ISDELETED23_11_, storagecon17_.STORAGECONDITIONDESC as STORAGEC3_23_11_, storagecon17_.SPECIALINSTRUCTIONS as SPECIALI4_23_11_, storagecon17_.ISACTIVE as ISACTIVE23_11_, storagecon17_.REMARKS as REMARKS23_11_, storagecon17_.CREATEDBY as CREATEDBY23_11_, storagecon17_.CREATEDDATETIME as CREATEDD8_23_11_, storagecon17_.UPDATEDBY as UPDATEDBY23_11_, storagecon17_.UPDATEDDATETIME as UPDATED10_23_11_, storageser18_.storecode as storecode23_, locations19_.LOCATIONCODE as SERVINGL2_23_, locations19_.LOCATIONCODE as LOCATION1_30_12_, locations19_.LOCATIONNAME as LOCATION2_30_12_, locations19_.LOCATIONPARENTCODE as LOCATION3_30_12_, locations19_.LOCATIONTYPECODE as LOCATION4_30_12_, locations19_.COMMENTS as COMMENTS30_12_, locations19_.ISACTIVE as ISACTIVE30_12_, locations19_.CREATEDBY as CREATEDBY30_12_, locations19_.CREATEDDATETIME as CREATEDD8_30_12_, locations19_.UPDATEDBY as UPDATEDBY30_12_, locations19_.UPDATEDDATETIME as UPDATED10_30_12_, locations19_.ISDELETED as ISDELETED30_12_, contactde20_.STORECODE as STORECODE24_, contactde20_.CONTACTID as CONTACTID24_, contactde20_.CONTACTID as CONTACTID24_13_, contactde20_.STORECODE as STORECODE24_13_, contactde20_.FIRSTNAME as FIRSTNAME24_13_, contactde20_.MIDDLENAME as MIDDLENAME24_13_, contactde20_.LASTNAME as LASTNAME24_13_, contactde20_.CITY as CITY24_13_, contactde20_.ZIP as ZIP24_13_, contactde20_.STATE as STATE24_13_, contactde20_.COUNTRY as COUNTRY24_13_, contactde20_.PHONE1 as PHONE10_24_13_, contactde20_.PHONE2 as PHONE11_24_13_, contactde20_.FAX as FAX24_13_, contactde20_.EMAIL as EMAIL24_13_, contactde20_.ISACTIVE as ISACTIVE24_13_, contactde20_.ADDRESS1 as ADDRESS15_24_13_, contactde20_.MOBILE1 as MOBILE16_24_13_, contactde20_.PREFFEREDTIME as PREFFER17_24_13_, contactde20_.PREFFEREDPHONE as PREFFER18_24_13_, contactde20_.WEBURL as WEBURL24_13_, contactde20_.MOBILE2 as MOBILE20_24_13_, contactde20_.CONTACTTYPENUM as CONTACT21_24_13_, contactde20_.POSTBOXNO as POSTBOXNO24_13_, contactde20_.ADDRESS2 as ADDRESS23_24_13_, contactde20_.PREFIX as PREFIX24_13_, contactde20_.SUFFIX as SUFFIX24_13_, contactde20_.CREATEDBY as CREATEDBY24_13_, contactde20_.CREATEDDATETIME as CREATED27_24_13_, contactde20_.UPDATEDBY as UPDATEDBY24_13_, contactde20_.UPDATEDDATETIME as UPDATED29_24_13_, contactde20_.ISDELETED as ISDELETED24_13_, city21_.CITYCODE as CITYCODE8_14_, city21_.CITYNAME as CITYNAME8_14_, city21_.ISACTIVE as ISACTIVE8_14_, city21_.ISDELETED as ISDELETED8_14_, city21_.CREATEDBY as CREATEDBY8_14_, city21_.CREATEDDATETIME as CREATEDD6_8_14_, city21_.UPDATEDBY as UPDATEDBY8_14_, city21_.UPDATEDDATETIME as UPDATEDD8_8_14_, city21_.COUNTRYCODE as COUNTRYC9_8_14_, city21_.STATECODE as STATECODE8_14_, state22_.STATECODE as STATECODE31_15_, state22_.STATENAME as STATENAME31_15_, state22_.ISACTIVE as ISACTIVE31_15_, state22_.CREATEDBY as CREATEDBY31_15_, state22_.CREATEDDATETIME as CREATEDD5_31_15_, state22_.ISDELETED as ISDELETED31_15_, state22_.UPDATEDBY as UPDATEDBY31_15_, state22_.UPDATEDDATETIME as UPDATEDD8_31_15_, state22_.COUNTRYCODE as COUNTRYC9_31_15_, state22_.SHORTNAME as SHORTNAME31_15_, country23_.COUNTRYCODE as COUNTRYC1_7_16_, country23_.COUNTRYNAME as COUNTRYN2_7_16_, country23_.ISACTIVE as ISACTIVE7_16_, country23_.ISDELETED as ISDELETED7_16_, country23_.CREATEDBY as CREATEDBY7_16_, country23_.CREATEDDATETIME as CREATEDD6_7_16_, country23_.UPDATEDBY as UPDATEDBY7_16_, country23_.UPDATEDDATETIME as UPDATEDD8_7_16_, systemtype24_.IDSLNO as IDSLNO15_17_, systemtype24_.TYPENUM as TYPENUM15_17_, systemtype24_.GROUPNUM as GROUPNUM15_17_, systemtype24_.ISDELETED as ISDELETED15_17_, systemtype24_.TYPEDESC as TYPEDESC15_17_, systemtype24_.ISACTIVE as ISACTIVE15_17_, systemtype24_.CREATEDBY as CREATEDBY15_17_, systemtype24_.CREATEDDATETIME as CREATEDD8_15_17_, systemtype24_.UPDATEDBY as UPDATEDBY15_17_, systemtype24_.UPDATEDDATETIME as UPDATED10_15_17_, prefix25_.PREFIXCODE as PREFIXCODE21_18_, prefix25_.PREFIXNAME as PREFIXNAME21_18_, prefix25_.COMMENTS as COMMENTS21_18_, prefix25_.ISACTIVE as ISACTIVE21_18_, prefix25_.CREATEDBY as CREATEDBY21_18_, prefix25_.CREATEDDATETIME as CREATEDD6_21_18_, prefix25_.UPDATEDBY as UPDATEDBY21_18_, prefix25_.UPDATEDDATETIME as UPDATEDD8_21_18_, prefix25_.APPLICABLEGENDER as APPLICAB9_21_18_, prefix25_.ISDELETED as ISDELETED21_18_, suffix26_.SUFFIXCODE as SUFFIXCODE0_19_, suffix26_.SUFFIXNAME as SUFFIXNAME0_19_, suffix26_.COMMENTS as COMMENTS0_19_, suffix26_.ISACTIVE as ISACTIVE0_19_, suffix26_.CREATEDBY as CREATEDBY0_19_, suffix26_.CREATEDDATETIME as CREATEDD6_0_19_, suffix26_.UPDATEDBY as UPDATEDBY0_19_, suffix26_.UPDATEDDATETIME as UPDATEDD8_0_19_, suffix26_.ISDELETED as ISDELETED0_19_
FROM STORE this_
left outer join SYSTEMTYPELOOKUP systemtype5_ on this_.DISPENSINGFLOWTYPENUM=systemtype5_.IDSLNO
left outer join SYSTEMTYPELOOKUP systemtype6_ on this_.STORECATEGORYTYPENUM=systemtype6_.IDSLNO
left outer join LOCATIONS locations7_ on this_.LOCATIONCODE=locations7_.LOCATIONCODE
left outer join UOM uom8_ on this_.DIMENSIONUOMCODE=uom8_.UOMCODE
left outer join UOM uom9_ on uom8_.BASEUOMCODE=uom9_.UOMCODE
inner join SYSTEMTYPELOOKUP storetype1_ on this_.STORETYPENUM=storetype1_.IDSLNO
inner join SYSTEMTYPELOOKUP status2_ on this_.STORESTATUSTYPENUM=status2_.IDSLNO
inner join STORE binstoreco3_ on this_.BINSTORECODE=binstoreco3_.STORECODE
left outer join SYSTEMTYPELOOKUP systemtype13_ on binstoreco3_.STORETYPENUM=systemtype13_.IDSLNO
left outer join SYSTEMTYPELOOKUP systemtype14_ on binstoreco3_.STORESTATUSTYPENUM=systemtype14_.IDSLNO
left outer join STORE store15_ on (binstoreco3_.BINSTORECODE=store15_.STORECODE )
left outer join STORESTORAGECONDITIONS storagecon16_ on store15_.STORECODE=storagecon16_.storecode
left outer join STORAGECONDITIONS storagecon17_ on storagecon16_.Storageconditioncode=storagecon17_.STORAGECONDITIONCODE
left outer join STORESERVINGLOCATIONS storageser18_ on store15_.STORECODE=storageser18_.storecode
left outer join LOCATIONS locations19_ on storageser18_.SERVINGLOCATIONCODE=locations19_.LOCATIONCODE
left outer join STORECONTACTDETAILS contactde20_ on store15_.STORECODE=contactde20_.STORECODE
left outer join CITIES city21_ on contactde20_.CITY=city21_.CITYCODE
left outer join STATES state22_ on contactde20_.STATE=state22_.STATECODE
left outer join COUNTRIES country23_ on contactde20_.COUNTRY=country23_.COUNTRYCODE
left outer join SYSTEMTYPELOOKUP systemtype24_ on contactde20_.CONTACTTYPENUM=systemtype24_.IDSLNO
left outer join PREFIXES prefix25_ on contactde20_.PREFIX=prefix25_.PREFIXCODE
left outer join SUFFIXES suffix26_ on contactde20_.SUFFIX=suffix26_.SUFFIXCODE
WHERE this_.ISDELETED = 'F' and storetype1_.IDSLNO = 430


Debug level Hibernate log excerpt:


In this, I tried to retrieve rows in STORE table. There is one column called BinStoreCode and it will refer itself. The problem is when I fetching rows it doesnt fetch the rows that having null values in BinStoreCode. But I want all the rows. I have given the mapping file for the table STORE.

In the given SQL, if the JOINs for storetype1_, status2_ and binstoreco3_ are set as left outer join then I'll get the data what I want. How to make those many-to-one association as outer join.

Note : Even I mention outer-join property as true in mapping file.

Please give me solution for this issue. Thanks in advance.

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 27, 2009 6:19 am 
Regular
Regular

Joined: Wed Oct 15, 2008 6:59 am
Posts: 103
Location: Chennai
well friends hibernate left outer join is not like left outer join in SQL(i.e., return null values also). becaz hibernate itself take care of n+1 query problem.

So u would like to prefer native query for this left outer join.

_________________
If u feel it will help you, don't forget to rate me....


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.