Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
NHibernate, actually, 1.0
Mapping documents:
(plain, nothing special, this part is working)
I have a concrete class "DocumentVersion" which is mapped and everything works fine.
DocumentVersion implements an Interface: IDocumentVersion:
Code:
public class DocumentVersion : IDocumentVersion
Code between sessionFactory.openSession() and session.close():Code:
ISession nhs = ...
// Works great!
IList docVersions = nhs.Find("FROM DocumentVersion");
// Works!
...
// Throws exception
IList docVersions = nhs.Find("FROM IDocumentVersion");
Throws:
[NHibernate.QueryException]: {"undefined alias or unknown mapping: Usva [FROM IDocumentVersion ]" }
// Also tried, but throws exception
IList docVersions = nhs.Find("FROM Customer.Project.Core.Entities.IDocumentVersion");
Throws:
[NHibernate.QueryException]: {"undefined alias or unknown mapping: Usva [FROM Customer.Project.Core.Entities.IDocumentVersion ]" }
I've tried putting the <imports> in my mapping files, but to no avail.
I must be doing something wrong, because the docs (11.6 Polymorphic Queries) says:
Quote:
NHibernate queries may name any .NET class or interface in the from clause. The query will return instances of all persistent classes that extend that class or implement the interface.
.
Any advice?