-->
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.  [ 3 posts ] 
Author Message
 Post subject: @Where annotation details
PostPosted: Sun Dec 30, 2007 8:40 pm 
Beginner
Beginner

Joined: Thu Jun 21, 2007 1:47 pm
Posts: 46
I found this annotation @Where in the documentation, and I was wondering what the details of its operation were.

It seems pretty clear that putting a @Where clause on a collection will filter the entities in the collection when it is loaded from the database. Applying it to an entity class would add a sort of "default" filter that applies to queries and collections for that entity.

But:

If I still have references to "filtered out" objects in other entities, will those references still work?

If I want to look an object up by ID, and it's "filtered out", will it be returned?

If I wanted to write a query which bypassed or ignored the where clause on an entity class, could I?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 03, 2008 3:23 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
if you also have a where clause on the ontity itself you can do 1 and 2
But then 3 will not be possible

The Filter feature is more flexible since it can be enabled and disabled

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 20, 2008 11:28 pm 
Beginner
Beginner

Joined: Thu Jun 21, 2007 1:47 pm
Posts: 46
Thanks emmanuel!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.