public FetchSpecs(SqLiteNHibernateFixture fixture) : base(fixture) { using (var tx = Session.BeginTransaction()) { var person = new PersonEntity(); CarEntity car; car = new CarEntity{Owner = person}; person.Cars.Add(car); car = new CarEntity{Owner = person}; person.Cars.Add(car); PetEntity pet; pet = new PetEntity {Owner = person}; person.Pets.Add(pet); pet = new PetEntity {Owner = person}; person.Pets.Add(pet); var employer = new EmployerEntity(); Session.Save(employer); employer.Employees.Add(person); person.Employer = employer; Session.Save(person); tx.Commit(); } Session.Clear(); SessionFactory.Statistics.Clear(); }
public FetchManySpecs(SqLiteNHibernateFixture fixture) : base(fixture) { using (var tx = Session.BeginTransaction()) { EmployerEntity employer; PersonEntity person; RepresentativeEntity representative; CarEntity car; employer = new EmployerEntity(); Session.Save(employer); representative = new RepresentativeEntity(); Session.Save(representative); person = new PersonEntity { Employer = employer, Representative = representative }; representative.Constituents.Add(person); employer.Employees.Add(person); car = new CarEntity { Owner = person }; person.Cars.Add(car); car = new CarEntity { Owner = person }; person.Cars.Add(car); Session.Save(person); representative = new RepresentativeEntity(); Session.Save(representative); person = new PersonEntity { Employer = employer, Representative = representative }; representative.Constituents.Add(person); employer.Employees.Add(person); car = new CarEntity { Owner = person }; person.Cars.Add(car); car = new CarEntity { Owner = person }; person.Cars.Add(car); Session.Save(person); tx.Commit(); } Session.Clear(); SessionFactory.Statistics.Clear(); }