Пример #1
0
        public void SelecRenewtWhere()
        {
            ICriteriaBuilder cb = EJBContainer.Instance.EntityManager.GetCriteriaBuilder();
            ICriteriaQuery   cc = cb.CreateQuery();
            IRoot            r  = cc.From("Students");

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

            cc.Where(cb.Equal(r.Get("FirstName"), cb.Literal("'Jonas'")));
            cc.Where(cb.NotEqual(r.Get("LastName"), cb.Literal("'Kybartas'")));

            Assert.AreEqual("SELECT Students.FirstName FROM Students WHERE Students.LastName <> 'Kybartas'", cc.ExpressionValue);
        }