Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
44 | 2 | 5 | 0.966 | compilation_unit |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 44 | 1 | src/NHibernate/Type/TrueFalseType.cs |
2 | 44 | 1 | 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>'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"; } } } } |
| ||||
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"; } } } } |
| |||
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 Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#2d6cb6c0]] | TrueFalseType |
1 | 2 | [[#2d6cb6c0]] | YesNoType |
2 | 1 | [[#2d6cb640]] | /// <summary></summary> internal |
2 | 2 | [[#2d6cb640]] | /// <summary></summary> public |
3 | 1 | [[#2d6cb5c0]] | "T" |
3 | 2 | [[#2d6cb5c0]] | "Y" |
4 | 1 | [[#2d6cb560]] | "F" |
4 | 2 | [[#2d6cb560]] | "N" |
5 | 1 | [[#2d6cb4e0]] | "TrueFalse" |
5 | 2 | [[#2d6cb4e0]] | "YesNo" |