Beispiel #1
0
        public virtual void Test2()
		{
			NeoDatis.Odb.ODB odb = Open("cyclic.neodatis");
			NeoDatis.Odb.Objects<Country2> l = odb.GetObjects<Country2>(true);
			Country2 country = l.GetFirst();
			City city = new City("rio de janeiro");
			country.SetCapital(city);
			odb.Store(country);
			odb.Close();
			odb = Open("cyclic.neodatis");
			l = odb.GetObjects<Country2>(true);
			country = (Country2)l.GetFirst();
			AssertEquals("rio de janeiro", country.GetCapital().GetName());
			l = odb.GetObjects<City>(new CriteriaQuery(Where.Equal("name", "rio de janeiro")));
			AssertEquals(1, l.Count);
			l = odb.GetObjects<City>(new CriteriaQuery());
			AssertEquals(2, l.Count);
			odb.Close();
		}
Beispiel #2
0
		/// <exception cref="System.Exception"></exception>
		public override void SetUp()
		{
			base.SetUp();
			DeleteBase("cyclic.neodatis");
			NeoDatis.Odb.ODB odb = Open("cyclic.neodatis");
			for (int i = 0; i < 1; i++)
			{
				City brasilia = new City
					("Brasilia" + i);
				Country2 brasil = new Country2
					("Brasil" + i);
				brasilia.SetCountry(brasil);
				brasil.SetCapital(brasilia);
				brasil.SetPopulation(450000);
				odb.Store(brasil);
			}
			odb.Store(new User("name", "email", new Profile("profile")));
			odb.Close();
		}