Exemple #1
0
        public void OrderByMultipleFieldsDesc()
        {
            ICriteriaBuilder cb = EJBContainer.Instance.EntityManager.GetCriteriaBuilder();
            ICriteriaQuery   cc = cb.CreateQuery();
            IRoot            r  = cc.From("Students");

            cc.Select(r.Get("FirstName"), r.Get("LastName"));

            cc.OrderBy(cb.Desc(r.Get("FirstName")), cb.Desc(r.Get("LastName")));

            Assert.AreEqual("SELECT Students.FirstName, Students.LastName FROM Students ORDER BY Students.FirstName DESC, Students.LastName DESC", cc.ExpressionValue);
        }