Пример #1
0
        /// <exception cref="System.IO.IOException"></exception>
        /// <exception cref="System.Exception"></exception>
        public virtual void Test11()
        {
            NeoDatis.Odb.ODB odb = NeoDatis.Odb.ODBFactory.Open("valuesSubList");
            NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
                                                                 ();
            for (int i = 0; i < 10; i++)
            {
                handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value "
                                                                                  + i));
            }
            odb.Store(handler);
            odb.Close();
            odb = Open("valuesSubList");
            NeoDatis.Odb.Values values = odb.GetValues(new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery
                                                           (typeof(NeoDatis.Odb.Test.Query.Values.Handler)).Field("parameters").Sublist("parameters"
                                                                                                                                        , "sub1", 1, 5, true).Sublist("parameters", "sub2", 1, 10).Size("parameters", "size"
                                                                                                                                                                                                        ));
            NeoDatis.Odb.ObjectValues ov = values.NextValues();
            // Retrieve Result values
            System.Collections.IList fulllist = (System.Collections.IList)ov.GetByAlias("parameters"
                                                                                        );
            long size = (long)ov.GetByAlias("size");

            System.Collections.IList sublist = (System.Collections.IList)ov.GetByAlias("sub1"
                                                                                       );
            odb.Close();
        }
Пример #2
0
 /// <exception cref="System.IO.IOException"></exception>
 /// <exception cref="System.Exception"></exception>
 public virtual void Test2()
 {
     DeleteBase("valuesA1");
     NeoDatis.Odb.ODB odb = Open("valuesA1");
     NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
                                                          ();
     for (int i = 0; i < 10; i++)
     {
         handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value"
                                                                           + i));
     }
     odb.Store(handler);
     odb.Close();
     odb = Open("valuesA1");
     // ValuesQuery in getObjects
     try
     {
         NeoDatis.Odb.Objects objects = odb.GetObjects(new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery
                                                           (typeof(NeoDatis.Odb.Test.Query.Values.Handler)).Field("parameters"));
         Fail("Should throw exception");
     }
     catch (System.Exception)
     {
     }
     // TODO: handle exception
     odb.Close();
 }
        public virtual void Test2()
		{
			DeleteBase("valuesA1");
			NeoDatis.Odb.ODB odb = Open("valuesA1");
			NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
				();
			for (int i = 0; i < 10; i++)
			{
				handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value"
					 + i));
			}
			odb.Store(handler);
			odb.Close();
			odb = Open("valuesA1");
			// ValuesQuery in getObjects
			try
			{
				NeoDatis.Odb.Objects objects = odb.GetObjects(new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery
					(typeof(NeoDatis.Odb.Test.Query.Values.Handler)).Field("parameters"));
				Fail("Should throw exception");
			}
			catch (System.Exception)
			{
			}
			// TODO: handle exception
			odb.Close();
		}
Пример #4
0
        /// <exception cref="System.IO.IOException"></exception>
        /// <exception cref="System.Exception"></exception>
        public virtual void Test1()
        {
            string baseName = GetBaseName();

            DeleteBase(baseName);
            NeoDatis.Odb.ODB odb = Open(baseName);
            NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
                                                                 ();
            for (int i = 0; i < 10; i++)
            {
                handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value "
                                                                                  + i));
            }
            NeoDatis.Odb.OID oid = odb.Store(handler);
            odb.Close();
            odb = Open(baseName);
            NeoDatis.Odb.Values values = odb.GetValues(new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery
                                                           (typeof(NeoDatis.Odb.Test.Query.Values.Handler), oid).Field("parameters").Sublist
                                                           ("parameters", "sub1", 1, 5, true).Sublist("parameters", "sub2", 1, 10).Size("parameters"
                                                                                                                                        , "size"));
            Println(values);
            NeoDatis.Odb.ObjectValues ov       = values.NextValues();
            System.Collections.IList  fulllist = (System.Collections.IList)ov.GetByAlias("parameters"
                                                                                         );
            AssertEquals(10, fulllist.Count);
            long size = (long)ov.GetByAlias("size");

            AssertEquals(10, size);
            NeoDatis.Odb.Test.Query.Values.Parameter p = (NeoDatis.Odb.Test.Query.Values.Parameter
                                                          )fulllist[0];
            AssertEquals("value 0", p.GetValue());
            NeoDatis.Odb.Test.Query.Values.Parameter p2 = (NeoDatis.Odb.Test.Query.Values.Parameter
                                                           )fulllist[9];
            AssertEquals("value 9", p2.GetValue());
            System.Collections.IList sublist = (System.Collections.IList)ov.GetByAlias("sub1"
                                                                                       );
            AssertEquals(5, sublist.Count);
            p = (NeoDatis.Odb.Test.Query.Values.Parameter)sublist[0];
            AssertEquals("value 1", p.GetValue());
            p2 = (NeoDatis.Odb.Test.Query.Values.Parameter)sublist[4];
            AssertEquals("value 5", p2.GetValue());
            System.Collections.IList sublist2 = (System.Collections.IList)ov.GetByAlias("sub2"
                                                                                        );
            AssertEquals(9, sublist2.Count);
            odb.Close();
        }
