Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
24 | 2 | 3 | 0.987 | class_member_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 24 | 206 | src/NHibernate.Test/SecondLevelCacheTest/SecondLevelCacheTest.cs |
2 | 24 | 233 | src/NHibernate.Test/SecondLevelCacheTest/SecondLevelCacheTest.cs |
| ||||
[Test] public void SecondLevelCacheWithHqlQueriesForItemWithCollections() { using (ISession session = OpenSession()) { IList list = session.CreateQuery("from Item i where i.Id > 2"). SetCacheable(true). List(); Assert.AreEqual(3, list.Count); using (IDbCommand cmd = session.Connection.CreateCommand()) { cmd.CommandText = "DELETE FROM Item"; cmd.ExecuteNonQuery(); } } using (ISession session = OpenSession()) { //should bring from cache IList list = session.CreateQuery("from Item i where i.Id > 2"). SetCacheable(true). List(); Assert.AreEqual(3, list.Count); } } |
| ||||
[Test] public void SecondLevelCacheWithHqlQueries() { using (ISession session = OpenSession()) { IList list = session.CreateQuery("from AnotherItem i where i.Id > 2"). SetCacheable(true). List(); Assert.AreEqual(3, list.Count); using (IDbCommand cmd = session.Connection.CreateCommand()) { cmd.CommandText = "DELETE FROM AnotherItem"; cmd.ExecuteNonQuery(); } } using (ISession session = OpenSession()) { //should bring from cache IList list = session.CreateQuery("from AnotherItem i where i.Id > 2"). SetCacheable(true). List(); Assert.AreEqual(3, list.Count); } } |
| |||
[Test] public void [[#variable4b22fd60]]() { using (ISession session = OpenSession()) { IList list = session.CreateQuery( [[#variable4b22fca0]]).SetCacheable(true).List(); Assert.AreEqual(3, list.Count); using (IDbCommand cmd = session.Connection.CreateCommand()) { cmd.CommandText = [[#variable4b22fc00]]; cmd.ExecuteNonQuery(); } } using (ISession session = OpenSession()) { //should bring from cache IList list = session.CreateQuery( [[#variable4b22fca0]]).SetCacheable(true).List(); Assert.AreEqual(3, list.Count); } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#4b22fd60]] | SecondLevelCacheWithHqlQueriesForItemWithCollections |
1 | 2 | [[#4b22fd60]] | SecondLevelCacheWithHqlQueries |
2 | 1 | [[#4b22fca0]] | "from Item i where i.Id > 2" |
2 | 2 | [[#4b22fca0]] | "from AnotherItem i where i.Id > 2" |
3 | 1 | [[#4b22fc00]] | "DELETE FROM Item" |
3 | 2 | [[#4b22fc00]] | "DELETE FROM AnotherItem" |