CloneSet901


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
44250.966compilation_unit
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1441
src/NHibernate/Type/TrueFalseType.cs
2441
src/NHibernate/Type/YesNoType.cs
Clone Instance
1
Line Count
44
Source Line
1
Source File
src/NHibernate/Type/TrueFalseType.cs

using System;
using NHibernate.SqlTypes;

namespace NHibernate.Type
{
        /// <summary>
        /// Maps a <see cref="System.Boolean" /> to a 1 char <see cref="System.Data.DbType.AnsiStringFixedLength" /> column 
        /// that stores a <code>'T'/'F'</code> to indicate <code>true/false</code>.
        /// </summary>
        /// <remarks>
        /// If you are using schema-export to generate your tables then you need
        /// to set the column attributes: <c>length=1</c> or <c>sql-type="char(1)"</c>.
        /// 
        /// This needs to be done because in Java's JDBC there is a type for CHAR and 
        /// in ADO.NET there is not one specifically for char, so you need to tell schema
        /// export to create a char(1) column.
        /// </remarks>
        [Serializable]
        public class TrueFalseType : CharBooleanType
        {
                /// <summary></summary>
                internal TrueFalseType() : base(new AnsiStringFixedLengthSqlType(1))
                {
                }

                /// <summary></summary>
                protected override sealed string TrueString
                {
                        get { return "T";
                            }
                }

                /// <summary></summary>
                protected override sealed string FalseString
                {
                        get { return "F";
                            }
                }

                /// <summary></summary>
                public override string Name
                {
                        get { return "TrueFalse";
                            }
                }

        }
}


Clone Instance
2
Line Count
44
Source Line
1
Source File
src/NHibernate/Type/YesNoType.cs

using System;
using NHibernate.SqlTypes;

namespace NHibernate.Type
{
        /// <summary>
        /// Maps a <see cref="System.Boolean" /> to a 1 char <see cref="System.Data.DbType.AnsiStringFixedLength" /> column 
        /// that stores a <code>'Y'/'N'</code> to indicate <code>true/false</code>.
        /// </summary>
        /// <remarks>
        /// If you are using schema-export to generate your tables then you need
        /// to set the column attributes: <c>length=1</c> or <c>sql-type="char(1)"</c>.
        /// 
        /// This needs to be done because in Java's JDBC there is a type for CHAR and 
        /// in ADO.NET there is not one specifically for char, so you need to tell schema
        /// export to create a char(1) column.
        /// </remarks>
        [Serializable]
        public class YesNoType : CharBooleanType
        {
                /// <summary></summary>
                public YesNoType() : base(new AnsiStringFixedLengthSqlType(1))
                {
                }

                /// <summary></summary>
                protected override sealed string TrueString
                {
                        get { return "Y";
                            }
                }

                /// <summary></summary>
                protected override sealed string FalseString
                {
                        get { return "N";
                            }
                }

                /// <summary></summary>
                public override string Name
                {
                        get { return "YesNo";
                            }
                }

        }
}


Clone AbstractionParameter Count: 5Parameter Bindings

using System;
using NHibernate.SqlTypes;
namespace NHibernate.Type
{
   /// <summary>
   /// Maps a <see cref="System.Boolean" /> to a 1 char <see cref="System.Data.DbType.AnsiStringFixedLength" /> column 
   /// that stores a <code>'T'/'F'</code> to indicate <code>true/false</code>.
   /// that stores a <code>'Y'/'N'</code> to indicate <code>true/false</code>.
   /// </summary>
   /// <remarks>
   /// If you are using schema-export to generate your tables then you need
   /// to set the column attributes: <c>length=1</c> or <c>sql-type="char(1)"</c>.
   /// 
   /// This needs to be done because in Java's JDBC there is a type for CHAR and 
   /// in ADO.NET there is not one specifically for char, so you need to tell schema
   /// export to create a char(1) column.
   /// </remarks>
   [Serializable]
   public class [[#variable2d6cb6c0]]: CharBooleanType
   {
       [[#variable2d6cb640]] [[#variable2d6cb6c0]](): base(new AnsiStringFixedLengthSqlType(1))
      {
      }

      /// <summary></summary>
      protected override sealed string TrueString
      {
         get
         {
            return [[#variable2d6cb5c0]];
         }
      }

      /// <summary></summary>
      protected override sealed string FalseString
      {
         get
         {
            return [[#variable2d6cb560]];
         }
      }

      /// <summary></summary>
      public override string Name
      {
         get
         {
            return [[#variable2d6cb4e0]];
         }
      }

   }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#2d6cb6c0]]
TrueFalseType 
12[[#2d6cb6c0]]
YesNoType 
21[[#2d6cb640]]
/// <summary></summary>
internal 
22[[#2d6cb640]]
/// <summary></summary>
public 
31[[#2d6cb5c0]]
"T" 
32[[#2d6cb5c0]]
"Y" 
41[[#2d6cb560]]
"F" 
42[[#2d6cb560]]
"N" 
51[[#2d6cb4e0]]
"TrueFalse" 
52[[#2d6cb4e0]]
"YesNo"