Closed
Description
Issue since NH5:
When I use:
NHibernate.Cfg.Configuration.GenerateSchemaCreationScript(new Oracle8iDialect());
an exception is thrown:
Message:
Dialect does not support DbType.String
Parametername: typecode
StackTrace:
at NHibernate.Dialect.TypeNames.Get(DbType typecode)
at NHibernate.Dialect.Dialect.GetTypeName(SqlType sqlType)
at NHibernate.Mapping.Column.GetDialectTypeName(Dialect dialect, IMapping mapping)
at NHibernate.Mapping.Column.GetSqlType(Dialect dialect, IMapping mapping)
at NHibernate.Mapping.Table.SqlCreateString(Dialect dialect, IMapping p, String defaultCatalog, String defaultSchema)
at NHibernate.Cfg.Configuration.GenerateSchemaCreationScript(Dialect dialect)
I checked the sourcecode and found the problem:
Inside the constructor of Oracle8iDialect
there was a line removed:
RegisterCharacterTypeMappings();
(line 84)
I inherited a new class from Oracle8iDialect
and added that line in the constructor.
This should fix the issue. But it needs to be confirmed and checked further.
Question is: Why was that mapping removed?
public sealed class Oracle10gFixed : Oracle10gDialect
{
public Oracle10gFixed()
{
RegisterCharacterTypeMappings();
}
}
UPDATE:
This issue does not occur with SchemaUpdate
or SchemaExport
,
only with the GenerateSchemaCreationScript
method in Configuration
.