I'm experimenting with NHibernate, and I've run into something that looks a 
bit dangerous, but I'm hoping it's just me doing something wrong or 
something that is configurable.

If I try to run a query for a list of objects that are of a type that has 
no mapping, it just fails silently and returns an empty list.

i.e.:

"Variable" is a type that is not mapped in a hbm file. 

The following throws an exception:

_session.Get<Variable>(1); //this throws an exception



These do not throw exceptions, or otherwise indicate that Variable is not a 
mapped type:

_session.Query<Variable>().Where( e => e.VariableId == 1).ToList(); //this 
returns an empty list.

_session.CreateCriteria(typeof(Variable)).Add(Restrictions.Eq("VariableId", 
1)).List<Variable>(); //this also returns an empty list



Is this by-design, is it a bug, is there something I'm missing, or is there 
some way to have NHibernate complain that we are trying to query for a type 
that does not have any mapping defined?

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to