Пример #5
0
		/// <exception cref="System.IO.IOException"></exception>
		/// <exception cref="System.Exception"></exception>
		public virtual void Test1()
		{
			string baseName = GetBaseName();
			DeleteBase(baseName);
			NeoDatis.Odb.ODB odb = Open(baseName);
			NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
				();
			for (int i = 0; i < 10; i++)
			{
				handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value "
					 + i));
			}
			NeoDatis.Odb.OID oid = odb.Store(handler);
			odb.Close();
			odb = Open(baseName);
			NeoDatis.Odb.Values values = odb.GetValues(new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery
				(typeof(NeoDatis.Odb.Test.Query.Values.Handler), oid).Field("parameters").Sublist
				("parameters", "sub1", 1, 5, true).Sublist("parameters", "sub2", 1, 10).Size("parameters"
				, "size"));
			Println(values);
			NeoDatis.Odb.ObjectValues ov = values.NextValues();
			System.Collections.IList fulllist = (System.Collections.IList)ov.GetByAlias("parameters"
				);
			AssertEquals(10, fulllist.Count);
			long size = (long)ov.GetByAlias("size");
			AssertEquals(10, size);
			NeoDatis.Odb.Test.Query.Values.Parameter p = (NeoDatis.Odb.Test.Query.Values.Parameter
				)fulllist[0];
			AssertEquals("value 0", p.GetValue());
			NeoDatis.Odb.Test.Query.Values.Parameter p2 = (NeoDatis.Odb.Test.Query.Values.Parameter
				)fulllist[9];
			AssertEquals("value 9", p2.GetValue());
			System.Collections.IList sublist = (System.Collections.IList)ov.GetByAlias("sub1"
				);
			AssertEquals(5, sublist.Count);
			p = (NeoDatis.Odb.Test.Query.Values.Parameter)sublist[0];
			AssertEquals("value 1", p.GetValue());
			p2 = (NeoDatis.Odb.Test.Query.Values.Parameter)sublist[4];
			AssertEquals("value 5", p2.GetValue());
			System.Collections.IList sublist2 = (System.Collections.IList)ov.GetByAlias("sub2"
				);
			AssertEquals(9, sublist2.Count);
			odb.Close();
		}
Пример #6
0
        /// <summary>Using Object representation instead of real object</summary>
        /// <exception cref="System.IO.IOException"></exception>
        /// <exception cref="System.Exception"></exception>
        public virtual void Test5()
        {
            int sublistSize = 400;

            if (!isLocal && !useSameVmOptimization)
            {
                sublistSize = 40;
            }
            string baseName = GetBaseName();

            DeleteBase(baseName);
            NeoDatis.Odb.ODB odb = Open(baseName);
            NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
                                                                 ();
            for (int i = 0; i < sublistSize; i++)
            {
                handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value "
                                                                                  + i));
            }
            odb.Store(handler);
            odb.Close();
            odb = Open("valuesSubList3");
            long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();

            NeoDatis.Odb.Core.Query.IValuesQuery q = new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery
                                                         (typeof(NeoDatis.Odb.Test.Query.Values.Handler)).Sublist("parameters", "sub", 0,
                                                                                                                  2, true);
            NeoDatis.Odb.Values values = odb.GetValues(q);
            long end = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();

            Println("time to load sublist of 5 itens for " + sublistSize + " : " + (end - start
                                                                                    ));
            Println(values);
            NeoDatis.Odb.ObjectValues ov      = values.NextValues();
            System.Collections.IList  sublist = (System.Collections.IList)ov.GetByAlias("sub");
            AssertEquals(2, sublist.Count);
            NeoDatis.Odb.Test.Query.Values.Parameter parameter = (NeoDatis.Odb.Test.Query.Values.Parameter
                                                                  )sublist[1];
            AssertEquals("value 1", parameter.GetValue());
            NeoDatis.Odb.OID oid = odb.GetObjectId(parameter);
            Println(oid);
            odb.Close();
        }
