0

I Stuck in this query. If any body know the Criteria of NHibernate please help me

 select * from ViewFabricStock VFS where VFS.REORDER_METER > VFS.VIRTUAL_STOCK

VFS.REORDER_METER ,VFS.VIRTUAL_STOCK is a model property

i would like also know about this query select * from ViewFabricStock VFS where fabricName like LocalizeFabricName

4

1 回答 1

1

我相信您会发现比较同一实体的两个属性的问题

尝试使用Criteria.XPropertyX = Geor Leor的接口Eq

使用标准:

session.CreateCriteria<ViewFabricStock>("VFS")
        .Add(Restrictions.GeProperty("REORDER_METER","VIRTUAL_STOCK")

使用 QueryOver :

ViewFabricStock vfs = null
session.QueryOver<ViewFabricStock>(() => vfs)
        .Where(Restrictions.GeProperty(
                        Projections.Property(() => realm.REORDER_METER), 
                        Projections.Property(() => realm.VIRTUAL_STOCK)));
于 2013-04-08T17:25:32.450 回答