-->
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: In memory filtering of results (NOT with Filters)
PostPosted: Thu Feb 11, 2010 9:44 am 
Newbie

Joined: Thu Feb 11, 2010 9:25 am
Posts: 4
Hi, I have discovered that adding the where attribute in the mapping file of a class "disable" the second level cache lookup for that entities (with EhCache).

So I'm trying to do the same filtering (logical delete) in memory after all the data has been loaded from db, both for lookup and queries.
Deleted lines are really few so this will not be a performance problem.

In practice I'd like to be able to intercept each record loaded and choose to discard some.
I looked atInterceptors but I think this can not be used to do this. I checked both onLoad(), instantiate() and getEntity() but none can return anything to signal to completely discard the record.
Filters do the filtering on the database side so are not useful here.

I'm considering to subclass DefaultLoadEventListener and "decorate" the doLoad method with this filtering. Is this a good idea? Is there any better way to do this?

Thanks, bye

Lorenzo


Top
 Profile  
 
 Post subject: Re: In memory filtering of results (NOT with Filters)
PostPosted: Fri Feb 12, 2010 12:46 pm 
Newbie

Joined: Thu Feb 11, 2010 9:25 am
Posts: 4
up


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.