Hello, I'm pullin my hair out here. I've used Hibernate with java for a couple of projects. I've kept to the simple stuff and it's been a joy. I'm now using NHibernate with Dot Net, but on legacy databases. I have a parent child relationship I need to model,,, this is the schema (some irrevant bist cut out
<?xml version="1.0"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<!--<hibernate-mapping package="dsys.prototype.efr2.gen" auto-import="false">//-->
<class name="EFR2Objects.FeeRendHeader,EFR2" table="FEEREND" lazy="false">
<composite-id name="FeeRendHeaderId" class="EFR2Objects.FeeRendHeaderId,EFR2">
<key-property name="AdvCode" type="string">
<column name="ADVCODE"/>
</key-property>
<key-property name="RendUrn" type="int">
<column name="REND_URN"/>
</key-property>
</composite-id>
<property name="Pk" type="int" column="pri_key" update="false" />
<property name="RendType" type="Char" column="REND_TYPE" not-null="false"/>
<property name="RendUser" type="string" column="REND_USER" not-null="false"/>
<property name="RendUrn" type="int" column="REND_URN" not-null="false"
update="false" insert="false"/>
<property name="Status" type="Char" column="REND_STATUS" not-null="false"/>
<property name="DateStamp" type="string" column="DATE_STAMP" not-null="false"/>
<property name="ProcessedDateStamp" type="string" column="PROCESSED" not-null="false"/>
<property name="ProcessorName" type="string" column="PROCESSOR" not-null="false"/>
<property name="Uid" type="string" column="UID" not-null="false"/>
<property name="AdvCode" type="string" column="ADVCODE" not-null="false"
insert="false" update="false"/>
<property name="AdvName" type="string" column="ADVNAME" not-null="false"/>
:
: various other string etc properties
:
<list name="Items"
lazy="false"
inverse="true"
cascade="all">
<key>
<column name="ADVCODE" />
<column name="REND_URN"/>
</key>
<index column="ITEM_LN" type="int"/>
<one-to-many class="EFR2Objects.FeeRendLine,EFR2"/>
</list>
</class>
<class name="EFR2Objects.FeeRendLine, EFR2"
table="FEERDLN" lazy="false" >
<composite-id class="EFR2Objects.FeeRendLineId,EFR2"
name="FeeRendLineId" >
<key-many-to-one class="EFR2Objects.FeeRendHeader,EFR2"
name="FeeNote" >
<column name="ADVCODE" />
<column name="REND_URN" />
</key-many-to-one>
<key-property name="ItemLine" type="int" column="ITEM_LN"/>
</composite-id>
<property name="ItemLine" type="int" column="ITEM_LN" update="false" insert="false"/>
<property name="Pk" type="int" column="pri_key" />
<property name="ItemDesc" type="string" column="ITEM_DESC"/>
<property name="ItemDate" type="string" column="ITEM_DT"/>
<property name="ItemVal" type="double" column="ITEM_VAL"/>
</class>
</hibernate-mapping>
My problem is when I query the FeeRendHeader, I use session.Load(...) the app just hangs around... I've used Load in Java and it worked fine. I am thinking that my mapping is causing some kind of recursive SQL query to busy the server... I'm not 100 sure, but If I turn ON lazy in the parent Items list it returns just fine, but I get no child records...
Any suggestion welcomed or even someway for me to track whats going on would be helpful...
Help!!!!!!
_________________ I'm addicted to VBoost...
|