Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
28 | 2 | 3 | 0.960 | statement_list[16] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 28 | 95 | src/NHibernate.Test/Naturalid/Mutable/MutableNaturalIdFixture.cs |
2 | 26 | 163 | src/NHibernate.Test/Naturalid/Mutable/MutableNaturalIdFixture.cs |
| ||||
User u = new User("gavin", "hb", "secret"); s.Persist(u); t.Commit(); s.Close(); sessions.Statistics.Clear(); s = OpenSession(); t = s.BeginTransaction(); u = (User) s.CreateCriteria( typeof( User)).Add(Restrictions.NaturalId().Set("name", "gavin").Set("org", "hb")).SetCacheable( true).UniqueResult(); Assert.That(u, Is.Not.Null); t.Commit(); s.Close(); Assert.AreEqual(1, sessions.Statistics.QueryExecutionCount); Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); Assert.AreEqual(1, sessions.Statistics.QueryCachePutCount); sessions.Statistics.Clear(); s = OpenSession(); |
| ||||
User u = new User("gavin", "hb", "secret"); s.Persist(u); t.Commit(); s.Close(); sessions.Statistics.Clear(); s = OpenSession(); t = s.BeginTransaction(); u = (User) s.CreateCriteria( typeof( User)). Add(Restrictions.NaturalId().Set("name", "gavin").Set("org", "hb")). SetCacheable(true).UniqueResult(); Assert.That(u, Is.Not.Null); t.Commit(); s.Close(); Assert.AreEqual(1, sessions.Statistics.QueryExecutionCount); Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); Assert.AreEqual(1, sessions.Statistics.QueryCachePutCount); s = OpenSession(); t = s.BeginTransaction(); |
| |||
User u = new User("gavin", "hb", "secret"); s.Persist(u); t.Commit(); s.Close(); sessions.Statistics.Clear(); s = OpenSession(); t = s.BeginTransaction(); u = (User)s.CreateCriteria( typeof(User)).Add(Restrictions.NaturalId().Set("name", "gavin").Set("org", "hb")).SetCacheable(true).UniqueResult(); Assert.That(u, Is.Not.Null); t.Commit(); s.Close(); Assert.AreEqual(1, sessions.Statistics.QueryExecutionCount); Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); Assert.AreEqual(1, sessions.Statistics.QueryCachePutCount); [[#variable4d5759c0]]; [[#variable49dbfde0]]= [[#variable4d575340]](); |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#4d5759c0]] | sessions.Statistics.Clear() |
1 | 2 | [[#4d5759c0]] | s = OpenSession() |
2 | 1 | [[#49dbfde0]] | s |
2 | 2 | [[#49dbfde0]] | t |
3 | 1 | [[#4d575340]] | OpenSession |
3 | 2 | [[#4d575340]] | s.BeginTransaction |