public void MultipleEntitiesPerIndex() { ISession s = OpenSession(); ITransaction tx = s.BeginTransaction(); DocumentTop document = new DocumentTop("Hibernate in Action", "Object/relational mapping with Hibernate", "blah blah blah"); s.Save(document); s.Flush(); int tempAux = document.Id; s.Save(new AlternateDocument(tempAux, "Hibernate in Action", "Object/relational mapping with Hibernate", "blah blah blah")); tx.Commit(); s.Close(); Assert.AreEqual(0, GetDocumentNbr()); s = OpenSession(); tx = s.BeginTransaction(); s.Delete(s.Get(typeof(AlternateDocument), document.Id)); s.Delete(s.CreateCriteria(typeof(DocumentTop)).UniqueResult()); tx.Commit(); s.Close(); }