/// <summary>Test update object list.</summary> /// <remarks> /// Test update object list. A list of Integer. 1000 updates, increasing /// number of elements /// </remarks> /// <exception cref="System.Exception"></exception> public virtual void TestList4Update5() { DeleteBase("list5.neodatis"); NeoDatis.Odb.ODB odb = Open("list5.neodatis"); ObjectWithListOfInteger o = new ObjectWithListOfInteger ("test"); o.GetListOfIntegers().Add(System.Convert.ToInt32("100")); odb.Store(o); odb.Close(); int size = isLocal ? 1000 : 100; for (int i = 0; i < size; i++) { NeoDatis.Odb.ODB odb2 = Open("list5.neodatis"); NeoDatis.Odb.Objects <ObjectWithListOfInteger> ll = odb2.GetObjects <ObjectWithListOfInteger>(true); ObjectWithListOfInteger o2 = (ObjectWithListOfInteger )ll.GetFirst(); o2.GetListOfIntegers().Add(200 + i); odb2.Store(o2); odb2.Close(); } NeoDatis.Odb.ODB odb3 = Open("list5.neodatis"); NeoDatis.Odb.Objects <ObjectWithListOfInteger> l = odb3.GetObjects <ObjectWithListOfInteger>(true); AssertEquals(1, l.Count); ObjectWithListOfInteger o3 = l.GetFirst(); AssertEquals(size + 1, o3.GetListOfIntegers().Count); odb3.Close(); DeleteBase("list5.neodatis"); }
/// <summary>Test update object list.</summary> /// <remarks>Test update object list. A list of Integer</remarks> /// <exception cref="System.Exception"></exception> public virtual void TestList4Update3() { DeleteBase("list5.neodatis"); NeoDatis.Odb.ODB odb = Open("list5.neodatis"); ObjectWithListOfInteger o = new ObjectWithListOfInteger ("test"); o.GetListOfIntegers().Add(System.Convert.ToInt32("100")); odb.Store(o); odb.Close(); NeoDatis.Odb.ODB odb2 = Open("list5.neodatis"); NeoDatis.Odb.Objects <ObjectWithListOfInteger> l = odb2.GetObjects <ObjectWithListOfInteger>(true); ObjectWithListOfInteger o2 = (ObjectWithListOfInteger )l.GetFirst(); o2.GetListOfIntegers().Clear(); o2.GetListOfIntegers().Add(System.Convert.ToInt32("200")); odb2.Store(o2); odb2.Close(); odb2 = Open("list5.neodatis"); l = odb2.GetObjects > ObjectWithListOfInteger > (true); AssertEquals(1, l.Count); ObjectWithListOfInteger o3 = l.GetFirst(); AssertEquals(1, o3.GetListOfIntegers().Count); AssertEquals(System.Convert.ToInt32("200"), o3.GetListOfIntegers()[0]); odb2.Close(); DeleteBase("list5.neodatis"); }
/// <summary>Test update object list.</summary> /// <remarks> /// Test update object list. A list of Integer. 1000 updates of an object /// that is the middle of the list /// </remarks> /// <exception cref="System.Exception"></exception> public virtual void TestList4Update4Middle() { DeleteBase("list5.neodatis"); NeoDatis.Odb.ODB odb = Open("list5.neodatis"); ObjectWithListOfInteger o = new ObjectWithListOfInteger ("test1"); o.GetListOfIntegers().Add(System.Convert.ToInt32("101")); odb.Store(o); o = new ObjectWithListOfInteger("test2"); o.GetListOfIntegers().Add(System.Convert.ToInt32("102")); odb.Store(o); o = new ObjectWithListOfInteger("test3"); o.GetListOfIntegers().Add(System.Convert.ToInt32("103")); odb.Store(o); odb.Close(); int size = isLocal ? 1000 : 100; for (int i = 0; i < size; i++) { NeoDatis.Odb.ODB odb2 = Open("list5.neodatis"); NeoDatis.Odb.Objects <ObjectWithListOfInteger> ll = odb2.GetObjects <ObjectWithListOfInteger>(CriteriaQuery (NeoDatis.Odb.Core.Query.Criteria.Where.Equal("name", "test2"))); ObjectWithListOfInteger o2 = ll.GetFirst(); o2.GetListOfIntegers().Clear(); o2.GetListOfIntegers().Add(200 + i); odb2.Store(o2); odb2.Close(); } NeoDatis.Odb.ODB odb3 = Open("list5.neodatis"); NeoDatis.Odb.Objects <ObjectWithListOfInteger> l = odb3.GetObjects <ObjectWithListOfInteger>(new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery (NeoDatis.Odb.Core.Query.Criteria.Where .Equal("name", "test2"))); AssertEquals(1, l.Count); ObjectWithListOfInteger o3 = l.GetFirst(); AssertEquals(1, o3.GetListOfIntegers().Count); AssertEquals(200 + size - 1, o3.GetListOfIntegers()[0]); odb3.Close(); DeleteBase("list5.neodatis"); }
/// <summary>Test update object list.</summary> /// <remarks> /// Test update object list. A list of Integer. 1000 updates of an object /// increasing list nb elements that is the middle of the list /// </remarks> /// <exception cref="System.Exception"></exception> public virtual void TestList4Update4Middle2() { DeleteBase("list5.neodatis"); NeoDatis.Odb.ODB odb = Open("list5.neodatis"); ObjectWithListOfInteger o = new ObjectWithListOfInteger ("test1"); o.GetListOfIntegers().Add(System.Convert.ToInt32("101")); odb.Store(o); o = new ObjectWithListOfInteger("test2"); o.GetListOfIntegers().Add(System.Convert.ToInt32("102")); odb.Store(o); o = new ObjectWithListOfInteger("test3"); o.GetListOfIntegers().Add(System.Convert.ToInt32("103")); odb.Store(o); odb.Close(); int size = isLocal ? 1000 : 100; for (int i = 0; i < size; i++) { NeoDatis.Odb.ODB odb2 = Open("list5.neodatis"); NeoDatis.Odb.Objects<ObjectWithListOfInteger> ll = odb2.GetObjects<ObjectWithListOfInteger>(new CriteriaQuery(Where.Equal("name", "test2"))); ObjectWithListOfInteger o2 = ll.GetFirst(); o2.GetListOfIntegers().Add(200 + i); odb2.Store(o2); odb2.Close(); } NeoDatis.Odb.ODB odb3 = Open("list5.neodatis"); NeoDatis.Odb.Objects<ObjectWithListOfInteger> l = odb3.GetObjects<ObjectWithListOfInteger>(new CriteriaQuery(Where.Equal("name", "test2"))); AssertEquals(1, l.Count); ObjectWithListOfInteger o3 = l.GetFirst(); AssertEquals(1 + size, o3.GetListOfIntegers().Count); odb3.Close(); DeleteBase("list5.neodatis"); }
/// <summary>Test update object list.</summary> /// <remarks> /// Test update object list. A list of Integer. 1000 updates, increasing /// number of elements /// </remarks> /// <exception cref="System.Exception"></exception> public virtual void TestList4Update5() { DeleteBase("list5.neodatis"); NeoDatis.Odb.ODB odb = Open("list5.neodatis"); ObjectWithListOfInteger o = new ObjectWithListOfInteger ("test"); o.GetListOfIntegers().Add(System.Convert.ToInt32("100")); odb.Store(o); odb.Close(); int size = isLocal ? 1000 : 100; for (int i = 0; i < size; i++) { NeoDatis.Odb.ODB odb2 = Open("list5.neodatis"); NeoDatis.Odb.Objects<ObjectWithListOfInteger> ll = odb2.GetObjects<ObjectWithListOfInteger>(true); ObjectWithListOfInteger o2 = (ObjectWithListOfInteger )ll.GetFirst(); o2.GetListOfIntegers().Add(200 + i); odb2.Store(o2); odb2.Close(); } NeoDatis.Odb.ODB odb3 = Open("list5.neodatis"); NeoDatis.Odb.Objects<ObjectWithListOfInteger> l = odb3.GetObjects<ObjectWithListOfInteger>(true); AssertEquals(1, l.Count); ObjectWithListOfInteger o3 = l.GetFirst(); AssertEquals(size + 1, o3.GetListOfIntegers().Count); odb3.Close(); DeleteBase("list5.neodatis"); }
/// <summary>Test update object list.</summary> /// <remarks>Test update object list. A list of Integer</remarks> /// <exception cref="System.Exception"></exception> public virtual void TestList4Update3() { DeleteBase("list5.neodatis"); NeoDatis.Odb.ODB odb = Open("list5.neodatis"); ObjectWithListOfInteger o = new ObjectWithListOfInteger ("test"); o.GetListOfIntegers().Add(System.Convert.ToInt32("100")); odb.Store(o); odb.Close(); NeoDatis.Odb.ODB odb2 = Open("list5.neodatis"); NeoDatis.Odb.Objects<ObjectWithListOfInteger> l = odb2.GetObjects<ObjectWithListOfInteger>(true); ObjectWithListOfInteger o2 = (ObjectWithListOfInteger )l.GetFirst(); o2.GetListOfIntegers().Clear(); o2.GetListOfIntegers().Add(System.Convert.ToInt32("200")); odb2.Store(o2); odb2.Close(); odb2 = Open("list5.neodatis"); l = odb2.GetObjects>ObjectWithListOfInteger>(true); AssertEquals(1, l.Count); ObjectWithListOfInteger o3 = l.GetFirst(); AssertEquals(1, o3.GetListOfIntegers().Count); AssertEquals(System.Convert.ToInt32("200"), o3.GetListOfIntegers()[0]); odb2.Close(); DeleteBase("list5.neodatis"); }