-->
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.  [ 1 post ] 
Author Message
 Post subject: Evict troubles...
PostPosted: Tue Nov 15, 2005 3:42 pm 
Problem:
(See the mapping below for the class definitions)
After loading and evicting the AppList object, I'm then trying to load a particluar AppListItem. The problems is that Attributes bag is not filled for the AppListItem. Obviously, when the AppList object is NOT evicted and I Load/Get a particular AppListItem object it is loaded out of session rather than querying the database. The AppListItem then contains the populated bag of Attributes.

Code:
<class name="AppList, ApplicationLists" table="List">
         <id name="Name" column="ListName">
            <generator class="assigned"/>
         </id>
         <bag name="Items" table="ListItem" order-by="ItemIndex" inverse="true" cascade="all">
            <key column="ListName"/>
            <one-to-many class="AppListItem, ApplicationLists"/>
         </bag>
</class>


<class name="AppListItem, ApplicationLists" table="ListItem">
         <composite-id name="Identity" class="ItemIdentifier, ApplicationLists">
            <key-many-to-one name="Parent" class="AppList, ApplicationLists" column="ListName"/>
            <key-property name="Value" column="ItemId"/>
         </composite-id>
         <bag name="Attributes" table="ListItemAttribute" cascade="all" order-by="AttributeItemId">
            <key>
               <column name="ListName"/>
               <column name="ListItemId"/>
            </key>
            <many-to-many class="AttributeItem, ApplicationLists">
               <column name="AttributeName"/>
               <column name="AttributeItemId"/>
            </many-to-many>
         </bag>
</class>


<class name="AttributeItem, ApplicationLists" table="AttributeItem">
         <composite-id name="Identity" class="ItemIdentifier, ApplicationLists">
            <key-many-to-one name="Parent" class="Attribute, ApplicationLists" column="AttributeName" />
            <key-property name="Value" column="ItemId"/>
         </composite-id>
         <property name="Name" column="ItemName" unique="true"/>
         <property name="SupplementalData" column="SupplementalData"/>
</class>



Findings:
I have looked at the sql statements generated when trying to load the ListItem, and everything looks fine. I've gone over the mapping properties up and down, and can not find any problems with it. I've been over the hibernate_refernece as well as the nhibernate documentation and haven't found anything that I'm doing wrong. Any help is is greatly appreciated.

Thanks,
njones


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

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.