示例#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();
        }
        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
 /// <exception cref="System.Exception"></exception>
 public virtual void TestStringPersistence()
 {
     NeoDatis.Odb.ODB odb = null;
     try
     {
         odb = Open("date.neodatis");
         NeoDatis.Odb.Test.VO.Attribute.TestClass tc1 = new NeoDatis.Odb.Test.VO.Attribute.TestClass
                                                            ();
         tc1.SetString1(string.Empty);
         odb.Store(tc1);
         odb.Close();
         odb = Open("date.neodatis");
         NeoDatis.Odb.Objects l = odb.GetObjects(typeof(NeoDatis.Odb.Test.VO.Attribute.TestClass
                                                        ));
         AssertEquals(1, l.Count);
         NeoDatis.Odb.Test.VO.Attribute.TestClass tc2 = (NeoDatis.Odb.Test.VO.Attribute.TestClass
                                                         )l.GetFirst();
         AssertEquals(string.Empty, tc2.GetString1());
         AssertEquals(null, tc2.GetBigDecimal1());
         AssertEquals(null, tc2.GetDouble1());
     }
     finally
     {
         if (odb != null)
         {
             odb.Close();
         }
     }
 }
示例#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;
		}
示例#5
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);
 }
示例#6
0
		/// <exception cref="System.Exception"></exception>
		public virtual void TestStringPersistence()
		{
			NeoDatis.Odb.ODB odb = null;
			try
			{
				odb = Open("date.neodatis");
				NeoDatis.Odb.Test.VO.Attribute.TestClass tc1 = new NeoDatis.Odb.Test.VO.Attribute.TestClass
					();
				tc1.SetString1(string.Empty);
				odb.Store(tc1);
				odb.Close();
				odb = Open("date.neodatis");
				NeoDatis.Odb.Objects l = odb.GetObjects(typeof(NeoDatis.Odb.Test.VO.Attribute.TestClass
					));
				AssertEquals(1, l.Count);
				NeoDatis.Odb.Test.VO.Attribute.TestClass tc2 = (NeoDatis.Odb.Test.VO.Attribute.TestClass
					)l.GetFirst();
				AssertEquals(string.Empty, tc2.GetString1());
				AssertEquals(null, tc2.GetBigDecimal1());
				AssertEquals(null, tc2.GetDouble1());
			}
			finally
			{
				if (odb != null)
				{
					odb.Close();
				}
			}
		}