Tomek,
Thanks for your suggestion. I am really n00b in using ActiveRecord so I
apologize for asking these questions.
I installed NHibernateProfiler and saw that it is generating no query.
I am not expecting spoon feeding but what could be going wrong in this
simple query? How can I make sure Session object is correct.
FYI: I am not using xml files for mappings. I have attributed all my
properties. Is that the problem?
Troublesome statement again:
ActiveRecordContext.Instance.SessionFactory.OpenSession())
{
var query1 = session.CreateCriteria<ModuleData>();
// query1.SetProjection(Projections.Property("Id"));
// query1.Add(Expression.Ge("Id", 0));
var list = query1.List<ModuleData>();
}
Thanks!
--Am
2011/2/1 Tomek Pluskiewicz <[email protected]>
> Try peeking at the generated query using NHibernate Profiler.
>
> On 1 Lut, 04:27, maumad <[email protected]> wrote:
> > I am trying to get very simple query working. It does not throw but
> > returns empty list. Here is the query:
> >
> > using (var session =
> > ActiveRecordContext.Instance.SessionFactory.OpenSession())
> > {
> > var query1 = session.CreateCriteria<ModuleData>();
> > query1.SetProjection(Projections.Property("Id"));
> > query1.Add(Expression.Ge("Id", 0));
> > var list = query1.List<ModuleData>();
> > }
> >
> > If I write HqlBasedQuery it works fine:
> >
> > var query = new HqlBasedQuery(typeof(ModuleData),
> > QueryLanguage.Sql,
> > @"SELECT Id
> > FROM `aviprod`.`ModuleData`
> > WHERE Id > '0'");
> >
> > Any pointers?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Castle Project Users" group.
> To post to this group, send email to [email protected]
> .
> To unsubscribe from this group, send email to
> [email protected]<castle-project-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/castle-project-users?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" 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/castle-project-users?hl=en.