Skip to content

Added driver to support dotConnect for MySql #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 30, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions src/NHibernate/Driver/DotConnectMySqlDriver.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
namespace NHibernate.Driver
{
/// <summary>
/// Provides a database driver for dotConnect for MySQL by DevArt.
/// </summary>
/// <remarks>
/// <para>
/// In order to use this driver you must have the assembly <c>Devart.Data.MySql.dll</c> available for
/// NHibernate to load, including its dependencies (<c>Devart.Data.dll</c>).
/// </para>
/// <para>
/// Please check the product's <see href="http://www.devart.com/dotconnect/mysql/">website</see>
/// for any updates and/or documentation regarding dotConnect for MySQL.
/// </para>
/// </remarks>
public class DotConnectMySqlDriver : ReflectionBasedDriver
{
/// <summary>
/// Initializes a new instance of the <see cref="DotConnectMySqlDriver"/> class.
/// </summary>
/// <exception cref="HibernateException">
/// Thrown when the <c>Devart.Data.MySql</c> assembly can not be loaded.
/// </exception>
public DotConnectMySqlDriver() : base(
"Devart.Data.MySql",
"Devart.Data.MySql.NHibernate.NHibernateMySqlConnection",
"Devart.Data.MySql.NHibernate.NHibernateMySqlCommand")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could not find "Devart.Data.MySql.NHibernate.NHibernateMySqlConnection" and "Devart.Data.MySql.NHibernate.NHibernateMySqlCommand" classes in Devart.Data.MySql.dll

Are you sure that this is not a mistake?

{
}

/// <summary>
/// Devart.Data.MySql 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>
/// Devart.Data.MySql 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 "@"; }
}
}
}
1 change: 1 addition & 0 deletions src/NHibernate/NHibernate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
<Compile Include="Dialect\SybaseSQLAnywhere12Dialect.cs" />
<Compile Include="Dialect\TypeNames.cs" />
<Compile Include="Driver\DB2Driver.cs" />
<Compile Include="Driver\DotConnectMySqlDriver.cs" />
<Compile Include="Driver\DriverBase.cs" />
<Compile Include="Driver\FirebirdDriver.cs" />
<Compile Include="Driver\IDriver.cs" />
Expand Down