<commit_before>using System;
using System.Data;
using System.Reflection;
using NHibernate.AdoNet;
using NHibernate.Engine.Query;
using NHibernate.SqlTypes;
using NHibernate.Util;

namespace NHibernate.Driver
{
	/// <summary>
	/// A NHibernate Driver for using the Oracle.ManagedDataAccess DataProvider
	/// </summary>
	public class OracleManagedDataClientDriver : ReflectionBasedDriver, IEmbeddedBatcherFactoryProvider
	{
		private const string driverAssemblyName = "Oracle.ManagedDataAccess";
		private const string connectionTypeName = "Oracle.ManagedDataAccess.Client.OracleConnection";
		private const string commandTypeName = "Oracle.ManagedDataAccess.Client.OracleCommand";
		private static readonly SqlType GuidSqlType = new SqlType(DbType.Binary, 16);
		private readonly PropertyInfo oracleCommandBindByName;
		private readonly PropertyInfo oracleDbType;
		private readonly object oracleDbTypeRefCursor;
		private readonly object oracleDbTypeXmlType;

		/// <summary>
		/// Initializes a new instance of <see cref="OracleDataClientDriver"/>.
		/// </summary>
		/// <exception cref="HibernateException">
		/// Thrown when the <c>Oracle.ManagedDataAccess</c> assembly can not be loaded.
		/// </exception>
		public OracleManagedDataClientDriver()
			: base(
				"Oracle.ManagedDataAccess.Client",
				driverAssemblyName,
				connectionTypeName,
				commandTypeName)
		{
			var oracleCommandType = ReflectHelper.TypeFromAssembly("Oracle.ManagedDataAccess.Client.OracleCommand", driverAssemblyName, false);
			oracleCommandBindByName = oracleCommandType.GetProperty("BindByName");

			var parameterType = ReflectHelper.TypeFromAssembly("Oracle.ManagedDataAccess.Client.OracleParameter", driverAssemblyName, false);
			oracleDbType = parameterType.GetProperty("OracleDbType");

			var oracleDbTypeEnum = ReflectHelper.TypeFromAssembly("Oracle.ManagedDataAccess.Client.OracleDbType", driverAssemblyName, false);
			oracleDbTypeRefCursor = Enum.Parse(oracleDbTypeEnum, "RefCursor");
			oracleDbTypeXmlType = Enum.Parse(oracleDbTypeEnum, "XmlType");
		}

		/// <summary></summary>
		public override string NamedPrefix
		{
			get { return ":"; }
		}

		/// <summary></summary>
		public override bool UseNamedPrefixInParameter
		{
			get { return true; }
		}

		/// <summary></summary>
		public override bool UseNamedPrefixInSql
		{
			get { return true; }
		}

		/// <remarks>
		/// This adds logic to ensure that a DbType.Boolean parameter is not created since
		/// ODP.NET doesn't support it.
		/// </remarks>
		protected override void InitializeParameter(IDbDataParameter dbParam, string name, SqlType sqlType)<commit_msg>Throw exception when driver assembly could not be found<commit_after>using System;
using System.Data;
using System.Reflection;
using NHibernate.AdoNet;
using NHibernate.Engine.Query;
using NHibernate.SqlTypes;
using NHibernate.Util;

namespace NHibernate.Driver
{
	/// <summary>
	/// A NHibernate Driver for using the Oracle.ManagedDataAccess DataProvider
	/// </summary>
	public class OracleManagedDataClientDriver : ReflectionBasedDriver, IEmbeddedBatcherFactoryProvider
	{
		private const string driverAssemblyName = "Oracle.ManagedDataAccess";
		private const string connectionTypeName = "Oracle.ManagedDataAccess.Client.OracleConnection";
		private const string commandTypeName = "Oracle.ManagedDataAccess.Client.OracleCommand";
		private static readonly SqlType GuidSqlType = new SqlType(DbType.Binary, 16);
		private readonly PropertyInfo oracleCommandBindByName;
		private readonly PropertyInfo oracleDbType;
		private readonly object oracleDbTypeRefCursor;
		private readonly object oracleDbTypeXmlType;

		/// <summary>
		/// Initializes a new instance of <see cref="OracleDataClientDriver"/>.
		/// </summary>
		/// <exception cref="HibernateException">
		/// Thrown when the <c>Oracle.ManagedDataAccess</c> assembly can not be loaded.
		/// </exception>
		public OracleManagedDataClientDriver()
			: base(
				"Oracle.ManagedDataAccess.Client",
				driverAssemblyName,
				connectionTypeName,
				commandTypeName)
		{
			var oracleCommandType = ReflectHelper.TypeFromAssembly("Oracle.ManagedDataAccess.Client.OracleCommand", driverAssemblyName, true);
			oracleCommandBindByName = oracleCommandType.GetProperty("BindByName");

			var parameterType = ReflectHelper.TypeFromAssembly("Oracle.ManagedDataAccess.Client.OracleParameter", driverAssemblyName, true);
			oracleDbType = parameterType.GetProperty("OracleDbType");

			var oracleDbTypeEnum = ReflectHelper.TypeFromAssembly("Oracle.ManagedDataAccess.Client.OracleDbType", driverAssemblyName, true);
			oracleDbTypeRefCursor = Enum.Parse(oracleDbTypeEnum, "RefCursor");
			oracleDbTypeXmlType = Enum.Parse(oracleDbTypeEnum, "XmlType");
		}

		/// <summary></summary>
		public override string NamedPrefix
		{
			get { return ":"; }
		}

		/// <summary></summary>
		public override bool UseNamedPrefixInParameter
		{
			get { return true; }
		}

		/// <summary></summary>
		public override bool UseNamedPrefixInSql
		{
			get { return true; }
		}

		/// <remarks>
		/// This adds logic to ensure that a DbType.Boolean parameter is not created since
		/// ODP.NET doesn't support it.
		/// </remarks>
		protected override void InitializeParameter(IDbDataParameter dbParam, string name, SqlType sqlType)
{'fraction_non_alphanumeric': 0.0975609756097561, 'fraction_numerical': 0.0007562866326337682, 'mean_word_length': 4.858250276854928, 'pattern_counts': {'":': 2, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5522909', 'n_tokens_mistral': 1643, 'n_tokens_neox': 1439, 'n_words': 355}