NHibernate-对列使用自定义sql查询
有没有办法将自定义sql与NHibernate一起使用?我想对特定列使用复杂的sql 例如:NHibernate-对列使用自定义sql查询,nhibernate,Nhibernate,有没有办法将自定义sql与NHibernate一起使用?我想对特定列使用复杂的sql 例如: select id, viewsCount, commentsCount, 0.2 * viewsCount / (select top 1 viewsCount from articles where isActive = 1 order by viewsCount DESC) as priorityViews, 0.8 * commentsCount / (select top 1 co
select id, viewsCount, commentsCount,
0.2 * viewsCount / (select top 1 viewsCount from articles where isActive = 1 order by viewsCount DESC) as priorityViews,
0.8 * commentsCount / (select top 1 commentsCount from articles where isActive = 1 order by commentsCount DESC) as priorityComments,
round(0.2 * viewsCount / (select top 1 viewsCount from articles where isActive = 1 order by viewsCount DESC) +
0.8 * commentsCount / (select top 1 commentsCount from articles where isActive = 1 order by commentsCount DESC), 1) as priority
from articles
可以在的映射中或在的查询中执行此操作