Пример #1
0
        public virtual void Test1()
        {
            NeoDatis.Tool.IOUtil.DeleteFile("base1.neodatis");
            NeoDatis.Odb.ODB odb    = NeoDatis.Odb.ODBFactory.Open("base1.neodatis");
            string[]         fields = new string[] { "int1" };
            odb.GetClassRepresentation(typeof(NeoDatis.Odb.Test.VO.Attribute.TestClass)).AddUniqueIndexOn
                ("index1", fields, true);
            long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
            int  size  = 50;

            for (int i = 0; i < size; i++)
            {
                NeoDatis.Odb.Test.VO.Attribute.TestClass testClass = new NeoDatis.Odb.Test.VO.Attribute.TestClass
                                                                         ();
                testClass.SetBigDecimal1(new System.Decimal(i));
                testClass.SetBoolean1(i % 3 == 0);
                testClass.SetChar1((char)(i % 5));
                testClass.SetDate1(new System.DateTime(start + i));
                testClass.SetDouble1(((double)(i % 10)) / size);
                testClass.SetInt1(size - i);
                testClass.SetString1("test class " + i);
                odb.Store(testClass);
            }
            // println(testClass.getDouble1() + " | " + testClass.getString1() +
            // " | " + testClass.getInt1());
            odb.Close();
        }
Пример #2
0
        public virtual void Test1()
		{
			NeoDatis.Tool.IOUtil.DeleteFile("base1.neodatis");
			NeoDatis.Odb.ODB odb = NeoDatis.Odb.ODBFactory.Open("base1.neodatis");
			string[] fields = new string[] { "int1" };
			odb.GetClassRepresentation(typeof(NeoDatis.Odb.Test.VO.Attribute.TestClass)).AddUniqueIndexOn
				("index1", fields, true);
			long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
			int size = 50;
			for (int i = 0; i < size; i++)
			{
				NeoDatis.Odb.Test.VO.Attribute.TestClass testClass = new NeoDatis.Odb.Test.VO.Attribute.TestClass
					();
				testClass.SetBigDecimal1(new System.Decimal(i));
				testClass.SetBoolean1(i % 3 == 0);
				testClass.SetChar1((char)(i % 5));
				testClass.SetDate1(new System.DateTime(start + i));
				testClass.SetDouble1(((double)(i % 10)) / size);
				testClass.SetInt1(size - i);
				testClass.SetString1("test class " + i);
				odb.Store(testClass);
			}
			// println(testClass.getDouble1() + " | " + testClass.getString1() +
			// " | " + testClass.getInt1());
			odb.Close();
		}
Пример #3
0
		private NeoDatis.Odb.Test.VO.Attribute.TestClass GetTestClassInstance()
		{
			NeoDatis.Odb.Test.VO.Attribute.TestClass tc = new NeoDatis.Odb.Test.VO.Attribute.TestClass
				();
			tc.SetBigDecimal1(new System.Decimal(1.123456789));
			tc.SetBoolean1(true);
			tc.SetChar1('d');
			tc.SetDouble1(154.78998989);
			tc.SetInt1(78964);
			tc.SetString1("Ola chico como vc est√° ???");
			tc.SetDate1(new System.DateTime());
			return tc;
		}
Пример #4
0
 private NeoDatis.Odb.Test.VO.Attribute.TestClass GetTestClassInstance()
 {
     NeoDatis.Odb.Test.VO.Attribute.TestClass tc = new NeoDatis.Odb.Test.VO.Attribute.TestClass
                                                       ();
     tc.SetBigDecimal1(new System.Decimal(1.123456789));
     tc.SetBoolean1(true);
     tc.SetChar1('d');
     tc.SetDouble1(154.78998989);
     tc.SetInt1(78964);
     tc.SetString1("Ola chico como vc est√° ???");
     tc.SetDate1(new System.DateTime());
     return(tc);
 }