CloneSet129


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
36210.997statement_list[16]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
13641
src/NHibernate.Test/SubclassFilterTest/DiscrimSubclassFilterTest.cs
23660
src/NHibernate.Test/SubclassFilterTest/JoinedSubclassFilterTest.cs
Clone Instance
1
Line Count
36
Source Line
41
Source File
src/NHibernate.Test/SubclassFilterTest/DiscrimSubclassFilterTest.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();


Clone Instance
2
Line Count
36
Source Line
60
Source File
src/NHibernate.Test/SubclassFilterTest/JoinedSubclassFilterTest.cs

                        // 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();


Clone AbstractionParameter Count: 1Parameter Bindings

// 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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#6e5dc540]]
1 
12[[#6e5dc540]]
2