Пример #7
0
        /// <exception cref="System.IO.IOException"></exception>
        /// <exception cref="System.Exception"></exception>
        public virtual void Test2()
        {
            DeleteBase("valuesSubList2");
            NeoDatis.Odb.ODB odb = Open("valuesSubList2");
            NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
                                                                 ();
            for (int i = 0; i < 500; i++)
            {
                handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value "
                                                                                  + i));
            }
            NeoDatis.Odb.OID oid = odb.Store(handler);
            odb.Close();
            odb = Open("valuesSubList2");
            NeoDatis.Odb.Test.Query.Values.Handler h = (NeoDatis.Odb.Test.Query.Values.Handler
                                                        )odb.GetObjectFromId(oid);
            Println("size of list = " + h.GetListOfParameters().Count);
            long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();

            NeoDatis.Odb.Values values = odb.GetValues(new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery
                                                           (typeof(NeoDatis.Odb.Test.Query.Values.Handler)).Sublist("parameters", "sub", 490
                                                                                                                    , 5, true).Size("parameters", "size"));
            long end = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();

            Println("time to load sublist of 5 itens from 40000 : " + (end - start));
            Println(values);
            NeoDatis.Odb.ObjectValues ov      = values.NextValues();
            System.Collections.IList  sublist = (System.Collections.IList)ov.GetByAlias("sub");
            AssertEquals(5, sublist.Count);
            long size = (long)ov.GetByAlias("size");

            AssertEquals(500, size);
            NeoDatis.Odb.Test.Query.Values.Parameter p = (NeoDatis.Odb.Test.Query.Values.Parameter
                                                          )sublist[0];
            AssertEquals("value 490", p.GetValue());
            NeoDatis.Odb.Test.Query.Values.Parameter p2 = (NeoDatis.Odb.Test.Query.Values.Parameter
                                                           )sublist[4];
            AssertEquals("value 494", p2.GetValue());
            odb.Close();
        }
Пример #8
0
        /// <summary>Check if objects of list are known by ODB</summary>
        /// <exception cref="System.IO.IOException"></exception>
        /// <exception cref="System.Exception"></exception>
        public virtual void Test6()
        {
            int sublistSize = 400;

            if (!isLocal && !useSameVmOptimization)
            {
                sublistSize = 40;
            }
            string baseName = GetBaseName();

            DeleteBase(baseName);
            NeoDatis.Odb.ODB odb = Open(baseName);
            NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
                                                                 ();
            for (int i = 0; i < sublistSize; i++)
            {
                handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value "
                                                                                  + i));
            }
            odb.Store(handler);
            odb.Close();
            odb = Open("valuesSubList3");
            long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();

            NeoDatis.Odb.Core.Query.IQuery q = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
                                                   (typeof(NeoDatis.Odb.Test.Query.Values.Handler));
            NeoDatis.Odb.Objects objects = odb.GetObjects(q);
            long end = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();

            NeoDatis.Odb.Test.Query.Values.Handler h = (NeoDatis.Odb.Test.Query.Values.Handler
                                                        )objects.GetFirst();
            NeoDatis.Odb.Test.Query.Values.Parameter parameter = (NeoDatis.Odb.Test.Query.Values.Parameter
                                                                  )h.GetListOfParameters()[0];
            AssertEquals("value 0", parameter.GetValue());
            NeoDatis.Odb.OID oid = odb.GetObjectId(parameter);
            AssertNotNull(oid);
            odb.Close();
        }
Пример #9
0
        /// <summary>Using Object representation instead of real object</summary>
        /// <exception cref="System.IO.IOException"></exception>
        /// <exception cref="System.Exception"></exception>
        public virtual void Test3()
        {
            int sublistSize = 10000;

            DeleteBase("valuesSubList3");
            NeoDatis.Odb.ODB odb = Open("valuesSubList3");
            NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
                                                                 ();
            for (int i = 0; i < sublistSize; i++)
            {
                handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value "
                                                                                  + i));
            }
            odb.Store(handler);
            odb.Close();
            odb = Open("valuesSubList3");
            long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();

            NeoDatis.Odb.Core.Query.IValuesQuery q = new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery
                                                         (typeof(NeoDatis.Odb.Test.Query.Values.Handler)).Sublist("parameters", "sub", 9990
                                                                                                                  , 5, true);
            q.SetReturnInstance(false);
            NeoDatis.Odb.Values values = odb.GetValues(q);
            long end = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();

            Println("time to load sublist of 5 itens from 40000 : " + (end - start));
            Println(values);
            NeoDatis.Odb.ObjectValues ov      = values.NextValues();
            System.Collections.IList  sublist = (System.Collections.IList)ov.GetByAlias("sub");
            AssertEquals(5, sublist.Count);
            NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo nnoi = (NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
                                                                             )sublist[0];
            AssertEquals("value 9990", nnoi.GetValueOf("value"));
            NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo nnoi2 = (NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
                                                                              )sublist[4];
            AssertEquals("value 9994", nnoi2.GetValueOf("value"));
            odb.Close();
        }
