-->
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: Is session.createFilter(..) only for an entity's Collections
PostPosted: Mon Jan 23, 2006 10:58 am 
Newbie

Joined: Fri Aug 19, 2005 9:04 am
Posts: 4
Is session.createFilter(..) only for an entity's Collections rather than entities themselves? For example a could one not implement an Entity's Active/Inactive flag as a column on some entities where this logic applies but enable the filter against the whole session programatically to include/exclude inactive entities at runtime on a Use Case basis, rather than having to add Criteria/Criterion to specific finders?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 3:04 pm 
Newbie

Joined: Fri Aug 19, 2005 9:04 am
Posts: 4
It helps to read the doco's first, (apologies)

Hibernate3 adds the ability to pre-define filter criteria and attach those filters at both a class and a collection level. A filter criteria is the ability to define a restriction clause very similiar to the existing "where" attribute available on the class and various collection elements. Except these filter conditions can be parameterized.

However, the filter(s) seems to be ignored when using FindById. Why?
Shame also that the filterDef from an annotations perspective appears to be at @Entity level, rather than @EmbeddableSuperclass.


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.