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: "where" attribute on class mapping
PostPosted: Tue May 27, 2008 2:30 pm 
Newbie

Joined: Tue Mar 06, 2007 5:28 pm
Posts: 6
If I apply a "where" attribute on a class mapping, then I notice that it is applied when retrieivng an instance of that entity using session.Load().

Code:
<class
   name="Foo"
   table="Foo"
   where="FooType = 1"
   lazy="false">
   <id name="FooId">
      <generator class="identity" />
   </id>
   <property name="FooName" />
</class>


However, if that class is linked to another class as a many-to-one, then the "where" is completely ignored when the containing class is loaded.

Code:
<bag name="FooItems" lazy="false">
   <key column="FooId" />
   <one-to-many class="Foo" />
</bag>

Is this by design?


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 28, 2008 2:24 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
Yes, there is also a "where" clause on the collection mapping.

_________________
--Wolfgang


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.