Hi There,
I am consistantly getting an "Named Query Not Known" Error when
calling session.GetNamedQuery(). I'm using Fluent and I have the
query in a hbm.xml file. To make things simple, i have everything in
the same assembly. I've set the Build Action on the xml file to
"Embedded Resource".
My Configuration looks like this:
var nhConfig = Fluently.Configure()
.Database(SQLAnywhereConfiguration
.SQLAnywhere10
.ConnectionString("uid='dba'; pwd='sql'; dsn=db"))
.ExposeConfiguration(c =>
c.SetProperty("current_session_context_class", "thread_static"))
.Mappings(m =>
m.FluentMappings.AddFromAssemblyOf<Party>())
.BuildConfiguration();
var sessionFactory = nhConfig.BuildSessionFactory();
ISession session = sessionFactory.OpenSession();
CurrentSessionContext.Bind(session);
NHibernate.IQuery q =
session.GetNamedQuery("GetFirstParty");
My GetFirstParty.hbm.xml file looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<query name="GetFirstParty">
<![CDATA[from Party p where p.CaseNumber = :CaseNumber]]>
</query>
</hibernate-mapping>
What am i missing here???
Please help.
Thanks,
Mike
--
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.