CloneSet201


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
27260.959class_member_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
12758
src/NHibernate.Test/NHSpecificTest/NH266/Fixture.cs
22491
src/NHibernate.Test/NHSpecificTest/NH266/Fixture.cs
Clone Instance
1
Line Count
27
Source Line
58
Source File
src/NHibernate.Test/NHSpecificTest/NH266/Fixture.cs

                [Test]
                public void BaseClassLoad()
                {
                        // just do a straight load
                        ISession s = OpenSession();
                        A a = s.Load( typeof(A), aId) as A;
                        Assert.AreEqual("the a", a.Name);
                        s.Close();


                        // load instance through hql
                        s = OpenSession();
                        IQuery q = s.CreateQuery("from A as a where a.id = :id ");
                        q.SetParameter("id", aId);
                        a = q.UniqueResult() as A;
                        Assert.AreEqual("the a", a.Name);

                        s.Close();

                        // load instance through Criteria
                        s = OpenSession();
                        ICriteria c = s.CreateCriteria( typeof(A));
                        c.Add(Expression.Eq("Id", aId));
                        a = c.UniqueResult() as A;

                        Assert.AreEqual("the a", a.Name);
                        s.Close();
                }



Clone Instance
2
Line Count
24
Source Line
91
Source File
src/NHibernate.Test/NHSpecificTest/NH266/Fixture.cs

                /// <summary>
                /// This is testing problems that existed in 0.8.0-2 with extra "AND"
                /// being added to the sql when there was a discriminator-value.
                /// </summary>
                [Test]
                public void SpecificSubclass()
                {
                        ISession s = OpenSession();
                        B b = s.Load( typeof(B), bId) as B;
                        Assert.AreEqual("the b", b.Name);
                        s.Close();

                        // load a instance of B through hql
                        s = OpenSession();
                        IQuery q = s.CreateQuery("from B as b where b.id = :id");
                        q.SetParameter("id", bId);
                        b = q.UniqueResult() as B;
                        Assert.AreEqual("the b", b.Name);
                        s.Close();

                        // load a instance of B through Criteria
                        s = OpenSession();
                        ICriteria c = s.CreateCriteria( typeof(B));
                        c.Add(Expression.Eq("Id", bId));
                        b = c.UniqueResult() as B;

                        Assert.AreEqual("the b", b.Name);
                        s.Close();
                }



Clone AbstractionParameter Count: 6Parameter Bindings

/// <summary>
/// This is testing problems that existed in 0.8.0-2 with extra "AND"
/// being added to the sql when there was a discriminator-value.
/// </summary>
[Test]
public void [[#variable66353e00]]()
{
   // just do a straight load
   ISession s = OpenSession();
    [[#variable66353d60]] [[#variable66353ce0]]= s.Load( typeof( [[#variable66353d60]]), [[#variable66353c80]]) as [[#variable66353d60]];
   Assert.AreEqual( [[#variable66353be0]], [[#variable66353ce0]].Name);
   s.Close();
   // load instance through hql
   // load a instance of B through hql
   s = OpenSession();
   IQuery q = s.CreateQuery( [[#variable66353b60]]);
   q.SetParameter("id", [[#variable66353c80]]);
    [[#variable66353ce0]]= q.UniqueResult() as [[#variable66353d60]];
   Assert.AreEqual( [[#variable66353be0]], [[#variable66353ce0]].Name);
   s.Close();
   // load instance through Criteria
   // load a instance of B through Criteria
   s = OpenSession();
   ICriteria c = s.CreateCriteria( typeof( [[#variable66353d60]]));
   c.Add(Expression.Eq("Id", [[#variable66353c80]]));
    [[#variable66353ce0]]= c.UniqueResult() as [[#variable66353d60]];
   Assert.AreEqual( [[#variable66353be0]], [[#variable66353ce0]].Name);
   s.Close();
}

 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#66353e00]]
BaseClassLoad 
12[[#66353e00]]
SpecificSubclass 
21[[#66353d60]]
A 
22[[#66353d60]]
B 
31[[#66353ce0]]
a 
32[[#66353ce0]]
b 
41[[#66353c80]]
aId 
42[[#66353c80]]
bId 
51[[#66353be0]]
"the a" 
52[[#66353be0]]
"the b" 
61[[#66353b60]]
"from A as a where a.id = :id " 
62[[#66353b60]]
"from B as b where b.id = :id"