We have built the MySql connector from source and changed the assembly name to OurCompany.MySql.Data.
Also, I am exploring ORM’s for the first time and came across NHibernate. After configuring everything and mapping my first test class I am at a point where our renamed MySql connector is now a problem. Is there a way I can point NHibernate to our renamed assembly?
** edit heres my config **
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="dialect">
NHibernate.Dialect.MySQLDialect
</property>
<property name="connection.provider">
NHibernate.Connection.DriverConnectionProvider
</property>
<property name="connection.driver_class">
NHibernate.Driver.MySqlDataDriver
</property>
<property name="connection.connection_string">
Server=192.168.2.5;Database=TomTest;User ID=webuser;Password=webuser
</property>
<property name="show_sql">true</property>
<property name="proxyfactory.factory_class">
NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle
</property>
<!-- HBM Mapping Files -->
<mapping assembly="MyAssembly"/>
</session-factory>
</hibernate-configuration>
Take a look at the code of MySqlDataDriver. It’s trivial to write a ReflectionBasedDriver that is exactly like the MySqlDataDriver but only differs in the assembly name (the second parameter in the constructor). Then plug your driver in the
connection.driver_classproperty (use its fully qualified type name)