-->
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: @Where and @LazyCollection
PostPosted: Fri Nov 09, 2007 6:19 pm 
Newbie

Joined: Fri Nov 09, 2007 6:15 pm
Posts: 1
It appears that if you use @LazyCollection your @Where clause gets ignored.

I have a collection mapped in an entity called User that looks like this:

@OneToMany(mappedBy="user", fetch=FetchType.LAZY)
@LazyCollection(LazyCollectionOption.EXTRA)
@Where(clause="deleted=0 AND duplicate=0")
private List<Property> properties = new ArrayList<Property>();

if I call properties.size() I get a count that includes properties where the "deleted" attribute is true. If I leave out the @LazyCollection annotation and call properties.size() the count does not include those properties.


Top
 Profile  
 
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.