I inherited a project that has been around for a few years.
The project utilizes a Domain/Interface/Dao model in ASP.NET.
-----
The Dao executes numerous queries using ICriteria such as:
ICriteria criteria =
NHibernateSessionManager.Instance.GetSession().CreateCriteria(typeof(MyEntity));
criteria.Add(Expression.Eq("id", id));
return criteria.UniqueResult<MyEntity>();
-----
I'm trying to execute a sproc using a Named Query.
For numerous reasons I like to do so in this fashion:
------
using (ISession ses = NHibernateISession.OpenSession())
{
IQuery qry = ses.GetNamedQuery("MySproc");
qry.SetParameter("param1", param1);
qry.UniqueResult();
-----
How do I get session from SessionManager when GetSession() returns
ISessionBase?
or
How do I execute a named query from an ISessionBase?
NHibernateSessionManager doesn't have a method that returns a ISession.
NHibernateSessionManager is in a separate "Core" project which I am
probably not going to be able to touch.
All projects are wired together via Spring.
--
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 https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.