Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
36 | 2 | 1 | 0.997 | statement_list[16] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 36 | 41 | src/NHibernate.Test/SubclassFilterTest/DiscrimSubclassFilterTest.cs |
2 | 36 | 60 | src/NHibernate.Test/SubclassFilterTest/JoinedSubclassFilterTest.cs |
| ||||
results = new ArrayList(new HashedSet(s.CreateQuery("from Person as p left join fetch p.Minions").List())); Assert.AreEqual(4, results.Count, "Incorrect qry result count"); foreach (Person p in results) { // find john if (p.Name.Equals("John Doe")) { Employee john = (Employee) p; Assert.AreEqual(1, john.Minions.Count, "Incorrect fecthed minions count"); break; } } s.Clear(); results = new ArrayList(new HashedSet(s.CreateQuery("from Employee as p left join fetch p.Minions").List())); Assert.AreEqual(2, results.Count, "Incorrect qry result count"); foreach (Person p in results) { if (p.Name.Equals("John Doe")) { Employee john = (Employee) p; Assert.AreEqual(1, john.Minions.Count, "Incorrect fecthed minions count"); break; } } t.Commit(); s.Close(); s = OpenSession(); t = s.BeginTransaction(); s.Delete("from Customer c where c.ContactOwner is not null"); s.Delete("from Employee e where e.Manager is not null"); s.Delete("from Person"); t.Commit(); s.Close(); |
| ||||
// TODO : currently impossible to define a collection-level filter w/ // joined-subclass elements that will filter based on a superclass // column and function correctly in (theta only?) outer joins; // this is consistent with the behaviour of a collection-level where. // this might be one argument for "pulling" the attached class-level // filters into collection assocations, // although we'd need some way to apply the appropriate alias in that // scenario. results = new ArrayList(new HashedSet(s.CreateQuery("from Person as p left join fetch p.Minions").List())); Assert.AreEqual(4, results.Count, "Incorrect qry result count"); foreach (Person p in results) { if (p.Name.Equals("John Doe")) { Employee john = (Employee) p; Assert.AreEqual(2, john.Minions.Count, "Incorrect fecthed minions count"); break; } } s.Clear(); results = new ArrayList(new HashedSet(s.CreateQuery("from Employee as p left join fetch p.Minions").List())); Assert.AreEqual(2, results.Count, "Incorrect qry result count"); foreach (Person p in results) { if (p.Name.Equals("John Doe")) { Employee john = (Employee) p; Assert.AreEqual(2, john.Minions.Count, "Incorrect fecthed minions count"); break; } } t.Commit(); s.Close(); s = OpenSession(); t = s.BeginTransaction(); s.Delete("from Customer c where c.ContactOwner is not null"); s.Delete("from Employee e where e.Manager is not null"); s.Delete("from Person"); t.Commit(); s.Close(); |
| |||
// TODO : currently impossible to define a collection-level filter w/ // joined-subclass elements that will filter based on a superclass // column and function correctly in (theta only?) outer joins; // this is consistent with the behaviour of a collection-level where. // this might be one argument for "pulling" the attached class-level // filters into collection assocations, // although we'd need some way to apply the appropriate alias in that // scenario. results = new ArrayList(new HashedSet(s.CreateQuery("from Person as p left join fetch p.Minions").List())); Assert.AreEqual(4, results.Count, "Incorrect qry result count"); foreach (Person p in results) { // find john if (p.Name.Equals("John Doe")) { Employee john = (Employee)p; Assert.AreEqual( [[#variable6e5dc540]], john.Minions.Count, "Incorrect fecthed minions count"); break; } } s.Clear(); results = new ArrayList(new HashedSet(s.CreateQuery("from Employee as p left join fetch p.Minions").List())); Assert.AreEqual(2, results.Count, "Incorrect qry result count"); foreach (Person p in results) { if (p.Name.Equals("John Doe")) { Employee john = (Employee)p; Assert.AreEqual( [[#variable6e5dc540]], john.Minions.Count, "Incorrect fecthed minions count"); break; } } t.Commit(); s.Close(); s = OpenSession(); t = s.BeginTransaction(); s.Delete("from Customer c where c.ContactOwner is not null"); s.Delete("from Employee e where e.Manager is not null"); s.Delete("from Person"); t.Commit(); s.Close(); |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#6e5dc540]] | 1 |
1 | 2 | [[#6e5dc540]] | 2 |