Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
87 | 2 | 6 | 0.962 | compilation_unit |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 87 | 1 | src/NHibernate/Driver/MySqlDataDriver.cs |
2 | 73 | 1 | src/NHibernate/Driver/NpgsqlDriver.cs |
| ||||
using System; namespace NHibernate.Driver { /// <summary> /// Provides a database driver for MySQL. /// </summary> /// <remarks> /// <para> /// In order to use this driver you must have the assembly <c>MySql.Data.dll</c> available for /// NHibernate to load, including its dependencies (<c>ICSharpCode.SharpZipLib.dll</c> is required by /// the assembly <c>MySql.Data.dll</c> as of the time of this writing). /// </para> /// <para> /// Please check the product's <see href="http://www.mysql.com/products/connector/net/">website</see> /// for any updates and/or documentation regarding MySQL. /// </para> /// </remarks> public class MySqlDataDriver : ReflectionBasedDriver { /// <summary> /// Initializes a new instance of the <see cref="MySqlDataDriver"/> class. /// </summary> /// <exception cref="HibernateException"> /// Thrown when the <c>MySql.Data</c> assembly can not be loaded. /// </exception> public MySqlDataDriver() : base( "MySql.Data", "MySql.Data.MySqlClient.MySqlConnection", "MySql.Data.MySqlClient.MySqlCommand") { } /// <summary> /// MySql.Data uses named parameters in the sql. /// </summary> /// <value><see langword="true" /> - MySql uses <c>?</c> in the sql.</value> public override bool UseNamedPrefixInSql { get { return true; } } /// <summary></summary> public override bool UseNamedPrefixInParameter { get { return true; } } /// <summary> /// MySql.Data use the <c>?</c> to locate parameters in sql. /// </summary> /// <value><c>?</c> is used to locate parameters in sql.</value> public override string NamedPrefix { get { return "?"; } } /// <summary> /// The MySql.Data driver does NOT support more than 1 open IDataReader /// with only 1 IDbConnection. /// </summary> /// <value><see langword="false" /> - it is not supported.</value> public override bool SupportsMultipleOpenReaders { get { return false; } } /// <summary> /// MySql.Data does not support preparing of commands. /// </summary> /// <value><see langword="false" /> - it is not supported.</value> /// <remarks> /// With the Gamma MySql.Data provider it is throwing an exception with the /// message "Expected End of data packet" when a select command is prepared. /// </remarks> protected override bool SupportsPreparingCommands { get { return false; } } public override bool SupportsMultipleQueries { get { return true; } } } } |
| ||||
namespace NHibernate.Driver { /// <summary> /// The PostgreSQL data provider provides a database driver for PostgreSQL. /// <p> /// Author: <a href="mailto:oliver@weichhold.com">Oliver Weichhold</a> /// </p> /// </summary> /// <remarks> /// <p> /// In order to use this Driver you must have the Npgsql.dll Assembly available for /// NHibernate to load it. /// </p> /// <p> /// Please check the products website /// <a href="http://www.postgresql.org/">http://www.postgresql.org/</a> /// for any updates and or documentation. /// </p> /// <p> /// The homepage for the .NET DataProvider is: /// <a href="http://pgfoundry.org/projects/npgsql">http://pgfoundry.org/projects/npgsql</a>. /// </p> /// </remarks> public class NpgsqlDriver : ReflectionBasedDriver { /// <summary> /// Initializes a new instance of the <see cref="NpgsqlDriver"/> class. /// </summary> /// <exception cref="HibernateException"> /// Thrown when the <c>Npgsql</c> assembly can not be loaded. /// </exception> public NpgsqlDriver() : base( "Npgsql", "Npgsql.NpgsqlConnection", "Npgsql.NpgsqlCommand") { } public override bool UseNamedPrefixInSql { get { return true; } } public override bool UseNamedPrefixInParameter { get { return true; } } public override string NamedPrefix { get { return ":"; } } public override bool SupportsMultipleOpenReaders { get { return false; } } protected override bool SupportsPreparingCommands { // NOTE: Npgsql1.0 and 2.0-preview apparently doesn't correctly support prepared commands. // The following exception is thrown on insert statements: // Npgsql.NpgsqlException : ERROR: 42601: cannot insert multiple commands into a prepared statement get { return false; } } public override bool SupportsMultipleQueries { get { return true; } } } } |
| |||
[[#variable70bb4280]] namespace NHibernate.Driver { /// <summary> /// Provides a database driver for MySQL. /// The PostgreSQL data provider provides a database driver for PostgreSQL. /// <p> /// Author: <a href="mailto:oliver@weichhold.com">Oliver Weichhold</a> /// </p> /// </summary> /// <remarks> /// <para> /// In order to use this driver you must have the assembly <c>MySql.Data.dll</c> available for /// NHibernate to load, including its dependencies (<c>ICSharpCode.SharpZipLib.dll</c> is required by /// the assembly <c>MySql.Data.dll</c> as of the time of this writing). /// </para> /// <para> /// Please check the product's <see href="http://www.mysql.com/products/connector/net/">website</see> /// for any updates and/or documentation regarding MySQL. /// </para> /// <p> /// In order to use this Driver you must have the Npgsql.dll Assembly available for /// NHibernate to load it. /// </p> /// <p> /// Please check the products website /// <a href="http://www.postgresql.org/">http://www.postgresql.org/</a> /// for any updates and or documentation. /// </p> /// <p> /// The homepage for the .NET DataProvider is: /// <a href="http://pgfoundry.org/projects/npgsql">http://pgfoundry.org/projects/npgsql</a>. /// </p> /// </remarks> public class [[#variable70bb41a0]]: ReflectionBasedDriver { /// <summary> /// Initializes a new instance of the <see cref="MySqlDataDriver"/> class. /// Initializes a new instance of the <see cref="NpgsqlDriver"/> class. /// </summary> /// <exception cref="HibernateException"> /// Thrown when the <c>MySql.Data</c> assembly can not be loaded. /// Thrown when the <c>Npgsql</c> assembly can not be loaded. /// </exception> public [[#variable70bb41a0]](): base( [[#variable70bb41c0]], [[#variable70bb4160]], [[#variable70bb40e0]]) { } /// <summary> /// MySql.Data uses named parameters in the sql. /// </summary> /// <value><see langword="true" /> - MySql uses <c>?</c> in the sql.</value> public override bool UseNamedPrefixInSql { get { return true; } } /// <summary></summary> public override bool UseNamedPrefixInParameter { get { return true; } } /// <summary> /// MySql.Data use the <c>?</c> to locate parameters in sql. /// </summary> /// <value><c>?</c> is used to locate parameters in sql.</value> public override string NamedPrefix { get { return [[#variable70bb40c0]]; } } /// <summary> /// The MySql.Data driver does NOT support more than 1 open IDataReader /// with only 1 IDbConnection. /// </summary> /// <value><see langword="false" /> - it is not supported.</value> public override bool SupportsMultipleOpenReaders { get { return false; } } /// <summary> /// MySql.Data does not support preparing of commands. /// </summary> /// <value><see langword="false" /> - it is not supported.</value> /// <remarks> /// With the Gamma MySql.Data provider it is throwing an exception with the /// message "Expected End of data packet" when a select command is prepared. /// </remarks> protected override bool SupportsPreparingCommands { // NOTE: Npgsql1.0 and 2.0-preview apparently doesn't correctly support prepared commands. // The following exception is thrown on insert statements: // Npgsql.NpgsqlException : ERROR: 42601: cannot insert multiple commands into a prepared statement get { return false; } } public override bool SupportsMultipleQueries { get { return true; } } } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#70bb4280]] | using System; |
1 | 2 | [[#70bb4280]] | |
2 | 1 | [[#70bb41a0]] | MySqlDataDriver |
2 | 2 | [[#70bb41a0]] | NpgsqlDriver |
3 | 1 | [[#70bb41c0]] | "MySql.Data" |
3 | 2 | [[#70bb41c0]] | "Npgsql" |
4 | 1 | [[#70bb4160]] | "MySql.Data.MySqlClient.MySqlConnection" |
4 | 2 | [[#70bb4160]] | "Npgsql.NpgsqlConnection" |
5 | 1 | [[#70bb40e0]] | "MySql.Data.MySqlClient.MySqlCommand" |
5 | 2 | [[#70bb40e0]] | "Npgsql.NpgsqlCommand" |
6 | 1 | [[#70bb40c0]] | "?" |
6 | 2 | [[#70bb40c0]] | ":" |