CloneSet295


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
41250.963compilation_unit
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1411
src/NHibernate.Test/Generatedkeys/ByTrigger/GeneratedIdentityFixture.cs
2411
src/NHibernate.Test/Generatedkeys/Seqidentity/SequenceIdentityFixture.cs
Clone Instance
1
Line Count
41
Source Line
1
Source File
src/NHibernate.Test/Generatedkeys/ByTrigger/GeneratedIdentityFixture.cs

using System.Collections;
using NUnit.Framework;

namespace NHibernate.Test.Generatedkeys.ByTrigger
{
        [TestFixture]
        public class GeneratedIdentityFixture : TestCase
        {
                protected override IList Mappings
                {
                        get { return new [] { "Generatedkeys.ByTrigger.MyEntity.hbm.xml"
                                            } ;
                            }
                }

                protected override string MappingsAssembly
                {
                        get { return "NHibernate.Test";
                            }
                }

                protected override bool AppliesTo(Dialect.Dialect dialect)
                {
                        return dialect is Dialect.Oracle8iDialect;
                }

                [Test]
                public void GetGeneratedKeysSupport()
                {
                        ISession session = OpenSession();
                        session.BeginTransaction();

                        var e = new MyEntity { Name = "entity-1"
                                             } ;
                        session.Save(e);
                        // this insert should happen immediately!
                        Assert.AreEqual(1, e.Id, "id not generated through forced insertion");

                        session.Delete(e);
                        session.Transaction.Commit();
                        session.Close();
                }

        }
}


Clone Instance
2
Line Count
41
Source Line
1
Source File
src/NHibernate.Test/Generatedkeys/Seqidentity/SequenceIdentityFixture.cs

using System.Collections;
using NUnit.Framework;

namespace NHibernate.Test.Generatedkeys.Seqidentity
{
        [TestFixture]
        public class SequenceIdentityFixture : TestCase
        {
                protected override IList Mappings
                {
                        get { return new [] { "Generatedkeys.Seqidentity.MyEntity.hbm.xml"
                                            } ;
                            }
                }

                protected override string MappingsAssembly
                {
                        get { return "NHibernate.Test";
                            }
                }

                protected override bool AppliesTo(Dialect.Dialect dialect)
                {
                        return dialect.SupportsSequences;
                }

                [Test]
                public void SequenceIdentityGenerator()
                {
                        ISession session = OpenSession();
                        session.BeginTransaction();

                        var e = new MyEntity { Name = "entity-1"
                                             } ;
                        session.Save(e);
                        // this insert should happen immediately!
                        Assert.AreEqual(1, e.Id, "id not generated through forced insertion");

                        session.Delete(e);
                        session.Transaction.Commit();
                        session.Close();
                }

        }
}


Clone AbstractionParameter Count: 5Parameter Bindings

using System.Collections;
using NUnit.Framework;
namespace NHibernate.Test.Generatedkeys. [[#variable6c5371c0]]
{
   [TestFixture]
   public class [[#variable6c537120]]: TestCase
   {
      protected override IList Mappings
      {
         get
         {
            return new []
                   {
                       [[#variable6c537140]]
                   } ;
         }
      }

      protected override string MappingsAssembly
      {
         get
         {
            return "NHibernate.Test";
         }
      }

      protected override bool AppliesTo(Dialect.Dialect dialect)
      {
         return [[#variable6c5370e0]];
      }

      [Test]
      public void [[#variable6c5370c0]]()
      {
         ISession session = OpenSession();
         session.BeginTransaction();
         var e = new MyEntity {
                                 Name = "entity-1"
                              } ;
         session.Save(e);
         // this insert should happen immediately!
         Assert.AreEqual(1, e.Id, "id not generated through forced insertion");
         session.Delete(e);
         session.Transaction.Commit();
         session.Close();
      }

   }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#6c5371c0]]
ByTrigger 
12[[#6c5371c0]]
Seqidentity 
21[[#6c537120]]
GeneratedIdentityFixture 
22[[#6c537120]]
SequenceIdentityFixture 
31[[#6c537140]]
"Generatedkeys.ByTrigger.MyEntity.hbm.xml" 
32[[#6c537140]]
"Generatedkeys.Seqidentity.MyEntity.hbm.xml" 
41[[#6c5370e0]]
dialect is Dialect.Oracle8iDialect 
42[[#6c5370e0]]
dialect.SupportsSequences 
51[[#6c5370c0]]
GetGeneratedKeysSupport 
52[[#6c5370c0]]
SequenceIdentityGenerator