-->
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: Filter or not filter?
PostPosted: Tue Oct 02, 2007 10:46 am 
Newbie

Joined: Thu Sep 27, 2007 5:58 pm
Posts: 2
Hi

I'm needing to develop a mechanism similar to the Hibernate filter, called restrictions. The main difference is that I need mount the condition of the filter at runtime, before the session factory is built. This is because that the restrictions can change at runtime. But that aspect I'm not thinking about momentarily. I'm developing in manner that the restriction's filters are created at initialization time and, if some restriction changes, what it won't be frequent, the web/Java application must be restarted. But later I'll have to attack this problem.
The problem that I encountered latter is because restrictions can be enabled for a search and disabled for another, in the same Hibernate session. This is a problem when used to fetch lazy associations. For example: I search an entity A that has an lazy association B a first time, with a filter (that is applied to B) enabled. Before, I need to search newly the entity A, with no filter enabled. Before that, I access the association B of the first search, that is fetched now because the lazy mode. But the filter isn't applied to that fetch, because those isn't enabled (although it had been at search time).

A question that I ask myself is wheter I must use filters or no. An approach that I think is manipulate HQLs and Criterias with the restrictions's definitions, without something of filters.
Could you help me, talking me which approaches you would think about. What can't I do, because of the internal implementation of the Hibernate?

Thank you for help.

_________________
| Fundação de Apoio à Tecnologia e Ciência |
| Santa Maria - RS - Brazil |


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 08, 2007 11:34 am 
Newbie

Joined: Thu Sep 27, 2007 5:58 pm
Posts: 2
I'm looking the Hibernate's source code at jsourcery.com for the place where the filters are applied to the SQL string. But I can not do it.
Could someone help me, please. Thank you.

_________________
| Fundação de Apoio à Tecnologia e Ciência |
| Santa Maria - RS - Brazil |


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.