| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 28 | 3 | 4 | 0.994 | class_member_declaration |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 28 | 36 | src/NHibernate.Test/NHSpecificTest/NH1159/Fixture.cs |
| 2 | 28 | 66 | src/NHibernate.Test/NHSpecificTest/NH1159/Fixture.cs |
| 3 | 29 | 96 | src/NHibernate.Test/NHSpecificTest/NH1159/Fixture.cs |
| ||||
[Test]
public void DoesNotFlushWithCriteriaWithCommit()
{
using (ISession session = OpenSession(new HibernateInterceptor()))
using (ITransaction tran = session.BeginTransaction())
{
session.FlushMode = FlushMode.Commit;
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(0));
Contact contact = session.Get < Contact > ((Int64)1);
contact.PreferredName = "Updated preferred name";
session.Flush();
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));
contact.Forename = "Updated forename";
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));
ICriteria query = session.CreateCriteria( typeof(ContactTitle));
query.Add(Expression.Eq("Id", (Int64)1));
query.UniqueResult<ContactTitle> ();
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));
contact.Surname = "Updated surname";
session.Flush();
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(2));
session.SaveOrUpdateCopy(contact);
}
}
|
| ||||
[Test]
public void DoesNotFlushWithCriteriaWithNever()
{
using (ISession session = OpenSession(new HibernateInterceptor()))
using (ITransaction tran = session.BeginTransaction())
{
session.FlushMode = FlushMode.Never;
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(0));
Contact contact = session.Get < Contact > ((Int64)1);
contact.PreferredName = "Updated preferred name";
session.Flush();
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));
contact.Forename = "Updated forename";
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));
ICriteria query = session.CreateCriteria( typeof(ContactTitle));
query.Add(Expression.Eq("Id", (Int64)1));
query.UniqueResult<ContactTitle> ();
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));
contact.Surname = "Updated surname";
session.Flush();
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(2));
session.SaveOrUpdateCopy(contact);
}
}
|
| ||||
[Test]
public void DoesNotFlushWithCriteriaWithAuto()
{
using (ISession session = OpenSession(new HibernateInterceptor()))
using (ITransaction tran = session.BeginTransaction())
{
session.FlushMode = FlushMode.Auto;
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(0));
Contact contact = session.Get < Contact > ((Int64)1);
contact.PreferredName = "Updated preferred name";
session.Flush();
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));
contact.Forename = "Updated forename";
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));
ICriteria query = session.CreateCriteria( typeof(ContactTitle));
query.Add(Expression.Eq("Id", (Int64)1));
query.UniqueResult<ContactTitle> ();
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(2));
contact.Surname = "Updated surname";
session.Flush();
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(3));
session.SaveOrUpdateCopy(contact);
}
}
|
| |||
[Test]
public void [[#variable6c2fb520]]()
{
using (ISession session = OpenSession(new HibernateInterceptor()))
using (ITransaction tran = session.BeginTransaction())
{
session.FlushMode = FlushMode. [[#variable6c2fb4e0]];
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(0));
Contact contact = session.Get < Contact > ((Int64)1);
contact.PreferredName = "Updated preferred name";
session.Flush();
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));
contact.Forename = "Updated forename";
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));
ICriteria query = session.CreateCriteria( typeof(ContactTitle));
query.Add(Expression.Eq("Id", (Int64)1));
query.UniqueResult<ContactTitle> ();
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo( [[#variable4d7bf500]]));
contact.Surname = "Updated surname";
session.Flush();
Assert.That(HibernateInterceptor.CallCount, Is.EqualTo( [[#variable4d7bf260]]));
session.SaveOrUpdateCopy(contact);
}
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#6c2fb520]] | DoesNotFlushWithCriteriaWithCommit |
| 1 | 2 | [[#6c2fb520]] | DoesNotFlushWithCriteriaWithNever |
| 1 | 3 | [[#6c2fb520]] | DoesNotFlushWithCriteriaWithAuto |
| 2 | 1 | [[#6c2fb4e0]] | Commit |
| 2 | 2 | [[#6c2fb4e0]] | Never |
| 2 | 3 | [[#6c2fb4e0]] | Auto |
| 3 | 1 | [[#4d7bf500]] | 1 |
| 3 | 2 | [[#4d7bf500]] | 1 |
| 3 | 3 | [[#4d7bf500]] | 2 |
| 4 | 1 | [[#4d7bf260]] | 2 |
| 4 | 2 | [[#4d7bf260]] | 2 |
| 4 | 3 | [[#4d7bf260]] | 3 |