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: Cascading with "where=xxx"
PostPosted: Thu Nov 29, 2007 10:46 pm 
Newbie

Joined: Wed Apr 07, 2004 6:13 pm
Posts: 18
Hi,
How does NHibernate handle a mapped collection using the "where" clause? I have 2 collections on an object that both map to the same class, but use different "where" clauses. Will cascading and caching work as other mapped relationships?

_________________
Thanks,
Aaron


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 30, 2007 10:36 am 
Newbie

Joined: Wed Apr 07, 2004 6:13 pm
Posts: 18
wanted to put an example of what I'm talking about to help:
Code:
      <bag name="RoleAccessRights" lazy="true" cascade="none" generic="true" where="MEMBERSHIP_OBJECT_TYPE = 1 AND PROTECTED_OBJECT_TYPE = 3">
         <cache usage="read-write"/>
         <key column="PROTECTED_OBJECT_ID"/>
         <one-to-many class="TS.Core.Domain.AccessRights, TS.Core.Domain" />
      </bag>
      <bag name="UserAccessRights" lazy="true" cascade="none" generic="true" where="MEMBERSHIP_OBJECT_TYPE = 2 AND PROTECTED_OBJECT_TYPE = 3">
         <cache usage="read-write"/>
         <key column="PROTECTED_OBJECT_ID"/>
         <one-to-many class="TS.Core.Domain.AccessRights, TS.Core.Domain" />
      </bag>


So, there is no "inverse" side (can I have one if the other end of this represents many different "protected object types" i.e. keys to different database tables?).

Can I let NHibernate manage the cascading and caching?

_________________
Thanks,
Aaron


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.