我正在编写以下内容作为 NHibernate 查询,但找不到使用 QueryOver 作为 HQL 的解决方案:-
IQuery query = SessionFactoryContext.GetCurrentSession()
.CreateSQLQuery(
@"SELECT s.UserID,
Username,
Email,Password,
FirstName,
LastName,
Address1,
Address2,
City,
County,
PostalCode,
Country
FROM [dbl].[dbo].[User] s
LEFT OUTER JOIN [dbl].[dbo].[groupmembership] g ON s.UserrID = g.UserrID
WHERE g.UserID IS NULL
OR (g.GroupID NOT IN (" + groupID + ") )")
.SetResultTransformer(Transformers.AliasToBean(typeof(User)));
return (IList<Subscriber>)query.List<User>();
有没有办法可以将其写为 NHibernate 查询?
非常感谢您的帮助,