protected override void OnSetUp() { id = new Id("stringKey", 3, firstDateTime); secondId = new Id("stringKey2", 5, secondDateTime); }
public ClassWithCompositeId(Id id ) { _id = id; }
public void Criteria() { Id id = new Id("stringKey", 3, firstDateTime); ClassWithCompositeId cId = new ClassWithCompositeId(id); cId.OneProperty = 5; // add the new instance to the session so I have something to get results // back for ISession s = OpenSession(); s.Save(cId); s.Flush(); s.Close(); s = OpenSession(); ICriteria c = s.CreateCriteria(typeof(ClassWithCompositeId)); c.Add( Expression.Expression.Eq("Id", id) ); // right now just want to see if the Criteria is valid IList results = c.List(); Assert.AreEqual(1, results.Count); s.Close(); }