I am trying to run NHibernate over sqlite. I have two projects: 1. Orange.Database - contains pocos and daos and everything else 2. Orange.GUI - contains gui ...
when the program reaches reach:
Configuration config = new Configuration(); config.AddAssembly("Orange.Database"); sessionFactory = config.Configure().BuildSessionFactory();
an exception is thrown: "Failed to compile the mapping document: Orange.Database.Pocos.City.hbm.xml" internal exception: "Could not find the dialect in the configuration"
city.hbm.xml:
<?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Orange.Database.Pocos"> <class name="City" table="Cities"> <id name="Id"> <column name="Id" sql-type="int" not-null="true"/> <generator class="identity"/> </id> <property name="Name"> <column name="name" not-null="true"/> </property> <property name="IsTaxFree"> <column name="is_tax_free" not-null="true"/> </property> </class> </hibernate-mapping>
I tried to overlay the assembly and then deleted it.
app.config file:
<?xml version="1.0" encoding="utf-8" ?>
<configSections> <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler,NHibernate"/> </configSections> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" > <session-factory> <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> <property name="connection.driver_class">NHibernate.Driver.SQLiteDriver</property> <property name="connection.connection_string"> Data Source=C:\Users\Nadav\Documents\Visual Studio 2005\Projects\orange\DB\OrangeDB\OrangeDB.db;Version=3 </property> <property name="dialect">NHibernate.Dialect.SQLiteDialect</property> <property name="query.substitutions">true=1;false=0</property> </session-factory> </hibernate-configuration> </configuration>
I tried different location of db file. I tried to remove configSections and some other ideas that I found on the Internet ...
I am using vs 2005 NHibernate version - 2.0.1.4000
Any suggestions?
mapping sqlite nhibernate
Nadav
source share