Пример #10
0
 /// <exception cref="System.IO.IOException"></exception>
 /// <exception cref="System.Exception"></exception>
 public virtual void Test1()
 {
     DeleteBase("valuesA1");
     NeoDatis.Odb.ODB odb = Open("valuesA1");
     NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
                                                          ();
     for (int i = 0; i < 10; i++)
     {
         handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value"
                                                                           + i));
     }
     odb.Store(handler);
     odb.Close();
     odb = Open("valuesA1");
     NeoDatis.Odb.Values values = odb.GetValues(new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery
                                                    (typeof(NeoDatis.Odb.Test.Query.Values.Handler)).Field("parameters"));
     Println(values);
     NeoDatis.Odb.ObjectValues ov = values.NextValues();
     System.Collections.IList  l  = (System.Collections.IList)ov.GetByAlias("parameters"
                                                                            );
     AssertEquals(10, l.Count);
     odb.Close();
 }
Пример #11
0
        public virtual void Test1()
		{
			DeleteBase("valuesA1");
			NeoDatis.Odb.ODB odb = Open("valuesA1");
			NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
				();
			for (int i = 0; i < 10; i++)
			{
				handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value"
					 + i));
			}
			odb.Store(handler);
			odb.Close();
			odb = Open("valuesA1");
			NeoDatis.Odb.Values values = odb.GetValues(new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery
				(typeof(NeoDatis.Odb.Test.Query.Values.Handler)).Field("parameters"));
			Println(values);
			NeoDatis.Odb.ObjectValues ov = values.NextValues();
			System.Collections.IList l = (System.Collections.IList)ov.GetByAlias("parameters"
				);
			AssertEquals(10, l.Count);
			odb.Close();
		}
Пример #12
0
        public virtual void Test6()
		{
			int sublistSize = 400;
			if (!isLocal && !useSameVmOptimization)
			{
				sublistSize = 40;
			}
			string baseName = GetBaseName();
			DeleteBase(baseName);
			NeoDatis.Odb.ODB odb = Open(baseName);
			NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
				();
			for (int i = 0; i < sublistSize; i++)
			{
				handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value "
					 + i));
			}
			odb.Store(handler);
			odb.Close();
			odb = Open("valuesSubList3");
			long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
			NeoDatis.Odb.Core.Query.IQuery q = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
				(typeof(NeoDatis.Odb.Test.Query.Values.Handler));
			NeoDatis.Odb.Objects objects = odb.GetObjects(q);
			long end = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
			NeoDatis.Odb.Test.Query.Values.Handler h = (NeoDatis.Odb.Test.Query.Values.Handler
				)objects.GetFirst();
			NeoDatis.Odb.Test.Query.Values.Parameter parameter = (NeoDatis.Odb.Test.Query.Values.Parameter
				)h.GetListOfParameters()[0];
			AssertEquals("value 0", parameter.GetValue());
			NeoDatis.Odb.OID oid = odb.GetObjectId(parameter);
			AssertNotNull(oid);
			odb.Close();
		}
Пример #13
0
        public virtual void Test5()
		{
			int sublistSize = 400;
			if (!isLocal && !useSameVmOptimization)
			{
				sublistSize = 40;
			}
			string baseName = GetBaseName();
			DeleteBase(baseName);
			NeoDatis.Odb.ODB odb = Open(baseName);
			NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
				();
			for (int i = 0; i < sublistSize; i++)
			{
				handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value "
					 + i));
			}
			odb.Store(handler);
			odb.Close();
			odb = Open("valuesSubList3");
			long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
			NeoDatis.Odb.Core.Query.IValuesQuery q = new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery
				(typeof(NeoDatis.Odb.Test.Query.Values.Handler)).Sublist("parameters", "sub", 0, 
				2, true);
			NeoDatis.Odb.Values values = odb.GetValues(q);
			long end = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
			Println("time to load sublist of 5 itens for " + sublistSize + " : " + (end - start
				));
			Println(values);
			NeoDatis.Odb.ObjectValues ov = values.NextValues();
			System.Collections.IList sublist = (System.Collections.IList)ov.GetByAlias("sub");
			AssertEquals(2, sublist.Count);
			NeoDatis.Odb.Test.Query.Values.Parameter parameter = (NeoDatis.Odb.Test.Query.Values.Parameter
				)sublist[1];
			AssertEquals("value 1", parameter.GetValue());
			NeoDatis.Odb.OID oid = odb.GetObjectId(parameter);
			Println(oid);
			odb.Close();
		}
