Exemplo n.º 1
0
        public void SelectFieldWithAliasStatement_Success()
        {
            ICriteriaQuery cc = EJBContainer.Instance.EntityManager.GetCriteriaBuilder().CreateQuery();
            IRoot          r  = cc.From("Students");

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

            string s = cc.ToString();

            Assert.AreEqual(s, "SELECT Students.FirstName AS Name FROM Students");
        }
Exemplo n.º 2
0
        public void SelectMultipleFieldsStatement_Success()
        {
            ICriteriaQuery cc = EJBContainer.Instance.EntityManager.GetCriteriaBuilder().CreateQuery();
            IRoot          r  = cc.From("Students");

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

            string s = cc.ToString();

            Assert.AreEqual(s, "SELECT FirstName, LastName FROM Students");
        }