Noticing some inconsistancies with object loading, and was wondering if any
of you knew if this was expected behavior or a bug.

I've included a patch for DynamicFilterTest.cs in the FilterTest folder of
the nhibernate tests, but basically it's like this:

Filters don't seem to work on the primary entity if loaded via ISession.Load
or ISession.Get. They'll still work on joined entities (marked as lazy=false
in the hbm). Filters do work via HQL or Criteria

So if I do

session.EnableFilter("Region").SetParameter("Region","THISONEISBAD");

//this returns the Salesperson, but it should not
session.Get(typeof(Salesperson),id)

//this returns null as expected.
session.CreateQuery("from Salesperson as s where s.id =
:id").SetParameter("id",id).UniqueResult();

//this returns null as expected
session.CreateCriteria(typeof(Salesperson)).Add(Restrictions.IdEq(id)).UniqueResult();

So what gives? Is this by design? Should I work to fix this, or is this
intended?

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

Attachment: filtertestpatch.patch
Description: Binary data

Reply via email to