Пример #1
0
 public virtual void Test1()
 {
     DeleteBase("multi");
     NeoDatis.Odb.ODB odb = Open("multi");
     odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("dog", "M", "my dog"));
     odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("cat", "F", "my cat"));
     odb.Store(new NeoDatis.Odb.Test.VO.Human.Man("Joe"));
     odb.Store(new NeoDatis.Odb.Test.VO.Human.Woman("Karine"));
     odb.Close();
     odb = Open("multi");
     NeoDatis.Odb.Core.Query.IQuery q = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
                                            (typeof(object));
     q.SetPolymorphic(true);
     NeoDatis.Odb.Objects <object> os = odb.GetObjects <object>(q);
     Println(os);
     odb.Close();
     AssertEquals(4, os.Count);
     DeleteBase("multi");
 }
Пример #2
0
 public virtual void Test6()
 {
     DeleteBase("multi");
     NeoDatis.Odb.ODB odb = Open("multi");
     odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("dog", "M", "my dog"));
     odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("cat", "F", "my cat"));
     odb.Store(new NeoDatis.Odb.Test.VO.Human.Man("Joe"));
     odb.Store(new NeoDatis.Odb.Test.VO.Human.Woman("Karine"));
     odb.Close();
     odb = Open("multi");
     NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery q = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
                                                                 (typeof(object));
     q.SetPolymorphic(true);
     System.Decimal nb = odb.Count(q);
     Println(nb);
     odb.Close();
     AssertEquals(new System.Decimal(4), nb);
     DeleteBase("multi");
 }
Пример #3
0
		/// <exception cref="System.Exception"></exception>
		public virtual void Test1()
		{
			DeleteBase("multi");
			NeoDatis.Odb.ODB odb = Open("multi");
			odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("dog", "M", "my dog"));
			odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("cat", "F", "my cat"));
			odb.Store(new NeoDatis.Odb.Test.VO.Human.Man("Joe"));
			odb.Store(new NeoDatis.Odb.Test.VO.Human.Woman("Karine"));
			odb.Close();
			odb = Open("multi");
			NeoDatis.Odb.Core.Query.IQuery q = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
				(typeof(object));
			q.SetPolymorphic(true);
			NeoDatis.Odb.Objects os = odb.GetObjects(q);
			Println(os);
			odb.Close();
			AssertEquals(4, os.Count);
			DeleteBase("multi");
		}
Пример #4
0
        public virtual void Test8()
        {
            int    size     = isLocal ? 3000 : 300;
            string baseName = GetBaseName();

            NeoDatis.Odb.ODB odb = Open(baseName);
            for (int i = 0; i < size; i++)
            {
                odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("dog" + i, "M", "my dog" + i));
                odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("cat" + i, "F", "my cat" + i));
                odb.Store(new NeoDatis.Odb.Test.VO.Human.Man("Joe" + i));
                odb.Store(new NeoDatis.Odb.Test.VO.Human.Woman("Karine" + i));
            }
            odb.Close();
            odb = Open(baseName);
            NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery q = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
                                                                        (typeof(object), NeoDatis.Odb.Core.Query.Criteria.Where.Equal("specie", "man"));
            q.SetPolymorphic(true);
            System.Decimal nb = odb.Count(q);
            Println(nb);
            odb.Close();
            AssertEquals(new System.Decimal(1 * size), nb);
            DeleteBase(baseName);
        }
Пример #5
0
        /// <exception cref="System.Exception"></exception>
        public virtual void Test7()
        {
            int size = isLocal ? 30000 : 3000;

            DeleteBase("multi");
            NeoDatis.Odb.ODB odb = Open("multi");
            for (int i = 0; i < size; i++)
            {
                odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("dog", "M", "my dog"));
                odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("cat", "F", "my cat"));
                odb.Store(new NeoDatis.Odb.Test.VO.Human.Man("Joe" + i));
                odb.Store(new NeoDatis.Odb.Test.VO.Human.Woman("Karine" + i));
            }
            odb.Close();
            odb = Open("multi");
            NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery q = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
                                                                        (typeof(object));
            q.SetPolymorphic(true);
            System.Decimal nb = odb.Count(q);
            Println(nb);
            odb.Close();
            AssertEquals(new System.Decimal(string.Empty + 4 * size), nb);
            DeleteBase("multi");
        }
Пример #6
0
		/// <exception cref="System.Exception"></exception>
		public virtual void Test8()
		{
			int size = isLocal ? 30000 : 3000;
			DeleteBase("multi");
			NeoDatis.Odb.ODB odb = Open("multi");
			for (int i = 0; i < size; i++)
			{
				odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("dog" + i, "M", "my dog" + i));
				odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("cat" + i, "F", "my cat" + i));
				odb.Store(new NeoDatis.Odb.Test.VO.Human.Man("Joe" + i));
				odb.Store(new NeoDatis.Odb.Test.VO.Human.Woman("Karine" + i));
			}
			odb.Close();
			odb = Open("multi");
			NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery q = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
				(typeof(object), NeoDatis.Odb.Core.Query.Criteria.Where.Equal("specie", "man"));
			q.SetPolymorphic(true);
			System.Decimal nb = odb.Count(q);
			Println(nb);
			odb.Close();
			AssertEquals(new System.Decimal(string.Empty + 1 * size), nb);
			DeleteBase("multi");
		}
Пример #7
0
		/// <exception cref="System.Exception"></exception>
		public virtual void Test6()
		{
			DeleteBase("multi");
			NeoDatis.Odb.ODB odb = Open("multi");
			odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("dog", "M", "my dog"));
			odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("cat", "F", "my cat"));
			odb.Store(new NeoDatis.Odb.Test.VO.Human.Man("Joe"));
			odb.Store(new NeoDatis.Odb.Test.VO.Human.Woman("Karine"));
			odb.Close();
			odb = Open("multi");
			NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery q = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
				(typeof(object));
			q.SetPolymorphic(true);
			System.Decimal nb = odb.Count(q);
			Println(nb);
			odb.Close();
			AssertEquals(new System.Decimal("4"), nb);
			DeleteBase("multi");
		}
Пример #8
0
        public virtual void Test7()
		{
			int size = isLocal ? 3000 : 300;
            string baseName = GetBaseName();
			NeoDatis.Odb.ODB odb = Open(baseName);
			for (int i = 0; i < size; i++)
			{
				odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("dog", "M", "my dog"));
				odb.Store(new NeoDatis.Odb.Test.VO.Human.Animal("cat", "F", "my cat"));
				odb.Store(new NeoDatis.Odb.Test.VO.Human.Man("Joe" + i));
				odb.Store(new NeoDatis.Odb.Test.VO.Human.Woman("Karine" + i));
			}
			odb.Close();
			odb = Open(baseName);
			NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery q = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
				(typeof(object));
			q.SetPolymorphic(true);
			System.Decimal nb = odb.Count(q);
			Println(nb);
			odb.Close();
			AssertEquals(new System.Decimal(4 * size), nb);
			DeleteBase(baseName);
		}