Reputation: 30031
I am using the config below for NHibernate to connect to Oracle. In one of the classes, I am storing a unicode string such as 日本語 (日本). The data field for the column is NVARCHAR2() however, when retrieving the data, the value is corrupt showing ??? (??). Somewhere along the line I'm losing my encoding, but am a loss as to where. Any ideas?
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property>
<property name="connection.connection_string_name">Oracle</property>
<property name="show_sql">true</property>
<property name="dialect">NHibernate.Dialect.Oracle10gDialect</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<property name="cache.use_second_level_cache">true</property>
<property name="adonet.batch_size">30</property>
<property name="cache.provider_class">NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache</property>
<property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>
</session-factory>
Upvotes: 0
Views: 905
Reputation: 754
No need to write a custom dialect, a user type is enough. See my answer to this question: https://stackoverflow.com/a/61792204/5168579
Upvotes: 0
Reputation: 11
NHibernate dose not use NVarChar2. If you want NHibernate to use NVarchar2 than you have to write your own database dialect.
Upvotes: 1