I am trying to implement this solution: NHibernate-20-SQLite-and-In-Memory-Databases
The only problem is that we have hbms like this:
<class name="aTable" table="[dbo].[aTable]" mutable="true" lazy="false">
with [dbo]
in the table name, because we are working with mssql, and this does not work with Sqlite.
I found this posting on the rhino-tools-dev group where they talk about just removing the schema from the mapping, but on NH2 there doesn't seem to be a classMapping.Schema
.
There is a classMapping.Table.Schema
, but it seems to be read-only. For example, this doesn't work:
foreach (PersistentClass cp in configuration.ClassMappings) {
// Does not work - throws a
//System.IndexOutOfRangeException: Index was outside the bounds of the array.
cp.Table.Schema = "";
}
- Is there a way to tell Sqlite to ignore the
[dbo]
(I triedattach database :memory: as dbo
, but this didn't seem to help)? - Alternatively, can I programmatically remove it from the classmappings (unfortunately changing the hbms is not possible right now)?