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

user690986
  • 41
  • 2
  • 6

1 Answers1

1

I believe you are finding issues comparing two Properties of the same entity

Trying using the interface Criteria.XProperty where X = Ge or Le or Eq

Using Criteria :

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

Using QueryOver :

ViewFabricStock vfs = null
session.QueryOver<ViewFabricStock>(() => vfs)
        .Where(Restrictions.GeProperty(
                        Projections.Property(() => realm.REORDER_METER), 
                        Projections.Property(() => realm.VIRTUAL_STOCK)));
frictionlesspulley
  • 11,070
  • 14
  • 66
  • 115