示例#1
0
        /// <exception cref="System.Exception"></exception>
        public virtual void Test9Ordering()
        {
            if (!isLocal)
            {
                return;
            }
            NeoDatis.Odb.ODB odb = Open("get.neodatis");
            NeoDatis.Odb.Core.Query.NQ.SimpleNativeQuery query = new _SimpleNativeQuery_235();
            query.OrderByDesc("name,email");
            NeoDatis.Odb.Objects l = odb.GetObjects(query, true);
            int i = l.Count - 1;

            while (l.HasNext())
            {
                NeoDatis.Odb.Test.VO.Login.User user = (NeoDatis.Odb.Test.VO.Login.User)l.Next();
                // println(user.getName() + " / " + user.getEmail());
                AssertEquals("olivier " + i / 3, user.GetName());
                AssertEquals("[email protected] " + ((i % 3) + 1), user.GetEmail());
                i--;
            }
            odb.Close();
        }
示例#2
0
		/// <exception cref="System.Exception"></exception>
		public virtual void Test9Ordering()
		{
			if (!isLocal)
			{
				return;
			}
			NeoDatis.Odb.ODB odb = Open("get.neodatis");
			NeoDatis.Odb.Core.Query.NQ.SimpleNativeQuery query = new _SimpleNativeQuery_235();
			query.OrderByDesc("name,email");
			NeoDatis.Odb.Objects l = odb.GetObjects(query, true);
			int i = l.Count - 1;
			while (l.HasNext())
			{
				NeoDatis.Odb.Test.VO.Login.User user = (NeoDatis.Odb.Test.VO.Login.User)l.Next();
				// println(user.getName() + " / " + user.getEmail());
				AssertEquals("olivier " + i / 3, user.GetName());
				AssertEquals("[email protected] " + ((i % 3) + 1), user.GetEmail());
				i--;
			}
			odb.Close();
		}