They do in my case cause i am using them in formula.
eg

<property name="Text" formula="(SELECT t.val
FROM translation t
WHERE t.record_id = id AND t.table_name = 'question'
AND t.phrase = 'Text' AND t.culture_id = :CultureFilter.CultureId)" />

On Apr 27, 2009 11:20am, Germán Schuager <gschua...@gmail.com> wrote:
> I think that filters do not apply when you are getting an entity by id  
> (get/load), just when you issue a query using HQL or criteria.

> On Mon, Apr 27, 2009 at 12:37 AM, Michal mga...@gmail.com> wrote:




> Thanks fabio for the quick reply.



> Unfortunately this does not work. The filter stays with the same

> value.



> See my code. Thanks!:



> ISessionFactory sf = new Configuration().Configure

> ().BuildSessionFactory();

> ISession sess = sf.OpenSession();

> sess.EnableFilter("CultureFilter").SetParameter

> ("CultureId", new CultureInfo("en-US").LCID);

> sess.BeginTransaction();



> IDaoFactory dao = new NHibernateDaoFactory();

> Question q = (Question)sess.Load(typeof(Question), 4);



> Assert.AreEqual("Whats your name?", q.Text, "English

> translation does not work");



> sess.DisableFilter("CultureFilter");

> sess.EnableFilter("CultureFilter").SetParameter

> ("CultureId", new CultureInfo("de-DE").LCID);

> q = (Question)sess.Load(typeof(Question), 4);



> Assert.AreEqual("Wie ist dein Name?", q.Text, "German

> translation does not work");



> sess.Transaction.Rollback();



> sess.Flush();

> sess.Close();



> On Apr 25, 9:09 pm, Fabio Maulo fabioma...@gmail.com> wrote:

> > disable->enable

> > 2009/4/25 Michal mga...@gmail.com>

> >

> >

> >

> >

> >

> > > Hi,

> >

> > > I am using filters for my session and would like to reload the

> > > filter's param value. How to do that?

> >

> > > I am setting the filter like that

> >

> > > session.EnableFilter("name").SetParameter("param", 1)

> >

> > > now i would like to change the value from 1 to 2 for the upcoming

> > > queries ... when i just change it to

> >

> > > session.EnableFilter("name").SetParameter("param", 2)

> >

> > > then the change is not populated somehow.

> >

> > > What i am doing wrong?

> >

> > > Thanks

> >

> > --

> > Fabio Maulo








> 



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to