| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 43 | 2 | 1 | 0.999 | statement_list[34] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 43 | 47 | src/NHibernate.Test/DynamicEntity/Interceptor/InterceptorDynamicEntity.cs |
| 2 | 43 | 63 | src/NHibernate.Test/DynamicEntity/Tuplizer/TuplizerDynamicEntity.cs |
| ||||
customer = session.Load < Customer > (customer.Id);
Assert.IsFalse(NHibernateUtil.IsInitialized(customer), "should-be-proxy was initialized");
customer.Name = "other";
session.Flush();
Assert.IsFalse(NHibernateUtil.IsInitialized(customer.Company), "should-be-proxy was initialized");
session.Refresh(customer);
Assert.AreEqual("other", customer.Name, "name not updated");
Assert.AreEqual("acme", customer.Company.Name, "company association not correct");
session.Transaction.Commit();
session.Close();
// Test detached entity re-attachment with these dyna-proxies
customer.Name = "Steve";
session = OpenSession();
session.BeginTransaction();
session.Update(customer);
session.Flush();
session.Refresh(customer);
Assert.AreEqual("Steve", customer.Name, "name not updated");
session.Transaction.Commit();
session.Close();
// Test querying
session = OpenSession();
session.BeginTransaction();
int count = session.CreateQuery("from Customer").List().Count;
Assert.AreEqual(1, count, "querying dynamic entity");
session.Clear();
count = session.CreateQuery("from Person").List().Count;
Assert.AreEqual(1, count, "querying dynamic entity");
session.Transaction.Commit();
session.Close();
// test deleteing
session = OpenSession();
session.BeginTransaction();
session.Delete(company);
session.Delete(customer);
session.Transaction.Commit();
session.Close();
|
| ||||
customer = session.Load < Customer > (customer.Id);
Assert.IsFalse(NHibernateUtil.IsInitialized(customer), "should-be-proxy was initialized");
customer.Name = "other";
session.Flush();
Assert.IsFalse(NHibernateUtil.IsInitialized(customer.Company), "should-be-proxy was initialized");
session.Refresh(customer);
Assert.AreEqual("other", customer.Name, "name not updated");
Assert.AreEqual("acme", customer.Company.Name, "company association not correct");
session.Transaction.Commit();
session.Close();
// Test detached entity re-attachment with these dyna-proxies
customer.Name = "Steve";
session = OpenSession();
session.BeginTransaction();
session.Update(customer);
session.Flush();
session.Refresh(customer);
Assert.AreEqual("Steve", customer.Name, "name not updated");
session.Transaction.Commit();
session.Close();
// Test querying
session = OpenSession();
session.BeginTransaction();
int count = session.CreateQuery("from Customer").List().Count;
Assert.AreEqual(1, count, "querying dynamic entity");
session.Clear();
count = session.CreateQuery("from Person").List().Count;
Assert.AreEqual(3, count, "querying dynamic entity");
session.Transaction.Commit();
session.Close();
// test deleteing
session = OpenSession();
session.BeginTransaction();
session.Delete(company);
session.Delete(customer);
session.Transaction.Commit();
session.Close();
|
| |||
customer = session.Load < Customer > (customer.Id);
Assert.IsFalse(NHibernateUtil.IsInitialized(customer), "should-be-proxy was initialized");
customer.Name = "other";
session.Flush();
Assert.IsFalse(NHibernateUtil.IsInitialized(customer.Company), "should-be-proxy was initialized");
session.Refresh(customer);
Assert.AreEqual("other", customer.Name, "name not updated");
Assert.AreEqual("acme", customer.Company.Name, "company association not correct");
session.Transaction.Commit();
session.Close();
// Test detached entity re-attachment with these dyna-proxies
customer.Name = "Steve";
session = OpenSession();
session.BeginTransaction();
session.Update(customer);
session.Flush();
session.Refresh(customer);
Assert.AreEqual("Steve", customer.Name, "name not updated");
session.Transaction.Commit();
session.Close();
// Test querying
session = OpenSession();
session.BeginTransaction();
int count = session.CreateQuery("from Customer").List().Count;
Assert.AreEqual(1, count, "querying dynamic entity");
session.Clear();
count = session.CreateQuery("from Person").List().Count;
Assert.AreEqual( [[#variable6fee4100]], count, "querying dynamic entity");
session.Transaction.Commit();
session.Close();
// test deleteing
session = OpenSession();
session.BeginTransaction();
session.Delete(company);
session.Delete(customer);
session.Transaction.Commit();
session.Close();
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#6fee4100]] | 1 |
| 1 | 2 | [[#6fee4100]] | 3 |