Пример #14
0
        public virtual void Test3()
		{
			int sublistSize = 10000;
			DeleteBase("valuesSubList3");
			NeoDatis.Odb.ODB odb = Open("valuesSubList3");
			NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
				();
			for (int i = 0; i < sublistSize; i++)
			{
				handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value "
					 + i));
			}
			odb.Store(handler);
			odb.Close();
			odb = Open("valuesSubList3");
			long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
			NeoDatis.Odb.Core.Query.IValuesQuery q = new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery
				(typeof(NeoDatis.Odb.Test.Query.Values.Handler)).Sublist("parameters", "sub", 9990
				, 5, true);
			q.SetReturnInstance(false);
			NeoDatis.Odb.Values values = odb.GetValues(q);
			long end = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
			Println("time to load sublist of 5 itens from 40000 : " + (end - start));
			Println(values);
			NeoDatis.Odb.ObjectValues ov = values.NextValues();
			System.Collections.IList sublist = (System.Collections.IList)ov.GetByAlias("sub");
			AssertEquals(5, sublist.Count);
			NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo nnoi = (NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
				)sublist[0];
			AssertEquals("value 9990", nnoi.GetValueOf("value"));
			NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo nnoi2 = (NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
				)sublist[4];
			AssertEquals("value 9994", nnoi2.GetValueOf("value"));
			odb.Close();
		}
Пример #15
0
        public virtual void Test2()
		{
			DeleteBase("valuesSubList2");
			NeoDatis.Odb.ODB odb = Open("valuesSubList2");
			NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
				();
			for (int i = 0; i < 500; i++)
			{
				handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value "
					 + i));
			}
			NeoDatis.Odb.OID oid = odb.Store(handler);
			odb.Close();
			odb = Open("valuesSubList2");
			NeoDatis.Odb.Test.Query.Values.Handler h = (NeoDatis.Odb.Test.Query.Values.Handler
				)odb.GetObjectFromId(oid);
			Println("size of list = " + h.GetListOfParameters().Count);
			long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
			NeoDatis.Odb.Values values = odb.GetValues(new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery
				(typeof(NeoDatis.Odb.Test.Query.Values.Handler)).Sublist("parameters", "sub", 490
				, 5, true).Size("parameters", "size"));
			long end = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
			Println("time to load sublist of 5 itens from 40000 : " + (end - start));
			Println(values);
			NeoDatis.Odb.ObjectValues ov = values.NextValues();
			System.Collections.IList sublist = (System.Collections.IList)ov.GetByAlias("sub");
			AssertEquals(5, sublist.Count);
			long size = (long)ov.GetByAlias("size");
			AssertEquals(500, size);
			NeoDatis.Odb.Test.Query.Values.Parameter p = (NeoDatis.Odb.Test.Query.Values.Parameter
				)sublist[0];
			AssertEquals("value 490", p.GetValue());
			NeoDatis.Odb.Test.Query.Values.Parameter p2 = (NeoDatis.Odb.Test.Query.Values.Parameter
				)sublist[4];
			AssertEquals("value 494", p2.GetValue());
			odb.Close();
		}
Пример #16
0
        public virtual void Test11()
		{
			NeoDatis.Odb.ODB odb = NeoDatis.Odb.ODBFactory.Open("valuesSubList");
			NeoDatis.Odb.Test.Query.Values.Handler handler = new NeoDatis.Odb.Test.Query.Values.Handler
				();
			for (int i = 0; i < 10; i++)
			{
				handler.AddParameter(new NeoDatis.Odb.Test.Query.Values.Parameter("test " + i, "value "
					 + i));
			}
			odb.Store(handler);
			odb.Close();
			odb = Open("valuesSubList");
			NeoDatis.Odb.Values values = odb.GetValues(new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery
				(typeof(NeoDatis.Odb.Test.Query.Values.Handler)).Field("parameters").Sublist("parameters"
				, "sub1", 1, 5, true).Sublist("parameters", "sub2", 1, 10).Size("parameters", "size"
				));
			NeoDatis.Odb.ObjectValues ov = values.NextValues();
			// Retrieve Result values
			System.Collections.IList fulllist = (System.Collections.IList)ov.GetByAlias("parameters"
				);
			long size = (long)ov.GetByAlias("size");
			System.Collections.IList sublist = (System.Collections.IList)ov.GetByAlias("sub1"
				);
			odb.Close();
		}