1
我想在沒有成功的情況下在NHibernate中使用QueryOver創建一個查詢。 產生的SQL我需要得到的是以下幾點:加入在nhibernate查詢
select mn.Story_ID from Membership_Updates mn
join Updates upd on mn.Story_ID = upd.Story_ID
where mn.MembershipUser_ID = 1
group by mn.Story_ID having MAX(mn.DismissTime) <= MAX(upd.CreationDate)
我的課:
public class MembershipUpdates
{
public MembershipUpdates()
{
DismissTime = DateTime.Now;
}
public virtual int Id { get; set; }
public virtual MembershipUser User { get; set; }
public virtual Story Story { get; set; }
public virtual DateTime DismissTime { get; set; }
}
public class Updates
{
public Updates()
{
CreationDate = DateTime.Now;
}
public virtual int Id { get; set; }
public virtual DateTime CreationDate { get; private set; }
public virtual Story Story { get; set; }
public virtual string Message{ get; set; }
}
也許我失去了一些東西明顯
謝謝。我以前很怕那個。 HQL將在那時:) – Iridio 2011-04-28 09:14:30