My apologies for using the word query, after reading your post I realized that it wasn’t the best choice of wording. What I was really trying to indicate was the part of the where clause that is pre-determined.
Your reply was also very helpful in clarifying the current architecture; your point about changing the multiplicity of associations is sound (and enabling and disabling filters would have that result).
After reading through the code it seems that discriminators, filters and where attributes all do something close to what I want: adding an extra clauses to the SQL where statement.
In fact another possible approach might be to change the where attribute so that it is parameterized (based on a parameter associated with the session) I think it would do exactly what I need, however I am unsure if there is any way to address the multiplicity issue (does simply having the where “Always on” resolve it)?
If so, is this approach more in line with where the Hibernate team wants the product to go, hence is there any chance such a patch would be accepted?
If not is there anywhere else in the current architecture where such a concept would fit?
Thanks again,
David
|