Source:-http://www.martinwilley.com/net/code/nhibernate/query.html
//criteria
var criteria = session.CreateCriteria<Product>()
//"Restrictions" used to be "Expression"
.Add(Restrictions.Eq("Category.Id", 2))
//ordering
.AddOrder(NHibernate.Criterion.Order.Asc("Id"))
//paging, 2nd page of 10
.SetFirstResult(10) //zero based
.SetMaxResults(10);
RestrictionsDisjunction
http://www.java2s.com/Tutorial/Java/0350__Hibernate/RestrictionsDisjunction.htm
http://stackoverflow.com/questions/4206702/hibernate-criteria-query-nested-condition
No comments:
Post a Comment