public virtual void Test10() { DeleteBase("valuesA2"); NeoDatis.Odb.ODB odb = Open("valuesA2"); NeoDatis.Tool.StopWatch t = new NeoDatis.Tool.StopWatch(); t.Start(); int size = 1000; long sum = 0; for (int i = 0; i < size; i++) { NeoDatis.Odb.Test.VO.Attribute.TestClass tc1 = new NeoDatis.Odb.Test.VO.Attribute.TestClass (); tc1.SetInt1(i); odb.Store(tc1); sum += i; } odb.Close(); t.End(); Println(" time for insert = " + t.GetDurationInMiliseconds()); odb = Open("valuesA2"); t.Start(); NeoDatis.Odb.Core.Query.Values.ICustomQueryFieldAction custom = new NeoDatis.Odb.Test.Query.Values.TestCustomQueryFieldAction (); NeoDatis.Odb.Values values = odb.GetValues(new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery (typeof(NeoDatis.Odb.Test.VO.Attribute.TestClass)).Custom("int1", "custom of int1" , custom)); t.End(); NeoDatis.Odb.ObjectValues ov = values.NextValues(); System.Decimal c = (System.Decimal)ov.GetByAlias("custom of int1"); Println(c); Println(" time for count = " + t.GetDurationInMiliseconds()); odb.Close(); }
// Nothing to do /// <exception cref="System.Exception"></exception> public static void Main2(string[] args) { NeoDatis.Odb.ODB odb = null; NeoDatis.Odb.Impl.Core.Query.Values.CustomQueryFieldAction customAction = new NeoDatis.Odb.Test.Query.Values.TestCustomQueryFieldAction (); NeoDatis.Odb.Values values = odb.GetValues(new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery (typeof(NeoDatis.Odb.Test.Query.Values.Users)).Custom("nbLogins", "nb logged users" , customAction).Field("name")); }
// Nothing to do /// <exception cref="System.Exception"></exception> public static void Main2(string[] args) { NeoDatis.Odb.ODB odb = null; NeoDatis.Odb.Impl.Core.Query.Values.CustomQueryFieldAction customAction = new NeoDatis.Odb.Test.Query.Values.TestCustomQueryFieldAction (); NeoDatis.Odb.Values values = odb.GetValues(new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery (typeof(NeoDatis.Odb.Test.Query.Values.Users)).Custom("nbLogins", "nb logged users" , customAction).Field("name")); }
/// <summary>Custom</summary> /// <exception cref="System.IO.IOException"></exception> /// <exception cref="System.Exception"></exception> public virtual void Test10() { DeleteBase("valuesA2"); NeoDatis.Odb.ODB odb = Open("valuesA2"); NeoDatis.Tool.StopWatch t = new NeoDatis.Tool.StopWatch(); t.Start(); int size = 1000; long sum = 0; for (int i = 0; i < size; i++) { NeoDatis.Odb.Test.VO.Attribute.TestClass tc1 = new NeoDatis.Odb.Test.VO.Attribute.TestClass (); tc1.SetInt1(i); odb.Store(tc1); sum += i; } odb.Close(); t.End(); Println(" time for insert = " + t.GetDurationInMiliseconds()); odb = Open("valuesA2"); t.Start(); NeoDatis.Odb.Core.Query.Values.ICustomQueryFieldAction custom = new NeoDatis.Odb.Test.Query.Values.TestCustomQueryFieldAction (); NeoDatis.Odb.Values values = odb.GetValues(new NeoDatis.Odb.Impl.Core.Query.Values.ValuesCriteriaQuery (typeof(NeoDatis.Odb.Test.VO.Attribute.TestClass)).Custom("int1", "custom of int1" , custom)); t.End(); NeoDatis.Odb.ObjectValues ov = values.NextValues(); System.Decimal c = (System.Decimal)ov.GetByAlias("custom of int1"); Println(c); Println(" time for count = " + t.GetDurationInMiliseconds()); odb.Close(); }